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