diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-06-12 07:44:13 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-06-12 12:12:09 +0300 |
commit | 69bbc413fec7aa4168d9ff12df5421674db90032 (patch) | |
tree | 215a7f16d4630067bf4863d8d6f992fcac23969e /features/steps/dashboard | |
parent | b07cf1182f78c5c46edbfa0fde668dd75ae47e05 (diff) |
Update all `should`-style syntax to `expect` in features
Diffstat (limited to 'features/steps/dashboard')
-rw-r--r-- | features/steps/dashboard/archived_projects.rb | 6 | ||||
-rw-r--r-- | features/steps/dashboard/dashboard.rb | 26 | ||||
-rw-r--r-- | features/steps/dashboard/event_filters.rb | 12 | ||||
-rw-r--r-- | features/steps/dashboard/group.rb | 20 | ||||
-rw-r--r-- | features/steps/dashboard/help.rb | 2 | ||||
-rw-r--r-- | features/steps/dashboard/issues.rb | 4 | ||||
-rw-r--r-- | features/steps/dashboard/merge_requests.rb | 4 | ||||
-rw-r--r-- | features/steps/dashboard/new_project.rb | 8 | ||||
-rw-r--r-- | features/steps/dashboard/starred_projects.rb | 2 |
9 files changed, 42 insertions, 42 deletions
diff --git a/features/steps/dashboard/archived_projects.rb b/features/steps/dashboard/archived_projects.rb index 969baf92287..36e092f50c6 100644 --- a/features/steps/dashboard/archived_projects.rb +++ b/features/steps/dashboard/archived_projects.rb @@ -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 diff --git a/features/steps/dashboard/dashboard.rb b/features/steps/dashboard/dashboard.rb index bb1f2f444f9..945bf35ff27 100644 --- a/features/steps/dashboard/dashboard.rb +++ b/features/steps/dashboard/dashboard.rb @@ -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 diff --git a/features/steps/dashboard/event_filters.rb b/features/steps/dashboard/event_filters.rb index 3da3d62d0c0..834afa439a0 100644 --- a/features/steps/dashboard/event_filters.rb +++ b/features/steps/dashboard/event_filters.rb @@ -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 diff --git a/features/steps/dashboard/group.rb b/features/steps/dashboard/group.rb index aeea49320ff..0c6a0ae3725 100644 --- a/features/steps/dashboard/group.rb +++ b/features/steps/dashboard/group.rb @@ -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 diff --git a/features/steps/dashboard/help.rb b/features/steps/dashboard/help.rb index ef433c57c6e..86ab31a58ab 100644 --- a/features/steps/dashboard/help.rb +++ b/features/steps/dashboard/help.rb @@ -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 diff --git a/features/steps/dashboard/issues.rb b/features/steps/dashboard/issues.rb index 60da36e86de..cbe54e2dc79 100644 --- a/features/steps/dashboard/issues.rb +++ b/features/steps/dashboard/issues.rb @@ -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 diff --git a/features/steps/dashboard/merge_requests.rb b/features/steps/dashboard/merge_requests.rb index 9d92082bb83..cec8d06adee 100644 --- a/features/steps/dashboard/merge_requests.rb +++ b/features/steps/dashboard/merge_requests.rb @@ -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 diff --git a/features/steps/dashboard/new_project.rb b/features/steps/dashboard/new_project.rb index 93456a81ecf..07da5f9587e 100644 --- a/features/steps/dashboard/new_project.rb +++ b/features/steps/dashboard/new_project.rb @@ -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 diff --git a/features/steps/dashboard/starred_projects.rb b/features/steps/dashboard/starred_projects.rb index b9ad2f13e29..b098bbc47d0 100644 --- a/features/steps/dashboard/starred_projects.rb +++ b/features/steps/dashboard/starred_projects.rb @@ -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 |