Skip to content

Commit

Permalink
Fix “I have multiple blogs and multiple locales” scenario
Browse files Browse the repository at this point in the history
Fix fixtures that generated empty route for blogs with locale
  • Loading branch information
alexislefebvre committed Jan 19, 2018
1 parent 682c7c3 commit 8d7c444
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
Expand Up @@ -9,6 +9,9 @@ Victoire\Bundle\BlogBundle\Entity\Blog:
createdAt: <dateTime('now')>
updatedAt: <dateTime('now')>
cssUpToDate: false
currentLocale: en
name: blog 1 EN
slug: blog-1-en
blog_2:
parent: "@home"
template: "@template_base"
Expand All @@ -19,6 +22,9 @@ Victoire\Bundle\BlogBundle\Entity\Blog:
createdAt: <dateTime('now')>
updatedAt: <dateTime('now')>
cssUpToDate: false
currentLocale: fr
name: blog 2 FR
slug: blog-2-fr

Victoire\Bundle\BlogBundle\Entity\ArticleTemplate:
article_template_1:
Expand Down Expand Up @@ -50,16 +56,6 @@ Victoire\Bundle\I18nBundle\Entity\ViewTranslation:
slug: blog-1-fr
locale: fr
translatable: "@blog_1"
blog_1_en:
name: blog 1 EN
slug: blog-1-en
locale: en
translatable: "@blog_1"
blog_2_fr:
name: blog 2 FR
slug: blog-2-fr
locale: fr
translatable: "@blog_2"
article_template_1_fr:
name: article 1 FR {{item.name}}
slug: article-1-fr-{{item.slug}}
Expand Down
23 changes: 17 additions & 6 deletions Tests/Features/Blog/blogI18n.feature
Expand Up @@ -86,6 +86,14 @@ Feature: I can edit multiple blogs in multiples locales

@alice(BlogsWithLocalesi18n)
Scenario: I have multiple blogs and multiple locales
# There are 3 blogs
Given I am on "/en/blog-1-en"
And the title should be "blog 1 EN"
And I am on "/fr/blog-1-fr"
And the title should be "blog 1 FR"
And I am on "/fr/blog-2-fr"
And the title should be "blog 2 FR"
Given I am on homepage
When I follow "Blog"
Then I should see "Pick your blog"
And I should see "Create a post now"
Expand All @@ -99,22 +107,25 @@ Feature: I can edit multiple blogs in multiples locales
When I fill in "article_translations_fr_description" with "description"
And I follow "Create"
And I wait 1 second
And the url should match "/fr/blog-1-fr/article-1-fr-titre1"
And the url should match "/en/blog-1-en/article-1-en-title1"
And the title should be "article 1 EN title1"
# Switch to French in order to show the second blog that only have French translation
When I go to "/fr/"
And I should see "Blog"
When I follow "Blog"
Then I should see "titre"
And I wait 2 seconds
When I select "fr" from "choose_blog_locale"
And I wait 1 second
Then I should see "blog 2 FR"
Then I should see "blog 1 FR"
And I should see "titre1"
When I select "blog 2 FR" from "choose_blog_blog"
And I wait 1 second
Then I should see "blog 2 FR"
Then I should not see "titre1"
And I should see "Créer un article maintenant"
When I follow "Créer un article maintenant"
Then I should see "Créer un nouvel article"
When I fill in "article_translations_fr_name" with "titre2"
When I fill in "article_translations_fr_description" with "description"
And I follow "Créer"
And I wait 1 second
Then the url should match "/fr/blog-2-fr/article-2-fr-titre2"
And I should see "Blog"
When I follow "Blog"
Expand Down

0 comments on commit 8d7c444

Please sign in to comment.