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/project | |
parent | b07cf1182f78c5c46edbfa0fde668dd75ae47e05 (diff) | |
download | gitlab-ce-69bbc413fec7aa4168d9ff12df5421674db90032.tar.gz |
Update all `should`-style syntax to `expect` in features
Diffstat (limited to 'features/steps/project')
29 files changed, 387 insertions, 387 deletions
diff --git a/features/steps/project/archived.rb b/features/steps/project/archived.rb index 37ad0c77655..db1387763d5 100644 --- a/features/steps/project/archived.rb +++ b/features/steps/project/archived.rb @@ -19,11 +19,11 @@ class Spinach::Features::ProjectArchived < Spinach::FeatureSteps end step 'I should not see "Archived"' do - page.should_not have_content "Archived" + expect(page).not_to have_content "Archived" end step 'I should see "Archived"' do - page.should have_content "Archived" + expect(page).to have_content "Archived" end When 'I set project archived' do diff --git a/features/steps/project/commits/branches.rb b/features/steps/project/commits/branches.rb index 07f7e5796a3..c4da380a715 100644 --- a/features/steps/project/commits/branches.rb +++ b/features/steps/project/commits/branches.rb @@ -8,8 +8,8 @@ class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps end step 'I should see "Shop" all branches list' do - page.should have_content "Branches" - page.should have_content "master" + expect(page).to have_content "Branches" + expect(page).to have_content "master" end step 'I click link "Protected"' do @@ -18,8 +18,8 @@ class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps step 'I should see "Shop" protected branches list' do within ".protected-branches-list" do - page.should have_content "stable" - page.should_not have_content "master" + expect(page).to have_content "stable" + expect(page).not_to have_content "master" end end @@ -57,19 +57,19 @@ class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps end step 'I should see new branch created' do - page.should have_content 'deploy_keys' + expect(page).to have_content 'deploy_keys' end step 'I should see new an error that branch is invalid' do - page.should have_content 'Branch name invalid' + expect(page).to have_content 'Branch name invalid' end step 'I should see new an error that ref is invalid' do - page.should have_content 'Invalid reference name' + expect(page).to have_content 'Invalid reference name' end step 'I should see new an error that branch already exists' do - page.should have_content 'Branch already exists' + expect(page).to have_content 'Branch already exists' end step "I click branch 'improve/awesome' delete link" do @@ -80,6 +80,6 @@ class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps end step "I should not see branch 'improve/awesome'" do - all(visible: true).should_not have_content 'improve/awesome' + expect(all(visible: true)).not_to have_content 'improve/awesome' end end diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb index 30d53333b78..55adb695416 100644 --- a/features/steps/project/commits/commits.rb +++ b/features/steps/project/commits/commits.rb @@ -6,9 +6,9 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps step 'I see project commits' do commit = @project.repository.commit - page.should have_content(@project.name) - page.should have_content(commit.message[0..20]) - page.should have_content(commit.short_id) + expect(page).to have_content(@project.name) + expect(page).to have_content(commit.message[0..20]) + expect(page).to have_content(commit.short_id) end step 'I click atom feed link' do @@ -17,10 +17,10 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps step 'I see commits atom feed' do commit = @project.repository.commit - response_headers['Content-Type'].should have_content("application/atom+xml") - body.should have_selector("title", text: "#{@project.name}:master commits") - body.should have_selector("author email", text: commit.author_email) - body.should have_selector("entry summary", text: commit.description[0..10]) + expect(response_headers['Content-Type']).to have_content("application/atom+xml") + expect(body).to have_selector("title", text: "#{@project.name}:master commits") + expect(body).to have_selector("author email", text: commit.author_email) + expect(body).to have_selector("entry summary", text: commit.description[0..10]) end step 'I click on commit link' do @@ -28,8 +28,8 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps end step 'I see commit info' do - page.should have_content sample_commit.message - page.should have_content "Showing #{sample_commit.files_changed_count} changed files" + expect(page).to have_content sample_commit.message + expect(page).to have_content "Showing #{sample_commit.files_changed_count} changed files" end step 'I fill compare fields with refs' do @@ -46,26 +46,26 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps step 'I should see additional file lines' do within @diff.parent do - first('.new_line').text.should_not have_content "..." + expect(first('.new_line').text).not_to have_content "..." end end step 'I see compared refs' do - page.should have_content "Compare View" - page.should have_content "Commits (1)" - page.should have_content "Showing 2 changed files" + expect(page).to have_content "Compare View" + expect(page).to have_content "Commits (1)" + expect(page).to have_content "Showing 2 changed files" end step 'I see breadcrumb links' do - page.should have_selector('ul.breadcrumb') - page.should have_selector('ul.breadcrumb a', count: 4) + expect(page).to have_selector('ul.breadcrumb') + expect(page).to have_selector('ul.breadcrumb a', count: 4) end step 'I see commits stats' do - page.should have_content 'Top 50 Committers' - page.should have_content 'Committers' - page.should have_content 'Total commits' - page.should have_content 'Authors' + expect(page).to have_content 'Top 50 Committers' + expect(page).to have_content 'Committers' + expect(page).to have_content 'Total commits' + expect(page).to have_content 'Authors' end step 'I visit big commit page' do @@ -74,8 +74,8 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps end step 'I see big commit warning' do - page.should have_content sample_big_commit.message - page.should have_content "Too many changes" + expect(page).to have_content sample_big_commit.message + expect(page).to have_content "Too many changes" end step 'I visit a commit with an image that changed' do @@ -84,8 +84,8 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps step 'The diff links to both the previous and current image' do links = all('.two-up span div a') - links[0]['href'].should =~ %r{blob/#{sample_image_commit.old_blob_id}} - links[1]['href'].should =~ %r{blob/#{sample_image_commit.new_blob_id}} + expect(links[0]['href']).to match %r{blob/#{sample_image_commit.old_blob_id}} + expect(links[1]['href']).to match %r{blob/#{sample_image_commit.new_blob_id}} end step 'I click side-by-side diff button' do @@ -93,10 +93,10 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps end step 'I see side-by-side diff button' do - page.should have_content "Side-by-side" + expect(page).to have_content "Side-by-side" end step 'I see inline diff button' do - page.should have_content "Inline" + expect(page).to have_content "Inline" end end diff --git a/features/steps/project/commits/tags.rb b/features/steps/project/commits/tags.rb index 3465fcbfd07..e87bf799af2 100644 --- a/features/steps/project/commits/tags.rb +++ b/features/steps/project/commits/tags.rb @@ -4,8 +4,8 @@ class Spinach::Features::ProjectCommitsTags < Spinach::FeatureSteps include SharedPaths step 'I should see "Shop" all tags list' do - page.should have_content "Tags" - page.should have_content "v1.0.0" + expect(page).to have_content "Tags" + expect(page).to have_content "v1.0.0" end step 'I click new tag link' do @@ -37,19 +37,19 @@ class Spinach::Features::ProjectCommitsTags < Spinach::FeatureSteps end step 'I should see new tag created' do - page.should have_content 'v7.0' + expect(page).to have_content 'v7.0' end step 'I should see new an error that tag is invalid' do - page.should have_content 'Tag name invalid' + expect(page).to have_content 'Tag name invalid' end step 'I should see new an error that tag ref is invalid' do - page.should have_content 'Invalid reference name' + expect(page).to have_content 'Invalid reference name' end step 'I should see new an error that tag already exists' do - page.should have_content 'Tag already exists' + expect(page).to have_content 'Tag already exists' end step "I delete tag 'v1.1.0'" do @@ -61,7 +61,7 @@ class Spinach::Features::ProjectCommitsTags < Spinach::FeatureSteps step "I should not see tag 'v1.1.0'" do within '.tags' do - all(visible: true).should_not have_content 'v1.1.0' + expect(all(visible: true)).not_to have_content 'v1.1.0' end end @@ -76,7 +76,7 @@ class Spinach::Features::ProjectCommitsTags < Spinach::FeatureSteps step 'I should see tags info message' do within '.tags' do - page.should have_content 'Repository has no tags yet.' + expect(page).to have_content 'Repository has no tags yet.' end end end diff --git a/features/steps/project/commits/user_lookup.rb b/features/steps/project/commits/user_lookup.rb index 63ff84c82ef..40cada6da45 100644 --- a/features/steps/project/commits/user_lookup.rb +++ b/features/steps/project/commits/user_lookup.rb @@ -29,9 +29,9 @@ class Spinach::Features::ProjectCommitsUserLookup < Spinach::FeatureSteps def check_author_link(email, user) author_link = find('.commit-author-link') - author_link['href'].should == user_path(user) - author_link['data-original-title'].should == email - find('.commit-author-name').text.should == user.name + expect(author_link['href']).to eq user_path(user) + expect(author_link['data-original-title']).to eq email + expect(find('.commit-author-name').text).to eq user.name end def user_primary diff --git a/features/steps/project/create.rb b/features/steps/project/create.rb index 6b85cf74f5f..0d39e1997b5 100644 --- a/features/steps/project/create.rb +++ b/features/steps/project/create.rb @@ -8,20 +8,20 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps end step 'I should see project page' do - page.should have_content "Empty" - current_path.should == namespace_project_path(Project.last.namespace, Project.last) + expect(page).to have_content "Empty" + expect(current_path).to eq namespace_project_path(Project.last.namespace, Project.last) end step 'I should see empty project instuctions' do - page.should have_content "git init" - page.should have_content "git remote" - page.should have_content Project.last.url_to_repo + expect(page).to have_content "git init" + expect(page).to have_content "git remote" + expect(page).to have_content Project.last.url_to_repo end step 'I see empty project instuctions' do - page.should have_content "git init" - page.should have_content "git remote" - page.should have_content Project.last.url_to_repo + expect(page).to have_content "git init" + expect(page).to have_content "git remote" + expect(page).to have_content Project.last.url_to_repo end step 'I click on HTTP' do @@ -29,7 +29,7 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps end step 'Remote url should update to http link' do - page.should have_content "git remote add origin #{Project.last.http_url_to_repo}" + expect(page).to have_content "git remote add origin #{Project.last.http_url_to_repo}" end step 'If I click on SSH' do @@ -37,6 +37,6 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps end step 'Remote url should update to ssh link' do - page.should have_content "git remote add origin #{Project.last.url_to_repo}" + expect(page).to have_content "git remote add origin #{Project.last.url_to_repo}" end end diff --git a/features/steps/project/deploy_keys.rb b/features/steps/project/deploy_keys.rb index 81d1182cd1b..423e20a507e 100644 --- a/features/steps/project/deploy_keys.rb +++ b/features/steps/project/deploy_keys.rb @@ -9,19 +9,19 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps step 'I should see project deploy key' do within '.enabled-keys' do - page.should have_content deploy_key.title + expect(page).to have_content deploy_key.title end end step 'I should see other project deploy key' do within '.available-keys' do - page.should have_content other_deploy_key.title + expect(page).to have_content other_deploy_key.title end end step 'I should see public deploy key' do within '.available-keys' do - page.should have_content public_deploy_key.title + expect(page).to have_content public_deploy_key.title end end @@ -36,12 +36,12 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps end step 'I should be on deploy keys page' do - current_path.should == namespace_project_deploy_keys_path(@project.namespace, @project) + expect(current_path).to eq namespace_project_deploy_keys_path(@project.namespace, @project) end step 'I should see newly created deploy key' do within '.enabled-keys' do - page.should have_content(deploy_key.title) + expect(page).to have_content(deploy_key.title) end end @@ -57,7 +57,7 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps step 'I should only see the same deploy key once' do within '.available-keys' do - page.should have_selector('ul li', count: 1) + expect(page).to have_selector('ul li', count: 1) end end diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb index 8e58597db20..879b0e8129c 100644 --- a/features/steps/project/fork.rb +++ b/features/steps/project/fork.rb @@ -4,8 +4,8 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps include SharedProject step 'I click link "Fork"' do - page.should have_content "Shop" - page.should have_content "Fork" + expect(page).to have_content "Shop" + expect(page).to have_content "Fork" click_link "Fork" end @@ -15,7 +15,7 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps end step 'I should see the forked project page' do - page.should have_content "Project was successfully forked." + expect(page).to have_content "Project was successfully forked." end step 'I already have a project named "Shop" in my namespace' do @@ -23,7 +23,7 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps end step 'I should see a "Name has already been taken" warning' do - page.should have_content "Name has already been taken" + expect(page).to have_content "Name has already been taken" end step 'I fork to my namespace' do diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb index ebfa102cee5..78812c52026 100644 --- a/features/steps/project/forked_merge_requests.rb +++ b/features/steps/project/forked_merge_requests.rb @@ -21,17 +21,17 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps end step 'I should see merge request "Merge Request On Forked Project"' do - @project.merge_requests.size.should >= 1 + expect(@project.merge_requests.size).to be >= 1 @merge_request = @project.merge_requests.last - current_path.should == namespace_project_merge_request_path(@project.namespace, @project, @merge_request) - @merge_request.title.should == "Merge Request On Forked Project" - @merge_request.source_project.should == @forked_project - @merge_request.source_branch.should == "fix" - @merge_request.target_branch.should == "master" - page.should have_content @forked_project.path_with_namespace - page.should have_content @project.path_with_namespace - page.should have_content @merge_request.source_branch - page.should have_content @merge_request.target_branch + expect(current_path).to eq namespace_project_merge_request_path(@project.namespace, @project, @merge_request) + expect(@merge_request.title).to eq "Merge Request On Forked Project" + expect(@merge_request.source_project).to eq @forked_project + expect(@merge_request.source_branch).to eq "fix" + expect(@merge_request.target_branch).to eq "master" + expect(page).to have_content @forked_project.path_with_namespace + expect(page).to have_content @project.path_with_namespace + expect(page).to have_content @merge_request.source_branch + expect(page).to have_content @merge_request.target_branch end step 'I fill out a "Merge Request On Forked Project" merge request' do @@ -56,7 +56,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps step 'I should see the commit under the forked from project' do commit = @project.repository.commit - page.should have_content(commit.message) + expect(page).to have_content(commit.message) end step 'I click "Create Merge Request on fork" link' do @@ -64,12 +64,12 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps end step 'I see prefilled new Merge Request page for the forked project' do - current_path.should == new_namespace_project_merge_request_path(@forked_project.namespace, @forked_project) - find("#merge_request_source_project_id").value.should == @forked_project.id.to_s - find("#merge_request_target_project_id").value.should == @project.id.to_s - find("#merge_request_source_branch").value.should have_content "new_design" - find("#merge_request_target_branch").value.should have_content "master" - find("#merge_request_title").value.should == "New Design" + expect(current_path).to eq new_namespace_project_merge_request_path(@forked_project.namespace, @forked_project) + expect(find("#merge_request_source_project_id").value).to eq @forked_project.id.to_s + expect(find("#merge_request_target_project_id").value).to eq @project.id.to_s + expect(find("#merge_request_source_branch").value).to have_content "new_design" + expect(find("#merge_request_target_branch").value).to have_content "master" + expect(find("#merge_request_title").value).to eq "New Design" verify_commit_link(".mr_target_commit", @project) verify_commit_link(".mr_source_commit", @forked_project) end @@ -83,22 +83,22 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps end step 'I should see the edited merge request' do - page.should have_content "An Edited Forked Merge Request" - @project.merge_requests.size.should >= 1 + expect(page).to have_content "An Edited Forked Merge Request" + expect(@project.merge_requests.size).to be >= 1 @merge_request = @project.merge_requests.last - current_path.should == namespace_project_merge_request_path(@project.namespace, @project, @merge_request) - @merge_request.source_project.should == @forked_project - @merge_request.source_branch.should == "fix" - @merge_request.target_branch.should == "master" - page.should have_content @forked_project.path_with_namespace - page.should have_content @project.path_with_namespace - page.should have_content @merge_request.source_branch - page.should have_content @merge_request.target_branch + expect(current_path).to eq namespace_project_merge_request_path(@project.namespace, @project, @merge_request) + expect(@merge_request.source_project).to eq @forked_project + expect(@merge_request.source_branch).to eq "fix" + expect(@merge_request.target_branch).to eq "master" + expect(page).to have_content @forked_project.path_with_namespace + expect(page).to have_content @project.path_with_namespace + expect(page).to have_content @merge_request.source_branch + expect(page).to have_content @merge_request.target_branch end step 'I should see last push widget' do - page.should have_content "You pushed to new_design" - page.should have_link "Create Merge Request" + expect(page).to have_content "You pushed to new_design" + expect(page).to have_link "Create Merge Request" end step 'I click link edit "Merge Request On Forked Project"' do @@ -106,26 +106,26 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps end step 'I see the edit page prefilled for "Merge Request On Forked Project"' do - current_path.should == edit_namespace_project_merge_request_path(@project.namespace, @project, @merge_request) - page.should have_content "Edit merge request ##{@merge_request.id}" - find("#merge_request_title").value.should == "Merge Request On Forked Project" + expect(current_path).to eq edit_namespace_project_merge_request_path(@project.namespace, @project, @merge_request) + expect(page).to have_content "Edit merge request ##{@merge_request.id}" + expect(find("#merge_request_title").value).to eq "Merge Request On Forked Project" end step 'I fill out an invalid "Merge Request On Forked Project" merge request' do select "Select branch", from: "merge_request_target_branch" - find(:select, "merge_request_source_project_id", {}).value.should == @forked_project.id.to_s - find(:select, "merge_request_target_project_id", {}).value.should == @project.id.to_s - find(:select, "merge_request_source_branch", {}).value.should == "" - find(:select, "merge_request_target_branch", {}).value.should == "" + expect(find(:select, "merge_request_source_project_id", {}).value).to eq @forked_project.id.to_s + expect(find(:select, "merge_request_target_project_id", {}).value).to eq @project.id.to_s + expect(find(:select, "merge_request_source_branch", {}).value).to eq "" + expect(find(:select, "merge_request_target_branch", {}).value).to eq "" click_button "Compare branches" end step 'I should see validation errors' do - page.should have_content "You must select source and target branch" + expect(page).to have_content "You must select source and target branch" end step 'the target repository should be the original repository' do - page.should have_select("merge_request_target_project_id", selected: @project.path_with_namespace) + expect(page).to have_select("merge_request_target_project_id", selected: @project.path_with_namespace) end step 'I click "Assign to" dropdown"' do @@ -139,13 +139,13 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps step 'I should see the users from the target project ID' do expect(page).to have_selector('.user-result', visible: true, count: 2) users = page.all('.user-name') - users[0].text.should == 'Unassigned' - users[1].text.should == @project.users.first.name + expect(users[0].text).to eq 'Unassigned' + expect(users[1].text).to eq @project.users.first.name end # Verify a link is generated against the correct project def verify_commit_link(container_div, container_project) # This should force a wait for the javascript to execute - find(:div,container_div).find(".commit_short_id")['href'].should have_content "#{container_project.path_with_namespace}/commit" + expect(find(:div,container_div).find(".commit_short_id")['href']).to have_content "#{container_project.path_with_namespace}/commit" end end diff --git a/features/steps/project/graph.rb b/features/steps/project/graph.rb index a2807c340f6..5e7e573a6ab 100644 --- a/features/steps/project/graph.rb +++ b/features/steps/project/graph.rb @@ -3,7 +3,7 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps include SharedProject step 'page should have graphs' do - page.should have_selector ".stat-graph" + expect(page).to have_selector ".stat-graph" end When 'I visit project "Shop" graph page' do @@ -17,7 +17,7 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps end step 'page should have commits graphs' do - page.should have_content "Commit statistics for master" - page.should have_content "Commits per day of month" + expect(page).to have_content "Commit statistics for master" + expect(page).to have_content "Commits per day of month" end end diff --git a/features/steps/project/hooks.rb b/features/steps/project/hooks.rb index d06905285fe..04e3bf78ede 100644 --- a/features/steps/project/hooks.rb +++ b/features/steps/project/hooks.rb @@ -19,7 +19,7 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps end step 'I should see project hook' do - page.should have_content @hook.url + expect(page).to have_content @hook.url end step 'I submit new hook' do @@ -29,8 +29,8 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps end step 'I should see newly created hook' do - current_path.should == namespace_project_hooks_path(current_project.namespace, current_project) - page.should have_content(@url) + expect(current_path).to eq namespace_project_hooks_path(current_project.namespace, current_project) + expect(page).to have_content(@url) end step 'I click test hook button' do @@ -44,19 +44,19 @@ class Spinach::Features::ProjectHooks < Spinach::FeatureSteps end step 'hook should be triggered' do - current_path.should == namespace_project_hooks_path(current_project.namespace, current_project) - page.should have_selector '.flash-notice', + expect(current_path).to eq namespace_project_hooks_path(current_project.namespace, current_project) + expect(page).to have_selector '.flash-notice', text: 'Hook successfully executed.' end step 'I should see hook error message' do - page.should have_selector '.flash-alert', + expect(page).to have_selector '.flash-alert', text: 'Hook execution failed. '\ 'Ensure the project has commits.' end step 'I should see hook service down error message' do - page.should have_selector '.flash-alert', + expect(page).to have_selector '.flash-alert', text: 'Hook execution failed. '\ 'Ensure hook URL is correct and '\ 'service is up.' diff --git a/features/steps/project/issues/filter_labels.rb b/features/steps/project/issues/filter_labels.rb index 5740bd12837..66a3c1ead69 100644 --- a/features/steps/project/issues/filter_labels.rb +++ b/features/steps/project/issues/filter_labels.rb @@ -6,25 +6,25 @@ class Spinach::Features::ProjectIssuesFilterLabels < Spinach::FeatureSteps step 'I should see "Bugfix1" in issues list' do within ".issues-list" do - page.should have_content "Bugfix1" + expect(page).to have_content "Bugfix1" end end step 'I should see "Bugfix2" in issues list' do within ".issues-list" do - page.should have_content "Bugfix2" + expect(page).to have_content "Bugfix2" end end step 'I should not see "Bugfix2" in issues list' do within ".issues-list" do - page.should_not have_content "Bugfix2" + expect(page).not_to have_content "Bugfix2" end end step 'I should not see "Feature1" in issues list' do within ".issues-list" do - page.should_not have_content "Feature1" + expect(page).not_to have_content "Feature1" end end diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb index 504f0cff724..87a3d280cd0 100644 --- a/features/steps/project/issues/issues.rb +++ b/features/steps/project/issues/issues.rb @@ -7,24 +7,24 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps include SharedMarkdown step 'I should see "Release 0.4" in issues' do - page.should have_content "Release 0.4" + expect(page).to have_content "Release 0.4" end step 'I should not see "Release 0.3" in issues' do - page.should_not have_content "Release 0.3" + expect(page).not_to have_content "Release 0.3" end step 'I should not see "Tweet control" in issues' do - page.should_not have_content "Tweet control" + expect(page).not_to have_content "Tweet control" end step 'I should see that I am subscribed' do - find(".subscribe-button span").text.should == "Unsubscribe" + expect(find(".subscribe-button span").text).to eq "Unsubscribe" end step 'I should see that I am unsubscribed' do sleep 0.2 - find(".subscribe-button span").text.should == "Subscribe" + expect(find(".subscribe-button span").text).to eq "Subscribe" end step 'I click link "Closed"' do @@ -36,11 +36,11 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps end step 'I should see "Release 0.3" in issues' do - page.should have_content "Release 0.3" + expect(page).to have_content "Release 0.3" end step 'I should not see "Release 0.4" in issues' do - page.should_not have_content "Release 0.4" + expect(page).not_to have_content "Release 0.4" end step 'I click link "All"' do @@ -52,7 +52,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps end step 'I should see issue "Release 0.4"' do - page.should have_content "Release 0.4" + expect(page).to have_content "Release 0.4" end step 'I click link "New Issue"' do @@ -66,9 +66,9 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps step 'I see current user as the first user' do expect(page).to have_selector('.user-result', visible: true, count: 4) users = page.all('.user-name') - users[0].text.should == 'Any' - users[1].text.should == 'Unassigned' - users[2].text.should == current_user.name + expect(users[0].text).to eq 'Any' + expect(users[1].text).to eq 'Unassigned' + expect(users[2].text).to eq current_user.name end step 'I submit new issue "500 error on profile"' do @@ -88,15 +88,15 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps step 'I should see label \'bug\' with issue' do within '.issue-show-labels' do - page.should have_content 'bug' + expect(page).to have_content 'bug' end end step 'I should see issue "500 error on profile"' do issue = Issue.find_by(title: "500 error on profile") - page.should have_content issue.title - page.should have_content issue.author_name - page.should have_content issue.project.name + expect(page).to have_content issue.title + expect(page).to have_content issue.author_name + expect(page).to have_content issue.project.name end step 'I fill in issue search with "Re"' do @@ -139,7 +139,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps step 'I should see selected milestone with title "v3.0"' do issues_milestone_selector = "#issue_milestone_id_chzn > a" - find(issues_milestone_selector).should have_content("v3.0") + expect(find(issues_milestone_selector)).to have_content("v3.0") end When 'I select first assignee from "Shop" project' do @@ -152,7 +152,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps issues_assignee_selector = "#issue_assignee_id_chzn > a" assignee_name = project.users.first.name - find(issues_assignee_selector).should have_content(assignee_name) + expect(find(issues_assignee_selector)).to have_content(assignee_name) end step 'project "Shop" have "Release 0.4" open issue' do @@ -191,7 +191,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps step 'I see empty project details with ssh clone info' do project = Project.find_by(name: 'Empty Project') all(:css, '.git-empty .clone').each do |element| - element.text.should include(project.url_to_repo) + expect(element.text).to include(project.url_to_repo) end end @@ -215,7 +215,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps end step 'The code block should be unchanged' do - page.should have_content("```\nCommand [1]: /usr/local/bin/git , see [text](doc/text)\n```") + expect(page).to have_content("```\nCommand [1]: /usr/local/bin/git , see [text](doc/text)\n```") end step 'project \'Shop\' has issue \'Bugfix1\' with description: \'Description for issue1\'' do @@ -239,15 +239,15 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps end step 'I should see \'Bugfix1\' in issues' do - page.should have_content 'Bugfix1' + expect(page).to have_content 'Bugfix1' end step 'I should see \'Feature1\' in issues' do - page.should have_content 'Feature1' + expect(page).to have_content 'Feature1' end step 'I should not see \'Bugfix1\' in issues' do - page.should_not have_content 'Bugfix1' + expect(page).not_to have_content 'Bugfix1' end step 'issue \'Release 0.4\' has label \'bug\'' do diff --git a/features/steps/project/issues/labels.rb b/features/steps/project/issues/labels.rb index 6ce34c500c6..4de8a39672e 100644 --- a/features/steps/project/issues/labels.rb +++ b/features/steps/project/issues/labels.rb @@ -24,7 +24,7 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps step 'I should see labels help message' do within '.labels' do - page.should have_content 'Create first label or generate default set of '\ + expect(page).to have_content 'Create first label or generate default set of '\ 'labels' end end @@ -49,37 +49,37 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps step 'I should see label label exist error message' do within '.label-form' do - page.should have_content 'Title has already been taken' + expect(page).to have_content 'Title has already been taken' end end step 'I should see label color error message' do within '.label-form' do - page.should have_content 'Color is invalid' + expect(page).to have_content 'Color is invalid' end end step 'I should see label \'feature\'' do within '.manage-labels-list' do - page.should have_content 'feature' + expect(page).to have_content 'feature' end end step 'I should see label \'bug\'' do within '.manage-labels-list' do - page.should have_content 'bug' + expect(page).to have_content 'bug' end end step 'I should not see label \'bug\'' do within '.manage-labels-list' do - page.should_not have_content 'bug' + expect(page).not_to have_content 'bug' end end step 'I should see label \'support\'' do within '.manage-labels-list' do - page.should have_content 'support' + expect(page).to have_content 'support' end end @@ -91,7 +91,7 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps step 'I should see label \'fix\'' do within '.manage-labels-list' do - page.should have_content 'fix' + expect(page).to have_content 'fix' end end diff --git a/features/steps/project/issues/milestones.rb b/features/steps/project/issues/milestones.rb index cce87a6d981..708c5243947 100644 --- a/features/steps/project/issues/milestones.rb +++ b/features/steps/project/issues/milestones.rb @@ -6,9 +6,9 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps step 'I should see milestone "v2.2"' do milestone = @project.milestones.find_by(title: "v2.2") - page.should have_content(milestone.title[0..10]) - page.should have_content(milestone.expires_at) - page.should have_content("Issues") + expect(page).to have_content(milestone.title[0..10]) + expect(page).to have_content(milestone.expires_at) + expect(page).to have_content("Issues") end step 'I click link "v2.2"' do @@ -26,9 +26,9 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps step 'I should see milestone "v2.3"' do milestone = @project.milestones.find_by(title: "v2.3") - page.should have_content(milestone.title[0..10]) - page.should have_content(milestone.expires_at) - page.should have_content("Issues") + expect(page).to have_content(milestone.title[0..10]) + expect(page).to have_content(milestone.expires_at) + expect(page).to have_content("Issues") end step 'project "Shop" has milestone "v2.2"' do @@ -54,6 +54,6 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps end step 'I should see 3 issues' do - page.should have_selector('#tab-issues li.issue-row', count: 4) + expect(page).to have_selector('#tab-issues li.issue-row', count: 4) end end diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index f6cfa7ef9ed..fe019a0b3af 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -25,43 +25,43 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I should see merge request "Wiki Feature"' do within '.merge-request' do - page.should have_content "Wiki Feature" + expect(page).to have_content "Wiki Feature" end end step 'I should see closed merge request "Bug NS-04"' do merge_request = MergeRequest.find_by!(title: "Bug NS-04") - merge_request.closed?.should be_true - page.should have_content "Rejected by" + expect(merge_request.closed?).to be_true + expect(page).to have_content "Rejected by" end step 'I should see merge request "Bug NS-04"' do - page.should have_content "Bug NS-04" + expect(page).to have_content "Bug NS-04" end step 'I should see "Bug NS-04" in merge requests' do - page.should have_content "Bug NS-04" + expect(page).to have_content "Bug NS-04" end step 'I should see "Feature NS-03" in merge requests' do - page.should have_content "Feature NS-03" + expect(page).to have_content "Feature NS-03" end step 'I should not see "Feature NS-03" in merge requests' do - page.should_not have_content "Feature NS-03" + expect(page).not_to have_content "Feature NS-03" end step 'I should not see "Bug NS-04" in merge requests' do - page.should_not have_content "Bug NS-04" + expect(page).not_to have_content "Bug NS-04" end step 'I should see that I am subscribed' do - find(".subscribe-button span").text.should == "Unsubscribe" + expect(find(".subscribe-button span").text).to eq "Unsubscribe" end step 'I should see that I am unsubscribed' do - find(".subscribe-button span").should have_content("Subscribe") + expect(find(".subscribe-button span")).to have_content("Subscribe") end step 'I click button "Unsubscribe"' do @@ -125,7 +125,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps expect(buttons.count).to eq(2) buttons.each do |b| - expect(b['href']).should_not have_content('json') + expect(expect(b['href'])).not_to have_content('json') end end @@ -164,24 +164,24 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I should see a discussion has started on diff' do - page.should have_content "#{current_user.name} started a discussion" - page.should have_content sample_commit.line_code_path - page.should have_content "Line is wrong" + expect(page).to have_content "#{current_user.name} started a discussion" + expect(page).to have_content sample_commit.line_code_path + expect(page).to have_content "Line is wrong" end step 'I should see a discussion has started on commit diff' do - page.should have_content "#{current_user.name} started a discussion on commit" - page.should have_content sample_commit.line_code_path - page.should have_content "Line is wrong" + expect(page).to have_content "#{current_user.name} started a discussion on commit" + expect(page).to have_content sample_commit.line_code_path + expect(page).to have_content "Line is wrong" end step 'I should see a discussion has started on commit' do - page.should have_content "#{current_user.name} started a discussion on commit" - page.should have_content "One comment to rule them all" + expect(page).to have_content "#{current_user.name} started a discussion on commit" + expect(page).to have_content "One comment to rule them all" end step 'merge request is mergeable' do - page.should have_button 'Accept Merge Request' + expect(page).to have_button 'Accept Merge Request' end step 'I modify merge commit message' do @@ -206,7 +206,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I should see merged request' do within '.issue-box' do - page.should have_content "Accepted" + expect(page).to have_content "Accepted" end end @@ -216,7 +216,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I should see reopened merge request "Bug NS-04"' do within '.issue-box' do - page.should have_content "Open" + expect(page).to have_content "Open" end end @@ -234,25 +234,25 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I should not see a comment like "Line is wrong" in the second file' do within '.files [id^=diff]:nth-child(2)' do - page.should_not have_visible_content "Line is wrong" + expect(page).not_to have_visible_content "Line is wrong" end end step 'I should see a comment like "Line is wrong" in the second file' do within '.files [id^=diff]:nth-child(2) .note-body > .note-text' do - page.should have_visible_content "Line is wrong" + expect(page).to have_visible_content "Line is wrong" end end step 'I should not see a comment like "Line is wrong here" in the second file' do within '.files [id^=diff]:nth-child(2)' do - page.should_not have_visible_content "Line is wrong here" + expect(page).not_to have_visible_content "Line is wrong here" end end step 'I should see a comment like "Line is wrong here" in the second file' do within '.files [id^=diff]:nth-child(2) .note-body > .note-text' do - page.should have_visible_content "Line is wrong here" + expect(page).to have_visible_content "Line is wrong here" end end @@ -265,7 +265,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end within ".files [id^=diff]:nth-child(1) .note-body > .note-text" do - page.should have_content "Line is correct" + expect(page).to have_content "Line is correct" end end @@ -280,7 +280,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I should still see a comment like "Line is correct" in the first file' do within '.files [id^=diff]:nth-child(1) .note-body > .note-text' do - page.should have_visible_content "Line is correct" + expect(page).to have_visible_content "Line is correct" end end @@ -298,7 +298,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps step 'I should see comments on the side-by-side diff page' do within '.files [id^=diff]:nth-child(1) .parallel .note-body > .note-text' do - page.should have_visible_content "Line is correct" + expect(page).to have_visible_content "Line is correct" end end @@ -316,8 +316,8 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I should see new target branch changes' do - page.should have_content 'From fix into feature' - page.should have_content 'Target branch changed from master to feature' + expect(page).to have_content 'From fix into feature' + expect(page).to have_content 'Target branch changed from master to feature' end def merge_request @@ -334,7 +334,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps click_button "Add Comment" end - page.should have_content message + expect(page).to have_content message end def init_diff_note_first_file diff --git a/features/steps/project/network_graph.rb b/features/steps/project/network_graph.rb index a15688ace6a..14b06917f0a 100644 --- a/features/steps/project/network_graph.rb +++ b/features/steps/project/network_graph.rb @@ -4,7 +4,7 @@ class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps include SharedProject step 'page should have network graph' do - page.should have_selector ".network-graph" + expect(page).to have_selector ".network-graph" end When 'I visit project "Shop" network page' do @@ -16,16 +16,16 @@ class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps end step 'page should select "master" in select box' do - page.should have_selector '.select2-chosen', text: "master" + expect(page).to have_selector '.select2-chosen', text: "master" end step 'page should select "v1.0.0" in select box' do - page.should have_selector '.select2-chosen', text: "v1.0.0" + expect(page).to have_selector '.select2-chosen', text: "v1.0.0" end step 'page should have "master" on graph' do within '.network-graph' do - page.should have_content 'master' + expect(page).to have_content 'master' end end @@ -46,27 +46,27 @@ class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps step 'page should have content not containing "v1.0.0"' do within '.network-graph' do - page.should have_content 'Change some files' + expect(page).to have_content 'Change some files' end end step 'page should not have content not containing "v1.0.0"' do within '.network-graph' do - page.should_not have_content 'Change some files' + expect(page).not_to have_content 'Change some files' end end step 'page should select "feature" in select box' do - page.should have_selector '.select2-chosen', text: "feature" + expect(page).to have_selector '.select2-chosen', text: "feature" end step 'page should select "v1.0.0" in select box' do - page.should have_selector '.select2-chosen', text: "v1.0.0" + expect(page).to have_selector '.select2-chosen', text: "v1.0.0" end step 'page should have "feature" on graph' do within '.network-graph' do - page.should have_content 'feature' + expect(page).to have_content 'feature' end end @@ -80,7 +80,7 @@ class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps step 'page should have "v1.0.0" on graph' do within '.network-graph' do - page.should have_content 'v1.0.0' + expect(page).to have_content 'v1.0.0' end end diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb index fcc15aacc21..126c9c0524c 100644 --- a/features/steps/project/project.rb +++ b/features/steps/project/project.rb @@ -13,7 +13,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps end step 'I should see project with new settings' do - find_field('project_name').value.should == 'NewName' + expect(find_field('project_name').value).to eq 'NewName' end step 'change project path settings' do @@ -22,7 +22,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps end step 'I should see project with new path settings' do - project.path.should == 'new-path' + expect(project.path).to eq 'new-path' end step 'I change the project avatar' do @@ -35,13 +35,13 @@ class Spinach::Features::Project < Spinach::FeatureSteps end step 'I should see new project avatar' do - @project.avatar.should be_instance_of AvatarUploader + expect(@project.avatar).to be_instance_of AvatarUploader url = @project.avatar.url - url.should == "/uploads/project/avatar/#{ @project.id }/gitlab_logo.png" + expect(url).to eq "/uploads/project/avatar/#{ @project.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 project avatar' do @@ -59,16 +59,16 @@ class Spinach::Features::Project < Spinach::FeatureSteps end step 'I should see the default project avatar' do - @project.avatar?.should be_false + expect(@project.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 should see project "Shop" version' do within '.project-side' do - page.should have_content '6.7.0.pre' + expect(page).to have_content '6.7.0.pre' end end @@ -78,7 +78,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps end step 'I should see project default branch changed' do - find(:css, 'select#project_default_branch').value.should == 'fix' + expect(find(:css, 'select#project_default_branch').value).to eq 'fix' end step 'I select project "Forum" README tab' do @@ -86,13 +86,13 @@ class Spinach::Features::Project < Spinach::FeatureSteps end step 'I should see project "Forum" README' do - page.should have_link 'README.md' - page.should have_content 'Sample repo for testing gitlab features' + expect(page).to have_link 'README.md' + expect(page).to have_content 'Sample repo for testing gitlab features' end step 'I should see project "Shop" README' do - page.should have_link 'README.md' - page.should have_content 'testme' + expect(page).to have_link 'README.md' + expect(page).to have_content 'testme' end step 'I add project tags' do @@ -104,14 +104,14 @@ class Spinach::Features::Project < Spinach::FeatureSteps end step 'I should not see "New Issue" button' do - page.should_not have_link 'New Issue' + expect(page).not_to have_link 'New Issue' end step 'I should not see "New Merge Request" button' do - page.should_not have_link 'New Merge Request' + expect(page).not_to have_link 'New Merge Request' end step 'I should not see "Snippets" button' do - page.should_not have_link 'Snippets' + expect(page).not_to have_link 'Snippets' end end diff --git a/features/steps/project/redirects.rb b/features/steps/project/redirects.rb index 57c6e39c801..373f5bb8ada 100644 --- a/features/steps/project/redirects.rb +++ b/features/steps/project/redirects.rb @@ -19,7 +19,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps step 'I should see project "Community" home page' do Gitlab.config.gitlab.should_receive(:host).and_return("www.example.com") within '.navbar-gitlab .title' do - page.should have_content 'Community' + expect(page).to have_content 'Community' end end @@ -48,8 +48,8 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps step 'I should be redirected to "Community" page' do project = Project.find_by(name: 'Community') - current_path.should == "/#{project.path_with_namespace}" - status_code.should == 200 + expect(current_path).to eq "/#{project.path_with_namespace}" + expect(status_code).to eq 200 end step 'I get redirected to signin page where I sign in' do @@ -63,7 +63,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps step 'I should be redirected to "Enterprise" page' do project = Project.find_by(name: 'Enterprise') - current_path.should == "/#{project.path_with_namespace}" - status_code.should == 200 + expect(current_path).to eq "/#{project.path_with_namespace}" + expect(status_code).to eq 200 end end diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb index 4b3d79324ab..0327fd61981 100644 --- a/features/steps/project/services.rb +++ b/features/steps/project/services.rb @@ -8,16 +8,16 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps end step 'I should see list of available services' do - page.should have_content 'Project services' - page.should have_content 'Campfire' - page.should have_content 'HipChat' - page.should have_content 'GitLab CI' - page.should have_content 'Assembla' - page.should have_content 'Pushover' - page.should have_content 'Atlassian Bamboo' - page.should have_content 'JetBrains TeamCity' - page.should have_content 'Asana' - page.should have_content 'Irker (IRC gateway)' + expect(page).to have_content 'Project services' + expect(page).to have_content 'Campfire' + expect(page).to have_content 'HipChat' + expect(page).to have_content 'GitLab CI' + expect(page).to have_content 'Assembla' + expect(page).to have_content 'Pushover' + expect(page).to have_content 'Atlassian Bamboo' + expect(page).to have_content 'JetBrains TeamCity' + expect(page).to have_content 'Asana' + expect(page).to have_content 'Irker (IRC gateway)' end step 'I click gitlab-ci service link' do @@ -32,7 +32,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps end step 'I should see service settings saved' do - find_field('Project url').value.should == 'http://ci.gitlab.org/projects/3' + expect(find_field('Project url').value).to eq 'http://ci.gitlab.org/projects/3' end step 'I click hipchat service link' do @@ -47,7 +47,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps end step 'I should see hipchat service settings saved' do - find_field('Room').value.should == 'gitlab' + expect(find_field('Room').value).to eq 'gitlab' end step 'I fill hipchat settings with custom server' do @@ -59,7 +59,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps end step 'I should see hipchat service settings with custom server saved' do - find_field('Server').value.should == 'https://chat.example.com' + expect(find_field('Server').value).to eq 'https://chat.example.com' end step 'I click pivotaltracker service link' do @@ -73,7 +73,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps end step 'I should see pivotaltracker service settings saved' do - find_field('Token').value.should == 'verySecret' + expect(find_field('Token').value).to eq 'verySecret' end step 'I click Flowdock service link' do @@ -87,7 +87,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps end step 'I should see Flowdock service settings saved' do - find_field('Token').value.should == 'verySecret' + expect(find_field('Token').value).to eq 'verySecret' end step 'I click Assembla service link' do @@ -101,7 +101,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps end step 'I should see Assembla service settings saved' do - find_field('Token').value.should == 'verySecret' + expect(find_field('Token').value).to eq 'verySecret' end step 'I click Asana service link' do @@ -116,8 +116,8 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps end step 'I should see Asana service settings saved' do - find_field('Api key').value.should == 'verySecret' - find_field('Restrict to branch').value.should == 'master' + expect(find_field('Api key').value).to eq 'verySecret' + expect(find_field('Restrict to branch').value).to eq 'master' end step 'I click email on push service link' do @@ -130,7 +130,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps end step 'I should see email on push service settings saved' do - find_field('Recipients').value.should == 'qa@company.name' + expect(find_field('Recipients').value).to eq 'qa@company.name' end step 'I click Irker service link' do @@ -145,8 +145,8 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps end step 'I should see Irker service settings saved' do - find_field('Recipients').value.should == 'irc://chat.freenode.net/#commits' - find_field('Colorize messages').value.should == '1' + expect(find_field('Recipients').value).to eq 'irc://chat.freenode.net/#commits' + expect(find_field('Colorize messages').value).to eq '1' end step 'I click Slack service link' do @@ -160,7 +160,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps end step 'I should see Slack service settings saved' do - find_field('Webhook').value.should == 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685' + expect(find_field('Webhook').value).to eq 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685' end step 'I click Pushover service link' do @@ -178,11 +178,11 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps end step 'I should see Pushover service settings saved' do - find_field('Api key').value.should == 'verySecret' - find_field('User key').value.should == 'verySecret' - find_field('Device').value.should == 'myDevice' - find_field('Priority').find('option[selected]').value.should == '1' - find_field('Sound').find('option[selected]').value.should == 'bike' + expect(find_field('Api key').value).to eq 'verySecret' + expect(find_field('User key').value).to eq 'verySecret' + expect(find_field('Device').value).to eq 'myDevice' + expect(find_field('Priority').find('option[selected]').value).to eq '1' + expect(find_field('Sound').find('option[selected]').value).to eq 'bike' end step 'I click Atlassian Bamboo CI service link' do @@ -199,9 +199,9 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps end step 'I should see Atlassian Bamboo CI service settings saved' do - find_field('Bamboo url').value.should == 'http://bamboo.example.com' - find_field('Build key').value.should == 'KEY' - find_field('Username').value.should == 'user' + expect(find_field('Bamboo url').value).to eq 'http://bamboo.example.com' + expect(find_field('Build key').value).to eq 'KEY' + expect(find_field('Username').value).to eq 'user' end step 'I click JetBrains TeamCity CI service link' do @@ -218,8 +218,8 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps end step 'I should see JetBrains TeamCity CI service settings saved' do - find_field('Teamcity url').value.should == 'http://teamcity.example.com' - find_field('Build type').value.should == 'GitlabTest_Build' - find_field('Username').value.should == 'user' + expect(find_field('Teamcity url').value).to eq 'http://teamcity.example.com' + expect(find_field('Build type').value).to eq 'GitlabTest_Build' + expect(find_field('Username').value).to eq 'user' end end diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb index 343aeb53b11..ff3e14b53ba 100644 --- a/features/steps/project/snippets.rb +++ b/features/steps/project/snippets.rb @@ -30,15 +30,15 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps end step 'I should see "Snippet one" in snippets' do - page.should have_content "Snippet one" + expect(page).to have_content "Snippet one" end step 'I should not see "Snippet two" in snippets' do - page.should_not have_content "Snippet two" + expect(page).not_to have_content "Snippet two" end step 'I should not see "Snippet one" in snippets' do - page.should_not have_content "Snippet one" + expect(page).not_to have_content "Snippet one" end step 'I click link "Edit"' do @@ -61,8 +61,8 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps end step 'I should see snippet "Snippet three"' do - page.should have_content "Snippet three" - page.should have_content "Content of snippet three" + expect(page).to have_content "Snippet three" + expect(page).to have_content "Content of snippet three" end step 'I submit new title "Snippet new title"' do @@ -71,7 +71,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps end step 'I should see "Snippet new title"' do - page.should have_content "Snippet new title" + expect(page).to have_content "Snippet new title" end step 'I leave a comment like "Good snippet!"' do @@ -82,7 +82,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps end step 'I should see comment "Good snippet!"' do - page.should have_content "Good snippet!" + expect(page).to have_content "Good snippet!" end step 'I visit snippet page "Snippet one"' do diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index caf6c73ee06..58a6ef4f394 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -5,23 +5,23 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps include RepoHelpers step 'I should see files from repository' do - page.should have_content "VERSION" - page.should have_content ".gitignore" - page.should have_content "LICENSE" + expect(page).to have_content "VERSION" + expect(page).to have_content ".gitignore" + expect(page).to have_content "LICENSE" end step 'I should see files from repository for "6d39438"' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, "6d39438") - page.should have_content ".gitignore" - page.should have_content "LICENSE" + expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "6d39438") + expect(page).to have_content ".gitignore" + expect(page).to have_content "LICENSE" end step 'I see the ".gitignore"' do - page.should have_content '.gitignore' + expect(page).to have_content '.gitignore' end step 'I don\'t see the ".gitignore"' do - page.should_not have_content '.gitignore' + expect(page).not_to have_content '.gitignore' end step 'I click on ".gitignore" file in repo' do @@ -29,11 +29,11 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I should see its content' do - page.should have_content old_gitignore_content + expect(page).to have_content old_gitignore_content end step 'I should see its new content' do - page.should have_content new_gitignore_content + expect(page).to have_content new_gitignore_content end step 'I click link "Raw"' do @@ -41,7 +41,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I should see raw file content' do - source.should == sample_blob.data + expect(source).to eq sample_blob.data end step 'I click button "Edit"' do @@ -49,16 +49,16 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I cannot see the edit button' do - page.should_not have_link 'edit' + expect(page).not_to have_link 'edit' end step 'The edit button is disabled' do - page.should have_css '.disabled', text: 'Edit' + expect(page).to have_css '.disabled', text: 'Edit' end step 'I can edit code' do set_new_content - evaluate_script('blob.editor.getValue()').should == new_gitignore_content + expect(evaluate_script('blob.editor.getValue()')).to eq new_gitignore_content end step 'I edit code' do @@ -98,7 +98,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I see diff' do - page.should have_css '.line_holder.new' + expect(page).to have_css '.line_holder.new' end step 'I click on "new file" link in repo' do @@ -106,8 +106,8 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I can see new file page' do - page.should have_content "New file" - page.should have_content "Commit message" + expect(page).to have_content "New file" + expect(page).to have_content "Commit message" end step 'I click on files directory' do @@ -119,8 +119,8 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I see Browse dir link' do - page.should have_link 'Browse Dir »' - page.should_not have_link 'Browse Code »' + expect(page).to have_link 'Browse Dir »' + expect(page).not_to have_link 'Browse Code »' end step 'I click on readme file' do @@ -130,14 +130,14 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I see Browse file link' do - page.should have_link 'Browse File »' - page.should_not have_link 'Browse Code »' + expect(page).to have_link 'Browse File »' + expect(page).not_to have_link 'Browse Code »' end step 'I see Browse code link' do - page.should have_link 'Browse Code »' - page.should_not have_link 'Browse File »' - page.should_not have_link 'Browse Dir »' + expect(page).to have_link 'Browse Code »' + expect(page).not_to have_link 'Browse File »' + expect(page).not_to have_link 'Browse Dir »' end step 'I click on Permalink' do @@ -145,7 +145,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I am redirected to the files URL' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, 'master') + expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, 'master') end step 'I am redirected to the ".gitignore"' do diff --git a/features/steps/project/source/git_blame.rb b/features/steps/project/source/git_blame.rb index e29a816c51b..d0a27f47e2a 100644 --- a/features/steps/project/source/git_blame.rb +++ b/features/steps/project/source/git_blame.rb @@ -12,8 +12,8 @@ class Spinach::Features::ProjectSourceGitBlame < Spinach::FeatureSteps end step 'I should see git file blame' do - page.should have_content "*.rb" - page.should have_content "Dmitriy Zaporozhets" - page.should have_content "Initial commit" + expect(page).to have_content "*.rb" + expect(page).to have_content "Dmitriy Zaporozhets" + expect(page).to have_content "Initial commit" end end diff --git a/features/steps/project/source/markdown_render.rb b/features/steps/project/source/markdown_render.rb index 7961fdedad8..b6534f757c7 100644 --- a/features/steps/project/source/markdown_render.rb +++ b/features/steps/project/source/markdown_render.rb @@ -13,19 +13,19 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see files from repository in markdown' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown") - page.should have_content "README.md" - page.should have_content "CHANGELOG" + expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown") + expect(page).to have_content "README.md" + expect(page).to have_content "CHANGELOG" end step 'I should see rendered README which contains correct links' do - page.should have_content "Welcome to GitLab GitLab is a free project and repository management application" - page.should have_link "GitLab API doc" - page.should have_link "GitLab API website" - page.should have_link "Rake tasks" - page.should have_link "backup and restore procedure" - page.should have_link "GitLab API doc directory" - page.should have_link "Maintenance" + expect(page).to have_content "Welcome to GitLab GitLab is a free project and repository management application" + expect(page).to have_link "GitLab API doc" + expect(page).to have_link "GitLab API website" + expect(page).to have_link "Rake tasks" + expect(page).to have_link "backup and restore procedure" + expect(page).to have_link "GitLab API doc directory" + expect(page).to have_link "Maintenance" end step 'I click on Gitlab API in README' do @@ -33,8 +33,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct document rendered' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") - page.should have_content "All API requests require authentication" + expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") + expect(page).to have_content "All API requests require authentication" end step 'I click on Rake tasks in README' do @@ -42,9 +42,9 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct directory rendered' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/raketasks") - page.should have_content "backup_restore.md" - page.should have_content "maintenance.md" + expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown/doc/raketasks") + expect(page).to have_content "backup_restore.md" + expect(page).to have_content "maintenance.md" end step 'I click on GitLab API doc directory in README' do @@ -52,9 +52,9 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct doc/api directory rendered' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") - page.should have_content "README.md" - page.should have_content "users.md" + expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") + expect(page).to have_content "README.md" + expect(page).to have_content "users.md" end step 'I click on Maintenance in README' do @@ -62,8 +62,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct maintenance file rendered' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/raketasks/maintenance.md") - page.should have_content "bundle exec rake gitlab:env:info RAILS_ENV=production" + expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/raketasks/maintenance.md") + expect(page).to have_content "bundle exec rake gitlab:env:info RAILS_ENV=production" end step 'I click on link "empty" in the README' do @@ -93,10 +93,10 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see correct file rendered' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") - page.should have_content "Contents" - page.should have_link "Users" - page.should have_link "Rake tasks" + expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") + expect(page).to have_content "Contents" + expect(page).to have_link "Users" + expect(page).to have_link "Rake tasks" end step 'I click on users in doc/api/README' do @@ -104,8 +104,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see the correct document file' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") - page.should have_content "Get a list of users." + expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") + expect(page).to have_content "Get a list of users." end step 'I click on raketasks in doc/api/README' do @@ -131,32 +131,32 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see files from repository in markdown branch' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown") - page.should have_content "README.md" - page.should have_content "CHANGELOG" + expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown") + expect(page).to have_content "README.md" + expect(page).to have_content "CHANGELOG" end step 'I see correct file rendered in markdown branch' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") - page.should have_content "Contents" - page.should have_link "Users" - page.should have_link "Rake tasks" + expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") + expect(page).to have_content "Contents" + expect(page).to have_link "Users" + expect(page).to have_link "Rake tasks" end step 'I should see correct document rendered for markdown branch' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") - page.should have_content "All API requests require authentication" + expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") + expect(page).to have_content "All API requests require authentication" end step 'I should see correct directory rendered for markdown branch' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/raketasks") - page.should have_content "backup_restore.md" - page.should have_content "maintenance.md" + expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown/doc/raketasks") + expect(page).to have_content "backup_restore.md" + expect(page).to have_content "maintenance.md" end step 'I should see the users document file in markdown branch' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") - page.should have_content "Get a list of users." + expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") + expect(page).to have_content "Get a list of users." end # Expected link contents @@ -208,7 +208,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps step 'I go to wiki page' do click_link "Wiki" - current_path.should == namespace_project_wiki_path(@project.namespace, @project, "home") + expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "home") end step 'I add various links to the wiki page' do @@ -218,8 +218,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'Wiki page should have added links' do - current_path.should == namespace_project_wiki_path(@project.namespace, @project, "home") - page.should have_content "test GitLab API doc Rake tasks" + expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "home") + expect(page).to have_content "test GitLab API doc Rake tasks" end step 'I add a header to the wiki page' do @@ -237,13 +237,13 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see new wiki page named test' do - current_path.should == namespace_project_wiki_path(@project.namespace, @project, "test") - page.should have_content "Editing" + expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "test") + expect(page).to have_content "Editing" end When 'I go back to wiki page home' do visit namespace_project_wiki_path(@project.namespace, @project, "home") - current_path.should == namespace_project_wiki_path(@project.namespace, @project, "home") + expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "home") end step 'I click on GitLab API doc link' do @@ -251,8 +251,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see Gitlab API document' do - current_path.should == namespace_project_wiki_path(@project.namespace, @project, "api") - page.should have_content "Editing" + expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "api") + expect(page).to have_content "Editing" end step 'I click on Rake tasks link' do @@ -260,13 +260,13 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see Rake tasks directory' do - current_path.should == namespace_project_wiki_path(@project.namespace, @project, "raketasks") - page.should have_content "Editing" + expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "raketasks") + expect(page).to have_content "Editing" end step 'I go directory which contains README file' do visit namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") - current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") + expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") end step 'I click on a relative link in README' do @@ -274,8 +274,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see the correct markdown' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") - page.should have_content "List users" + expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") + expect(page).to have_content "List users" end step 'Header "Application details" should have correct id and link' do diff --git a/features/steps/project/source/multiselect_blob.rb b/features/steps/project/source/multiselect_blob.rb index b749ba49371..212537fc333 100644 --- a/features/steps/project/source/multiselect_blob.rb +++ b/features/steps/project/source/multiselect_blob.rb @@ -23,7 +23,7 @@ class Spinach::Features::ProjectSourceMultiselectBlob < Spinach::FeatureSteps pluralization = range.kind_of?(Array) ? "s" : "" step "I should see \"#{fragment}\" as URI fragment" do - URI.parse(current_url).fragment.should == fragment + expect(URI.parse(current_url).fragment).to eq fragment end step "I should see line#{pluralization} #{fragment[1..-1]} highlighted" do @@ -35,7 +35,7 @@ class Spinach::Features::ProjectSourceMultiselectBlob < Spinach::FeatureSteps extra ||= ids.delete(element[:id]).nil? end - extra.should be_false and ids.should be_empty + expect(extra).to be_false and ids.should be_empty end end end diff --git a/features/steps/project/source/search_code.rb b/features/steps/project/source/search_code.rb index b66c5a4123a..feee756d7ec 100644 --- a/features/steps/project/source/search_code.rb +++ b/features/steps/project/source/search_code.rb @@ -9,11 +9,11 @@ class Spinach::Features::ProjectSourceSearchCode < Spinach::FeatureSteps end step 'I should see files from repository containing "coffee"' do - page.should have_content 'coffee' - page.should have_content 'CONTRIBUTING.md' + expect(page).to have_content 'coffee' + expect(page).to have_content 'CONTRIBUTING.md' end step 'I should see empty result' do - page.should have_content "We couldn't find any" + expect(page).to have_content "We couldn't find any" end end diff --git a/features/steps/project/star.rb b/features/steps/project/star.rb index 50cdfd73c34..8b50bfcef04 100644 --- a/features/steps/project/star.rb +++ b/features/steps/project/star.rb @@ -5,7 +5,7 @@ class Spinach::Features::ProjectStar < Spinach::FeatureSteps include SharedUser step "The project has no stars" do - page.should_not have_content '.star-buttons' + expect(page).not_to have_content '.star-buttons' end step "The project has 0 stars" do @@ -26,7 +26,7 @@ class Spinach::Features::ProjectStar < 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 protected diff --git a/features/steps/project/team_management.rb b/features/steps/project/team_management.rb index 09e5af3ef48..4f4329359f9 100644 --- a/features/steps/project/team_management.rb +++ b/features/steps/project/team_management.rb @@ -5,14 +5,14 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps include Select2Helper step 'I should be able to see myself in team' do - page.should have_content(@user.name) - page.should have_content(@user.username) + expect(page).to have_content(@user.name) + expect(page).to have_content(@user.username) end step 'I should see "Dmitriy" in team list' do user = User.find_by(name: "Dmitriy") - page.should have_content(user.name) - page.should have_content(user.username) + expect(page).to have_content(user.name) + expect(page).to have_content(user.username) end step 'I click link "Add members"' do @@ -31,7 +31,7 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps step 'I should see "Mike" in team list as "Reporter"' do within ".access-reporter" do - page.should have_content('Mike') + expect(page).to have_content('Mike') end end @@ -45,15 +45,15 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps step 'I should see "sjobs@apple.com" in team list as invited "Reporter"' do within ".access-reporter" do - page.should have_content('sjobs@apple.com') - page.should have_content('invited') - page.should have_content('Reporter') + expect(page).to have_content('sjobs@apple.com') + expect(page).to have_content('invited') + expect(page).to have_content('Reporter') end end step 'I should see "Dmitriy" in team list as "Developer"' do within ".access-developer" do - page.should have_content('Dmitriy') + expect(page).to have_content('Dmitriy') end end @@ -70,7 +70,7 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps step 'I should see "Dmitriy" in team list as "Reporter"' do within ".access-reporter" do - page.should have_content('Dmitriy') + expect(page).to have_content('Dmitriy') end end @@ -80,8 +80,8 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps step 'I should not see "Dmitriy" in team list' do user = User.find_by(name: "Dmitriy") - page.should_not have_content(user.name) - page.should_not have_content(user.username) + expect(page).not_to have_content(user.name) + expect(page).not_to have_content(user.username) end step 'gitlab user "Mike"' do diff --git a/features/steps/project/wiki.rb b/features/steps/project/wiki.rb index 58cb0ceb3f1..c6062e2f132 100644 --- a/features/steps/project/wiki.rb +++ b/features/steps/project/wiki.rb @@ -12,7 +12,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I should be redirected back to the Edit Home Wiki page' do - current_path.should == namespace_project_wiki_path(project.namespace, project, :home) + expect(current_path).to eq namespace_project_wiki_path(project.namespace, project, :home) end step 'I create the Wiki Home page' do @@ -21,11 +21,11 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I should see the newly created wiki page' do - page.should have_content "Home" - page.should have_content "link test" + expect(page).to have_content "Home" + expect(page).to have_content "link test" click_link "link test" - page.should have_content "Editing" + expect(page).to have_content "Editing" end step 'I have an existing Wiki page' do @@ -47,11 +47,11 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I should see the updated content' do - page.should have_content "Updated Wiki Content" + expect(page).to have_content "Updated Wiki Content" end step 'I should be redirected back to that Wiki page' do - current_path.should == namespace_project_wiki_path(project.namespace, project, @page) + expect(current_path).to eq namespace_project_wiki_path(project.namespace, project, @page) end step 'That page has two revisions' do @@ -63,9 +63,9 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I should see both revisions' do - page.should have_content current_user.name - page.should have_content "first commit" - page.should have_content "second commit" + expect(page).to have_content current_user.name + expect(page).to have_content "first commit" + expect(page).to have_content "second commit" end step 'I click on the "Delete this page" button' do @@ -73,7 +73,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'The page should be deleted' do - page.should have_content "Page was successfully deleted" + expect(page).to have_content "Page was successfully deleted" end step 'I click on the "Pages" button' do @@ -81,8 +81,8 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I should see the existing page in the pages list' do - page.should have_content current_user.name - page.should have_content @page.title + expect(page).to have_content current_user.name + expect(page).to have_content @page.title end step 'I have an existing Wiki page with images linked on page' do @@ -98,30 +98,30 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps file = Gollum::File.new(wiki.wiki) Gollum::Wiki.any_instance.stub(:file).with("image.jpg", "master", true).and_return(file) Gollum::File.any_instance.stub(:mime_type).and_return("image/jpeg") - page.should have_link('image', href: "image.jpg") + expect(page).to have_link('image', href: "image.jpg") click_on "image" end step 'I should see the image from wiki repo' do - current_path.should match('wikis/image.jpg') - page.should_not have_xpath('/html') # Page should render the image which means there is no html involved + expect(current_path).to match('wikis/image.jpg') + expect(page).not_to have_xpath('/html') # Page should render the image which means there is no html involved Gollum::Wiki.any_instance.unstub(:file) Gollum::File.any_instance.unstub(:mime_type) end step 'Image should be shown on the page' do - page.should have_xpath("//img[@src=\"image.jpg\"]") + expect(page).to have_xpath("//img[@src=\"image.jpg\"]") end step 'I click on image link' do - page.should have_link('image', href: "image.jpg") + expect(page).to have_link('image', href: "image.jpg") click_on "image" end step 'I should see the new wiki page form' do - current_path.should match('wikis/image.jpg') - page.should have_content('New Wiki Page') - page.should have_content('Editing - image.jpg') + expect(current_path).to match('wikis/image.jpg') + expect(page).to have_content('New Wiki Page') + expect(page).to have_content('Editing - image.jpg') end step 'I create a New page with paths' do @@ -130,7 +130,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps click_on 'Build' fill_in "wiki_content", with: 'wiki content' click_on "Create page" - current_path.should include 'one/two/three' + expect(current_path).to include 'one/two/three' end step 'I create a New page with an invalid name' do @@ -144,7 +144,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I should see non-escaped link in the pages list' do - page.should have_xpath("//a[@href='/#{project.path_with_namespace}/wikis/one/two/three']") + expect(page).to have_xpath("//a[@href='/#{project.path_with_namespace}/wikis/one/two/three']") end step 'I edit the Wiki page with a path' do @@ -153,11 +153,11 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I should see a non-escaped path' do - current_path.should include 'one/two/three' + expect(current_path).to include 'one/two/three' end step 'I should see the Editing page' do - page.should have_content('Editing') + expect(page).to have_content('Editing') end step 'I view the page history of a Wiki page that has a path' do @@ -166,7 +166,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I should see the page history' do - page.should have_content('History for') + expect(page).to have_content('History for') end step 'I search for Wiki content' do |