diff options
| author | Robert Speicher <rspeicher@gmail.com> | 2015-06-12 00:44:13 -0400 |
|---|---|---|
| committer | Robert Speicher <rspeicher@gmail.com> | 2015-06-12 05:12:09 -0400 |
| commit | 69bbc413fec7aa4168d9ff12df5421674db90032 (patch) | |
| tree | 215a7f16d4630067bf4863d8d6f992fcac23969e /features/steps/admin | |
| parent | b07cf1182f78c5c46edbfa0fde668dd75ae47e05 (diff) | |
| download | gitlab-ce-69bbc413fec7aa4168d9ff12df5421674db90032.tar.gz | |
Update all `should`-style syntax to `expect` in features
Diffstat (limited to 'features/steps/admin')
| -rw-r--r-- | features/steps/admin/applications.rb | 20 | ||||
| -rw-r--r-- | features/steps/admin/broadcast_messages.rb | 10 | ||||
| -rw-r--r-- | features/steps/admin/deploy_keys.rb | 6 | ||||
| -rw-r--r-- | features/steps/admin/groups.rb | 14 | ||||
| -rw-r--r-- | features/steps/admin/logs.rb | 6 | ||||
| -rw-r--r-- | features/steps/admin/projects.rb | 12 | ||||
| -rw-r--r-- | features/steps/admin/settings.rb | 16 | ||||
| -rw-r--r-- | features/steps/admin/users.rb | 26 |
8 files changed, 55 insertions, 55 deletions
diff --git a/features/steps/admin/applications.rb b/features/steps/admin/applications.rb index d59088fa3c3..e092a4b36c0 100644 --- a/features/steps/admin/applications.rb +++ b/features/steps/admin/applications.rb @@ -8,7 +8,7 @@ class Spinach::Features::AdminApplications < 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 @@ -18,9 +18,9 @@ class Spinach::Features::AdminApplications < 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 @@ -28,19 +28,19 @@ class Spinach::Features::AdminApplications < 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 @@ -50,6 +50,6 @@ class Spinach::Features::AdminApplications < Spinach::FeatureSteps 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 diff --git a/features/steps/admin/broadcast_messages.rb b/features/steps/admin/broadcast_messages.rb index a35fa34a3a2..2ecb6f0191a 100644 --- a/features/steps/admin/broadcast_messages.rb +++ b/features/steps/admin/broadcast_messages.rb @@ -8,7 +8,7 @@ class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps end step 'I should be all broadcast messages' do - page.should have_content "Migration to new server" + expect(page).to have_content "Migration to new server" end step 'submit form with new broadcast message' do @@ -18,11 +18,11 @@ class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps end step 'I should be redirected to admin messages page' do - current_path.should == admin_broadcast_messages_path + expect(current_path).to eq admin_broadcast_messages_path end step 'I should see newly created broadcast message' do - page.should have_content 'Application update from 4:00 CST to 5:00 CST' + expect(page).to have_content 'Application update from 4:00 CST to 5:00 CST' end step 'submit form with new customized broadcast message' do @@ -35,7 +35,7 @@ class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps end step 'I should see a customized broadcast message' do - page.should have_content 'Application update from 4:00 CST to 5:00 CST' - page.should have_selector %(div[style="background-color:#f2dede;color:#b94a48"]) + expect(page).to have_content 'Application update from 4:00 CST to 5:00 CST' + expect(page).to have_selector %(div[style="background-color:#f2dede;color:#b94a48"]) end end diff --git a/features/steps/admin/deploy_keys.rb b/features/steps/admin/deploy_keys.rb index 844837d177d..56787eeb6b3 100644 --- a/features/steps/admin/deploy_keys.rb +++ b/features/steps/admin/deploy_keys.rb @@ -10,7 +10,7 @@ class Spinach::Features::AdminDeployKeys < Spinach::FeatureSteps step 'I should see all public deploy keys' do DeployKey.are_public.each do |p| - page.should have_content p.title + expect(page).to have_content p.title end end @@ -33,11 +33,11 @@ class Spinach::Features::AdminDeployKeys < Spinach::FeatureSteps end step 'I should be on admin deploy keys page' do - current_path.should == admin_deploy_keys_path + expect(current_path).to eq admin_deploy_keys_path end step 'I should see newly created deploy key' do - page.should have_content(deploy_key.title) + expect(page).to have_content(deploy_key.title) end def deploy_key diff --git a/features/steps/admin/groups.rb b/features/steps/admin/groups.rb index 721460b9371..743c3ecce87 100644 --- a/features/steps/admin/groups.rb +++ b/features/steps/admin/groups.rb @@ -28,12 +28,12 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps end step 'I should see newly created group' do - page.should have_content "Group: gitlab" - page.should have_content "Group description" + expect(page).to have_content "Group: gitlab" + expect(page).to have_content "Group description" end step 'I should be redirected to group page' do - current_path.should == admin_group_path(Group.find_by(path: 'gitlab')) + expect(current_path).to eq admin_group_path(Group.find_by(path: 'gitlab')) end When 'I select user "John Doe" from user list as "Reporter"' do @@ -46,14 +46,14 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps step 'I should see "John Doe" in team list in every project as "Reporter"' do within ".group-users-list" do - page.should have_content "John Doe" - page.should have_content "Reporter" + expect(page).to have_content "John Doe" + expect(page).to have_content "Reporter" end end step 'I should be all groups' do Group.all.each do |group| - page.should have_content group.name + expect(page).to have_content group.name end end @@ -69,7 +69,7 @@ class Spinach::Features::AdminGroups < Spinach::FeatureSteps step 'I should not see "John Doe" in team list' do within ".group-users-list" do - page.should_not have_content "John Doe" + expect(page).not_to have_content "John Doe" end end diff --git a/features/steps/admin/logs.rb b/features/steps/admin/logs.rb index 904e5468655..f9e49588c75 100644 --- a/features/steps/admin/logs.rb +++ b/features/steps/admin/logs.rb @@ -4,8 +4,8 @@ class Spinach::Features::AdminLogs < Spinach::FeatureSteps include SharedAdmin step 'I should see tabs with available logs' do - page.should have_content 'production.log' - page.should have_content 'githost.log' - page.should have_content 'application.log' + expect(page).to have_content 'production.log' + expect(page).to have_content 'githost.log' + expect(page).to have_content 'application.log' end end diff --git a/features/steps/admin/projects.rb b/features/steps/admin/projects.rb index 9be4d39d2d5..655f1895279 100644 --- a/features/steps/admin/projects.rb +++ b/features/steps/admin/projects.rb @@ -5,7 +5,7 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps step 'I should see all projects' do Project.all.each do |p| - page.should have_content p.name_with_namespace + expect(page).to have_content p.name_with_namespace end end @@ -15,9 +15,9 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps step 'I should see project details' do project = Project.first - current_path.should == admin_namespace_project_path(project.namespace, project) - page.should have_content(project.name_with_namespace) - page.should have_content(project.creator.name) + expect(current_path).to eq admin_namespace_project_path(project.namespace, project) + expect(page).to have_content(project.name_with_namespace) + expect(page).to have_content(project.creator.name) end step 'I visit admin project page' do @@ -34,8 +34,8 @@ class Spinach::Features::AdminProjects < Spinach::FeatureSteps end step 'I should see project transfered' do - page.should have_content 'Web / ' + project.name - page.should have_content 'Namespace: Web' + expect(page).to have_content 'Web / ' + project.name + expect(page).to have_content 'Namespace: Web' end def project diff --git a/features/steps/admin/settings.rb b/features/steps/admin/settings.rb index 15ca0d80f1a..06616bfbd72 100644 --- a/features/steps/admin/settings.rb +++ b/features/steps/admin/settings.rb @@ -11,9 +11,9 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps end step 'I should see application settings saved' do - current_application_settings.gravatar_enabled.should be_false - current_application_settings.home_page_url.should == 'https://about.gitlab.com/' - page.should have_content 'Application settings saved successfully' + expect(current_application_settings.gravatar_enabled).to be_false + expect(current_application_settings.home_page_url).to eq 'https://about.gitlab.com/' + expect(page).to have_content 'Application settings saved successfully' end step 'I click on "Service Templates"' do @@ -41,18 +41,18 @@ class Spinach::Features::AdminSettings < Spinach::FeatureSteps end step 'I should see service template settings saved' do - page.should have_content 'Application settings saved successfully' + expect(page).to have_content 'Application settings saved successfully' end step 'I should see all checkboxes checked' do all('input[type=checkbox]').each do |checkbox| - checkbox.should be_checked + expect(checkbox).to be_checked end end step 'I should see Slack settings saved' do - find_field('Webhook').value.should eq 'http://localhost' - find_field('Username').value.should eq 'test_user' - find_field('Channel').value.should eq '#test_channel' + expect(find_field('Webhook').value).to eq 'http://localhost' + expect(find_field('Username').value).to eq 'test_user' + expect(find_field('Channel').value).to eq '#test_channel' end end diff --git a/features/steps/admin/users.rb b/features/steps/admin/users.rb index e1383097248..8b6bdf219ba 100644 --- a/features/steps/admin/users.rb +++ b/features/steps/admin/users.rb @@ -5,7 +5,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps step 'I should see all users' do User.all.each do |user| - page.should have_content user.name + expect(page).to have_content user.name end end @@ -24,12 +24,12 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps step 'See username error message' do within "#error_explanation" do - page.should have_content "Username" + expect(page).to have_content "Username" end end step 'Not changed form action url' do - page.should have_selector %(form[action="/admin/users/#{@user.username}"]) + expect(page).to have_selector %(form[action="/admin/users/#{@user.username}"]) end step 'I submit modified user' do @@ -38,7 +38,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps end step 'I see user attributes changed' do - page.should have_content 'Can create groups: Yes' + expect(page).to have_content 'Can create groups: Yes' end step 'click edit on my user' do @@ -53,7 +53,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps end step 'I see the secondary email' do - page.should have_content "Secondary email: #{@user_with_secondary_email.emails.last.email}" + expect(page).to have_content "Secondary email: #{@user_with_secondary_email.emails.last.email}" end step 'I click remove secondary email' do @@ -61,7 +61,7 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps end step 'I should not see secondary email anymore' do - page.should_not have_content "Secondary email:" + expect(page).not_to have_content "Secondary email:" end step 'user "Mike" with groups and projects' do @@ -79,8 +79,8 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps end step 'I should see user "Mike" details' do - page.should have_content 'Account' - page.should have_content 'Personal projects limit' + expect(page).to have_content 'Account' + expect(page).to have_content 'Personal projects limit' end step 'user "Pete" with ssh keys' do @@ -94,8 +94,8 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps end step 'I should see key list' do - page.should have_content 'ssh-rsa Key2' - page.should have_content 'ssh-rsa Key1' + expect(page).to have_content 'ssh-rsa Key2' + expect(page).to have_content 'ssh-rsa Key1' end step 'I click on the key title' do @@ -103,8 +103,8 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps end step 'I should see key details' do - page.should have_content 'ssh-rsa Key2' - page.should have_content 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQSTWXhJAX/He+nG78MiRRRn7m0Pb0XbcgTxE0etArgoFoh9WtvDf36HG6tOSg/0UUNcp0dICsNAmhBKdncp6cIyPaXJTURPRAGvhI0/VDk4bi27bRnccGbJ/hDaUxZMLhhrzY0r22mjVf8PF6dvv5QUIQVm1/LeaWYsHHvLgiIjwrXirUZPnFrZw6VLREoBKG8uWvfSXw1L5eapmstqfsME8099oi+vWLR8MgEysZQmD28M73fgW4zek6LDQzKQyJx9nB+hJkKUDvcuziZjGmRFlNgSA2mguERwL1OXonD8WYUrBDGKroIvBT39zS5d9tQDnidEJZ9Y8gv5ViYP7x Key2' + expect(page).to have_content 'ssh-rsa Key2' + expect(page).to have_content 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQSTWXhJAX/He+nG78MiRRRn7m0Pb0XbcgTxE0etArgoFoh9WtvDf36HG6tOSg/0UUNcp0dICsNAmhBKdncp6cIyPaXJTURPRAGvhI0/VDk4bi27bRnccGbJ/hDaUxZMLhhrzY0r22mjVf8PF6dvv5QUIQVm1/LeaWYsHHvLgiIjwrXirUZPnFrZw6VLREoBKG8uWvfSXw1L5eapmstqfsME8099oi+vWLR8MgEysZQmD28M73fgW4zek6LDQzKQyJx9nB+hJkKUDvcuziZjGmRFlNgSA2mguERwL1OXonD8WYUrBDGKroIvBT39zS5d9tQDnidEJZ9Y8gv5ViYP7x Key2' end step 'I click on remove key' do @@ -112,6 +112,6 @@ class Spinach::Features::AdminUsers < Spinach::FeatureSteps end step 'I should see the key removed' do - page.should_not have_content 'ssh-rsa Key2' + expect(page).not_to have_content 'ssh-rsa Key2' end end |
