Commit 69bbc413 authored by Robert Speicher's avatar Robert Speicher
Browse files

Update all `should`-style syntax to `expect` in features

parent 7c7ee644e200
......@@ -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
......@@ -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
......@@ -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
......
......@@ -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
......
......@@ -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
......@@ -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
......
......@@ -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
......@@ -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
......@@ -9,14 +9,14 @@ class Spinach::Features::DashboardArchivedProjects < Spinach::FeatureSteps
end
step 'I should see "Shop" project link' do
page.should have_link "Shop"
expect(page).to have_link "Shop"
end
step 'I should not see "Forum" project link' do
page.should_not have_link "Forum"
expect(page).not_to have_link "Forum"
end
step 'I should see "Forum" project link' do
page.should have_link "Forum"
expect(page).to have_link "Forum"
end
end
......@@ -4,16 +4,16 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
include SharedProject
step 'I should see "New Project" link' do
page.should have_link "New project"
expect(page).to have_link "New project"
end
step 'I should see "Shop" project link' do
page.should have_link "Shop"
expect(page).to have_link "Shop"
end
step 'I should see last push widget' do
page.should have_content "You pushed to fix"
page.should have_link "Create Merge Request"
expect(page).to have_content "You pushed to fix"
expect(page).to have_link "Create Merge Request"
end
step 'I click "Create Merge Request" link' do
......@@ -21,10 +21,10 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
end
step 'I see prefilled new Merge Request page' do
current_path.should == new_namespace_project_merge_request_path(@project.namespace, @project)
find("#merge_request_target_project_id").value.should == @project.id.to_s
find("input#merge_request_source_branch").value.should == "fix"
find("input#merge_request_target_branch").value.should == "master"
expect(current_path).to eq new_namespace_project_merge_request_path(@project.namespace, @project)
expect(find("#merge_request_target_project_id").value).to eq @project.id.to_s
expect(find("input#merge_request_source_branch").value).to eq "fix"
expect(find("input#merge_request_target_branch").value).to eq "master"
end
step 'user with name "John Doe" joined project "Shop"' do
......@@ -38,7 +38,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
end
step 'I should see "John Doe joined project Shop" event' do
page.should have_content "John Doe joined project #{project.name_with_namespace}"
expect(page).to have_content "John Doe joined project #{project.name_with_namespace}"
end
step 'user with name "John Doe" left project "Shop"' do
......@@ -51,7 +51,7 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
end
step 'I should see "John Doe left project Shop" event' do
page.should have_content "John Doe left project #{project.name_with_namespace}"
expect(page).to have_content "John Doe left project #{project.name_with_namespace}"
end
step 'I have group with projects' do
......@@ -64,13 +64,13 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
step 'I should see projects list' do
@user.authorized_projects.all.each do |project|
page.should have_link project.name_with_namespace
expect(page).to have_link project.name_with_namespace
end
end
step 'I should see groups list' do
Group.all.each do |group|
page.should have_link group.name
expect(page).to have_link group.name
end
end
......@@ -80,6 +80,6 @@ class Spinach::Features::Dashboard < Spinach::FeatureSteps
end
step 'I should see 1 project at group list' do
find('span.last_activity/span').should have_content('1')
expect(find('span.last_activity/span')).to have_content('1')
end
end
......@@ -4,27 +4,27 @@ class Spinach::Features::EventFilters < Spinach::FeatureSteps
include SharedProject
step 'I should see push event' do
page.should have_selector('span.pushed')
expect(page).to have_selector('span.pushed')
end
step 'I should not see push event' do
page.should_not have_selector('span.pushed')
expect(page).not_to have_selector('span.pushed')
end
step 'I should see new member event' do
page.should have_selector('span.joined')
expect(page).to have_selector('span.joined')
end
step 'I should not see new member event' do
page.should_not have_selector('span.joined')
expect(page).not_to have_selector('span.joined')
end
step 'I should see merge request event' do
page.should have_selector('span.accepted')
expect(page).to have_selector('span.accepted')
end
step 'I should not see merge request event' do
page.should_not have_selector('span.accepted')
expect(page).not_to have_selector('span.accepted')
end
step 'this project has push event' do
......
......@@ -17,29 +17,29 @@ class Spinach::Features::DashboardGroup < Spinach::FeatureSteps
end
step 'I should not see the "Leave" button for group "Owned"' do
find(:css, 'li', text: "Owner").should_not have_selector(:css, 'i.fa.fa-sign-out')
expect(find(:css, 'li', text: "Owner")).not_to have_selector(:css, 'i.fa.fa-sign-out')
# poltergeist always confirms popups.
end
step 'I should not see the "Leave" button for groupr "Guest"' do
find(:css, 'li', text: "Guest").should_not have_selector(:css, 'i.fa.fa-sign-out')
expect(find(:css, 'li', text: "Guest")).not_to have_selector(:css, 'i.fa.fa-sign-out')
# poltergeist always confirms popups.
end
step 'I should see group "Owned" in group list' do
page.should have_content("Owned")
expect(page).to have_content("Owned")
end
step 'I should not see group "Owned" in group list' do
page.should_not have_content("Owned")
expect(page).not_to have_content("Owned")
end
step 'I should see group "Guest" in group list' do
page.should have_content("Guest")
expect(page).to have_content("Guest")
end
step 'I should not see group "Guest" in group list' do
page.should_not have_content("Guest")
expect(page).not_to have_content("Guest")
end
step 'I click new group link' do
......@@ -53,15 +53,15 @@ class Spinach::Features::DashboardGroup < Spinach::FeatureSteps
end
step 'I should be redirected to group "Samurai" page' do
current_path.should == group_path(Group.find_by(name: 'Samurai'))
expect(current_path).to eq group_path(Group.find_by(name: 'Samurai'))
end
step 'I should see newly created group "Samurai"' do
page.should have_content "Samurai"
page.should have_content "Tokugawa Shogunate"
expect(page).to have_content "Samurai"
expect(page).to have_content "Tokugawa Shogunate"
end
step 'I should see the "Can not leave message"' do
page.should have_content "You can not leave Owned group because you're the last owner"
expect(page).to have_content "You can not leave Owned group because you're the last owner"
end
end
......@@ -12,7 +12,7 @@ class Spinach::Features::DashboardHelp < Spinach::FeatureSteps
end
step 'I should see "Rake Tasks" page markdown rendered' do
page.should have_content "Gather information about GitLab and the system it runs on"
expect(page).to have_content "Gather information about GitLab and the system it runs on"
end
step 'Header "Rebuild project satellites" should have correct ids and links' do
......
......@@ -46,11 +46,11 @@ class Spinach::Features::DashboardIssues < Spinach::FeatureSteps
end
def should_see(issue)
page.should have_content(issue.title[0..10])
expect(page).to have_content(issue.title[0..10])
end
def should_not_see(issue)
page.should_not have_content(issue.title[0..10])
expect(page).not_to have_content(issue.title[0..10])
end
def assigned_issue
......
......@@ -50,11 +50,11 @@ class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps
end
def should_see(merge_request)
page.should have_content(merge_request.title[0..10])
expect(page).to have_content(merge_request.title[0..10])
end
def should_not_see(merge_request)
page.should_not have_content(merge_request.title[0..10])
expect(page).not_to have_content(merge_request.title[0..10])
end
def assigned_merge_request
......
......@@ -10,7 +10,7 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps
end
step 'I see "New project" page' do
page.should have_content("Project path")
expect(page).to have_content("Project path")
end
step 'I click on "Import project from GitHub"' do
......@@ -19,11 +19,11 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps
step 'I see instructions on how to import from GitHub' do
github_modal = first('.modal-body')
github_modal.should be_visible
github_modal.should have_content "To enable importing projects from GitHub"
expect(github_modal).to be_visible
expect(github_modal).to have_content "To enable importing projects from GitHub"
all('.modal-body').each do |element|
element.should_not be_visible unless element == github_modal
expect(element).not_to be_visible unless element == github_modal
end
end
end
......@@ -9,7 +9,7 @@ class Spinach::Features::DashboardStarredProjects < Spinach::FeatureSteps
step 'I should not see project "Shop"' do
within 'aside' do
page.should_not have_content('Shop')
expect(page).not_to have_content('Shop')
end
end
end
......@@ -39,19 +39,19 @@ class Spinach::Features::ExploreGroups < Spinach::FeatureSteps
end
step 'I should not see project "Enterprise" items' do
page.should_not have_content "Enterprise"
expect(page).not_to have_content "Enterprise"
end
step 'I should see project "Internal" items' do
page.should have_content "Internal"
expect(page).to have_content "Internal"
end
step 'I should not see project "Internal" items' do
page.should_not have_content "Internal"