parent
f8e27b92bf
commit
89d9319a79
|
@ -22,7 +22,7 @@ class ProfileController < ApplicationController
|
||||||
flash[:notice] = "Password was successfully updated. Please login with it"
|
flash[:notice] = "Password was successfully updated. Please login with it"
|
||||||
redirect_to new_user_session_path
|
redirect_to new_user_session_path
|
||||||
else
|
else
|
||||||
render action: "password"
|
render 'account'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,11 @@ Feature: Profile
|
||||||
Then I change my password
|
Then I change my password
|
||||||
And I should be redirected to sign in page
|
And I should be redirected to sign in page
|
||||||
|
|
||||||
|
Scenario: I unsuccessfully change my password
|
||||||
|
Given I visit profile account page
|
||||||
|
When I unsuccessfully change my password
|
||||||
|
Then I should see a password error message
|
||||||
|
|
||||||
Scenario: I reset my token
|
Scenario: I reset my token
|
||||||
Given I visit profile account page
|
Given I visit profile account page
|
||||||
Then I reset my token
|
Then I reset my token
|
||||||
|
|
|
@ -28,6 +28,16 @@ class Profile < Spinach::FeatureSteps
|
||||||
click_button "Save"
|
click_button "Save"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
When 'I unsuccessfully change my password' do
|
||||||
|
fill_in "user_password", with: "password"
|
||||||
|
fill_in "user_password_confirmation", with: "confirmation"
|
||||||
|
click_button "Save"
|
||||||
|
end
|
||||||
|
|
||||||
|
Then "I should see a password error message" do
|
||||||
|
page.should have_content "Password doesn't match confirmation"
|
||||||
|
end
|
||||||
|
|
||||||
And 'I should be redirected to sign in page' do
|
And 'I should be redirected to sign in page' do
|
||||||
current_path.should == new_user_session_path
|
current_path.should == new_user_session_path
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue