diff options
Diffstat (limited to 'features/steps/profile/profile.rb')
-rw-r--r-- | features/steps/profile/profile.rb | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb index d16e6bbea57..32e6859eff7 100644 --- a/features/steps/profile/profile.rb +++ b/features/steps/profile/profile.rb @@ -3,7 +3,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps include SharedPaths step 'I should see my profile info' do - page.should have_content "This information will appear on your profile" + expect(page).to have_content "This information will appear on your profile" end step 'I change my profile info' do @@ -23,7 +23,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps expect(@user.twitter).to eq 'testtwitter' expect(@user.website_url).to eq 'testurl' expect(@user.bio).to eq 'I <3 GitLab' - find('#user_location').value.should == 'Ukraine' + expect(find('#user_location').value).to eq 'Ukraine' end step 'I change my avatar' do @@ -33,12 +33,12 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I should see new avatar' do - @user.avatar.should be_instance_of AvatarUploader - @user.avatar.url.should == "/uploads/user/avatar/#{ @user.id }/gitlab_logo.png" + expect(@user.avatar).to be_instance_of AvatarUploader + expect(@user.avatar.url).to eq "/uploads/user/avatar/#{ @user.id }/gitlab_logo.png" end step 'I should see the "Remove avatar" button' do - page.should have_link("Remove avatar") + expect(page).to have_link("Remove avatar") end step 'I have an avatar' do @@ -53,15 +53,15 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I should see my gravatar' do - @user.avatar?.should be_false + expect(@user.avatar?).to be_false end step 'I should not see the "Remove avatar" button' do - page.should_not have_link("Remove avatar") + expect(page).not_to have_link("Remove avatar") end step 'I try change my password w/o old one' do - within '.update-password' do + page.within '.update-password' do fill_in "user_password", with: "22233344" fill_in "user_password_confirmation", with: "22233344" click_button "Save" @@ -69,7 +69,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I change my password' do - within '.update-password' do + page.within '.update-password' do fill_in "user_current_password", with: "12345678" fill_in "user_password", with: "22233344" fill_in "user_password_confirmation", with: "22233344" @@ -78,7 +78,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I unsuccessfully change my password' do - within '.update-password' do + page.within '.update-password' do fill_in "user_current_password", with: "12345678" fill_in "user_password", with: "password" fill_in "user_password_confirmation", with: "confirmation" @@ -87,23 +87,23 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step "I should see a missing password error message" do - page.should have_content "You must provide a valid current password" + expect(page).to have_content "You must provide a valid current password" end step "I should see a password error message" do - page.should have_content "Password confirmation doesn't match" + expect(page).to have_content "Password confirmation doesn't match" end step 'I reset my token' do - within '.update-token' do + page.within '.update-token' do @old_token = @user.private_token click_button "Reset" end end step 'I should see new token' do - find("#token").value.should_not == @old_token - find("#token").value.should == @user.reload.private_token + expect(find("#token").value).not_to eq @old_token + expect(find("#token").value).to eq @user.reload.private_token end step 'I have activity' do @@ -111,28 +111,28 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I should see my activity' do - page.should have_content "#{current_user.name} closed issue" + expect(page).to have_content "#{current_user.name} closed issue" end step "I change my application theme" do - within '.application-theme' do + page.within '.application-theme' do choose "Violet" end end step "I change my code preview theme" do - within '.code-preview-theme' do + page.within '.code-preview-theme' do choose "Solarized dark" end end step "I should see the theme change immediately" do - page.should have_selector('body.ui_color') - page.should_not have_selector('body.ui_basic') + expect(page).to have_selector('body.ui_color') + expect(page).not_to have_selector('body.ui_basic') end step "I should receive feedback that the changes were saved" do - page.should have_content("saved") + expect(page).to have_content("saved") end step 'my password is expired' do @@ -141,11 +141,11 @@ class Spinach::Features::Profile < Spinach::FeatureSteps step "I am not an ldap user" do current_user.identities.delete - current_user.ldap_user?.should be_false + expect(current_user.ldap_user?).to be_false end step 'I redirected to expired password page' do - current_path.should == new_profile_password_path + expect(current_path).to eq new_profile_password_path end step 'I submit new password' do @@ -156,15 +156,15 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I redirected to sign in page' do - current_path.should == new_user_session_path + expect(current_path).to eq new_user_session_path end step 'I should be redirected to password page' do - current_path.should == edit_profile_password_path + expect(current_path).to eq edit_profile_password_path end step 'I should be redirected to account page' do - current_path.should == profile_account_path + expect(current_path).to eq profile_account_path end step 'I click on my profile picture' do @@ -172,10 +172,10 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I should see my user page' do - page.should have_content "User Activity" + expect(page).to have_content "User Activity" - within '.navbar-gitlab' do - page.should have_content current_user.name + page.within '.navbar-gitlab' do + expect(page).to have_content current_user.name end end @@ -189,7 +189,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I should see groups I belong to' do - page.should have_css('.profile-groups-avatars', visible: true) + expect(page).to have_css('.profile-groups-avatars', visible: true) end step 'I click on new application button' do @@ -197,7 +197,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I should see application form' do - page.should have_content "New application" + expect(page).to have_content "New application" end step 'I fill application form out and submit' do @@ -207,9 +207,9 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I see application' do - page.should have_content "Application: test" - page.should have_content "Application Id" - page.should have_content "Secret" + expect(page).to have_content "Application: test" + expect(page).to have_content "Application Id" + expect(page).to have_content "Secret" end step 'I click edit' do @@ -217,28 +217,28 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I see edit application form' do - page.should have_content "Edit application" + expect(page).to have_content "Edit application" end step 'I change name of application and submit' do - page.should have_content "Edit application" + expect(page).to have_content "Edit application" fill_in :doorkeeper_application_name, with: 'test_changed' click_on "Submit" end step 'I see that application was changed' do - page.should have_content "test_changed" - page.should have_content "Application Id" - page.should have_content "Secret" + expect(page).to have_content "test_changed" + expect(page).to have_content "Application Id" + expect(page).to have_content "Secret" end step 'I click to remove application' do - within '.oauth-applications' do + page.within '.oauth-applications' do click_on "Destroy" end end step "I see that application is removed" do - page.find(".oauth-applications").should_not have_content "test_changed" + expect(page.find(".oauth-applications")).not_to have_content "test_changed" end end |