Commit 0829bd3bbdc391a94495fc8a201e61065ae646e6
1 parent
944bfd33
Exists in
master
and in
22 other branches
edit_language_block.feature
Showing
2 changed files
with
8 additions
and
7 deletions
Show diff stats
features/edit_language_block.feature
| ... | ... | @@ -15,25 +15,25 @@ Feature: edit language of block |
| 15 | 15 | Scenario: display in all languages |
| 16 | 16 | Given I go to edit ArticleBlock of joaosilva |
| 17 | 17 | And I fill in "Custom title for this block" with "Block displayed" |
| 18 | - And I select "all languages" | |
| 18 | + And I select "all languages" from "Show for" | |
| 19 | 19 | And I press "Save" |
| 20 | - When I go to Jose Silva's homepage | |
| 20 | + When I go to joaosilva's homepage | |
| 21 | 21 | Then I should see "Block displayed" |
| 22 | 22 | |
| 23 | 23 | Scenario: display in the selected language |
| 24 | 24 | Given I go to edit LinkListBlock of joaosilva |
| 25 | 25 | And I fill in "Custom title for this block" with "Block displayed" |
| 26 | - And I select "English" | |
| 26 | + And I select "English" from "Show for" | |
| 27 | 27 | And I press "Save" |
| 28 | 28 | And my browser prefers English |
| 29 | - When I go to Jose Silva's homepage | |
| 29 | + When I go to joaosilva's homepage | |
| 30 | 30 | Then I should see "Block displayed" |
| 31 | 31 | |
| 32 | 32 | Scenario: not display in a not selected language |
| 33 | 33 | Given I go to edit LinkListBlock of joaosilva |
| 34 | 34 | And I fill in "Custom title for this block" with "Block not displayed" |
| 35 | - And I select "English" | |
| 35 | + And I select "English" from "Show for" | |
| 36 | 36 | And I press "Save" |
| 37 | 37 | And my browser prefers Portuguese |
| 38 | - When I go to Jose Silva's homepage | |
| 38 | + When I go to joaosilva's homepage | |
| 39 | 39 | Then I should not see "Block displayed" | ... | ... |
features/step_definitions/internationalization_steps.rb
| 1 | +# -*- coding: utf-8 -*- | |
| 1 | 2 | def language_to_code(name) |
| 2 | 3 | { |
| 3 | 4 | 'Brazilian Portuguese' => 'pt-br', |
| ... | ... | @@ -35,7 +36,7 @@ Given /^a user accessed in (.*) before$/ do |lang| |
| 35 | 36 | end |
| 36 | 37 | |
| 37 | 38 | Given /^my browser prefers (.*)$/ do |lang| |
| 38 | - header 'Accept-Language', language_to_code(lang) | |
| 39 | + page.driver.header 'Accept-Language', language_to_code(lang) | |
| 39 | 40 | end |
| 40 | 41 | |
| 41 | 42 | Then /^the site should be in (.*)$/ do |lang| | ... | ... |