summaryrefslogtreecommitdiff
path: root/features/steps/project/issues
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-06-12 00:44:13 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-06-12 05:12:09 -0400
commit69bbc413fec7aa4168d9ff12df5421674db90032 (patch)
tree215a7f16d4630067bf4863d8d6f992fcac23969e /features/steps/project/issues
parentb07cf1182f78c5c46edbfa0fde668dd75ae47e05 (diff)
downloadgitlab-ce-69bbc413fec7aa4168d9ff12df5421674db90032.tar.gz
Update all `should`-style syntax to `expect` in features
Diffstat (limited to 'features/steps/project/issues')
-rw-r--r--features/steps/project/issues/filter_labels.rb8
-rw-r--r--features/steps/project/issues/issues.rb44
-rw-r--r--features/steps/project/issues/labels.rb16
-rw-r--r--features/steps/project/issues/milestones.rb14
4 files changed, 41 insertions, 41 deletions
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