Commit fe4824e847303b03b84c0a92f5eb434520673a96

Authored by Daniela Feitosa
1 parent e6d92b8f

Fixed test: features/signup.feature

features/signup.feature
... ... @@ -14,13 +14,12 @@ Feature: signup
14 14 | Password confirmation | secret |
15 15 | Full name | José da Silva |
16 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 18 When I go to login page
20 19 And I fill in "Username" with "josesilva"
21 20 And I fill in "Password" with "secret"
22 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 23 When José da Silva's account is activated
25 24 And I go to login page
26 25 And I fill in "Username" with "josesilva"
... ... @@ -34,7 +33,7 @@ Feature: signup
34 33 | joaosilva | Joao Silva |
35 34 Given I am logged in as "joaosilva"
36 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 38 Scenario: user cannot register without a name
40 39 Given I am on the homepage
... ... @@ -52,7 +51,7 @@ Feature: signup
52 51 | login | name |
53 52 | joaosilva | Joao Silva |
54 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 55 And I follow "Edit Profile"
57 56 And I fill in "Name" with ""
58 57 When I press "Save"
... ...
features/step_definitions/noosfero_steps.rb
... ... @@ -451,12 +451,14 @@ Given /^the following environment configuration$/ do |table|
451 451 env.save
452 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 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 462 end
461 463  
462 464 Given /^the profile "(.+)" has no blocks$/ do |profile|
... ...