Commit fe4824e847303b03b84c0a92f5eb434520673a96
1 parent
e6d92b8f
Exists in
master
and in
29 other branches
Fixed test: features/signup.feature
Showing
2 changed files
with
10 additions
and
9 deletions
Show diff stats
features/signup.feature
@@ -14,13 +14,12 @@ Feature: signup | @@ -14,13 +14,12 @@ Feature: signup | ||
14 | | Password confirmation | secret | | 14 | | Password confirmation | secret | |
15 | | Full name | José da Silva | | 15 | | Full name | José da Silva | |
16 | And I press "Create my account" | 16 | And I press "Create my account" |
17 | - Then I should not be logged in | ||
18 | - And I should receive an e-mail on josesilva@example.com | 17 | + Then I should receive an e-mail on josesilva@example.com |
19 | When I go to login page | 18 | When I go to login page |
20 | And I fill in "Username" with "josesilva" | 19 | And I fill in "Username" with "josesilva" |
21 | And I fill in "Password" with "secret" | 20 | And I fill in "Password" with "secret" |
22 | And I press "Log in" | 21 | And I press "Log in" |
23 | - Then I should not be logged in | 22 | + Then I should not be logged in as "josesilva" |
24 | When José da Silva's account is activated | 23 | When José da Silva's account is activated |
25 | And I go to login page | 24 | And I go to login page |
26 | And I fill in "Username" with "josesilva" | 25 | And I fill in "Username" with "josesilva" |
@@ -34,7 +33,7 @@ Feature: signup | @@ -34,7 +33,7 @@ Feature: signup | ||
34 | | joaosilva | Joao Silva | | 33 | | joaosilva | Joao Silva | |
35 | Given I am logged in as "joaosilva" | 34 | Given I am logged in as "joaosilva" |
36 | And I go to signup page | 35 | And I go to signup page |
37 | - Then I should be on Joao Silva's control panel | 36 | + Then I should be on joaosilva's control panel |
38 | 37 | ||
39 | Scenario: user cannot register without a name | 38 | Scenario: user cannot register without a name |
40 | Given I am on the homepage | 39 | Given I am on the homepage |
@@ -52,7 +51,7 @@ Feature: signup | @@ -52,7 +51,7 @@ Feature: signup | ||
52 | | login | name | | 51 | | login | name | |
53 | | joaosilva | Joao Silva | | 52 | | joaosilva | Joao Silva | |
54 | Given I am logged in as "joaosilva" | 53 | Given I am logged in as "joaosilva" |
55 | - And I am on Joao Silva's control panel | 54 | + And I am on joaosilva's control panel |
56 | And I follow "Edit Profile" | 55 | And I follow "Edit Profile" |
57 | And I fill in "Name" with "" | 56 | And I fill in "Name" with "" |
58 | When I press "Save" | 57 | When I press "Save" |
features/step_definitions/noosfero_steps.rb
@@ -451,12 +451,14 @@ Given /^the following environment configuration$/ do |table| | @@ -451,12 +451,14 @@ Given /^the following environment configuration$/ do |table| | ||
451 | env.save | 451 | env.save |
452 | end | 452 | end |
453 | 453 | ||
454 | -Then /^I should be logged in as "(.+)"$/ do |login| | ||
455 | - User.find(session[:user]).login.should == login | 454 | +Then /^I should be logged in as "(.+)"$/ do |username| |
455 | + When %{I go to #{username}'s control panel} | ||
456 | + Then %{I should be on #{username}'s control panel} | ||
456 | end | 457 | end |
457 | 458 | ||
458 | -Then /^I should not be logged in$/ do | ||
459 | - session[:user].nil? | 459 | +Then /^I should not be logged in as "(.+)"$/ do |username| |
460 | + When %{I go to #{username}'s control panel} | ||
461 | + Then %{I should be on login page} | ||
460 | end | 462 | end |
461 | 463 | ||
462 | Given /^the profile "(.+)" has no blocks$/ do |profile| | 464 | Given /^the profile "(.+)" has no blocks$/ do |profile| |