refactor feature steps
This commit is contained in:
parent
ef4e9c24d3
commit
79eb5ab396
34 changed files with 270 additions and 376 deletions
44
features/steps/profile/profile.rb
Normal file
44
features/steps/profile/profile.rb
Normal file
|
@ -0,0 +1,44 @@
|
|||
class Profile < Spinach::FeatureSteps
|
||||
include SharedAuthentication
|
||||
include SharedPaths
|
||||
|
||||
Then 'I should see my profile info' do
|
||||
page.should have_content "Profile"
|
||||
page.should have_content @user.name
|
||||
page.should have_content @user.email
|
||||
end
|
||||
|
||||
Then 'I change my contact info' do
|
||||
fill_in "user_skype", :with => "testskype"
|
||||
fill_in "user_linkedin", :with => "testlinkedin"
|
||||
fill_in "user_twitter", :with => "testtwitter"
|
||||
click_button "Save"
|
||||
@user.reload
|
||||
end
|
||||
|
||||
And 'I should see new contact info' do
|
||||
@user.skype.should == 'testskype'
|
||||
@user.linkedin.should == 'testlinkedin'
|
||||
@user.twitter.should == 'testtwitter'
|
||||
end
|
||||
|
||||
Then 'I change my password' do
|
||||
fill_in "user_password", :with => "222333"
|
||||
fill_in "user_password_confirmation", :with => "222333"
|
||||
click_button "Save"
|
||||
end
|
||||
|
||||
And 'I should be redirected to sign in page' do
|
||||
current_path.should == new_user_session_path
|
||||
end
|
||||
|
||||
Then 'I reset my token' do
|
||||
@old_token = @user.private_token
|
||||
click_button "Reset"
|
||||
end
|
||||
|
||||
And 'I should see new token' do
|
||||
find("#token").value.should_not == @old_token
|
||||
find("#token").value.should == @user.reload.private_token
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue