summaryrefslogtreecommitdiff
path: root/features/steps/groups.rb
diff options
context:
space:
mode:
Diffstat (limited to 'features/steps/groups.rb')
-rw-r--r--features/steps/groups.rb76
1 files changed, 38 insertions, 38 deletions
diff --git a/features/steps/groups.rb b/features/steps/groups.rb
index 84348d1709a..c6c855a7c22 100644
--- a/features/steps/groups.rb
+++ b/features/steps/groups.rb
@@ -16,7 +16,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
step 'I select "Mike" as "Reporter"' do
user = User.find_by(name: "Mike")
- within ".users-group-form" do
+ page.within ".users-group-form" do
select2(user.id, from: "#user_ids", multiple: true)
select "Reporter", from: "access_level"
end
@@ -25,14 +25,14 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
step 'I should see "Mike" in team list as "Reporter"' do
- within '.well-list' do
- page.should have_content('Mike')
- page.should have_content('Reporter')
+ page.within '.well-list' do
+ expect(page).to have_content('Mike')
+ expect(page).to have_content('Reporter')
end
end
step 'I select "sjobs@apple.com" as "Reporter"' do
- within ".users-group-form" do
+ page.within ".users-group-form" do
select2("sjobs@apple.com", from: "#user_ids", multiple: true)
select "Reporter", from: "access_level"
end
@@ -41,39 +41,39 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
step 'I should see "sjobs@apple.com" in team list as invited "Reporter"' do
- within '.well-list' do
- page.should have_content('sjobs@apple.com')
- page.should have_content('invited')
- page.should have_content('Reporter')
+ page.within '.well-list' do
+ 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 group "Owned" projects list' do
Group.find_by(name: "Owned").projects.each do |project|
- page.should have_link project.name
+ expect(page).to have_link project.name
end
end
step 'I should see projects activity feed' do
- page.should have_content 'closed issue'
+ expect(page).to have_content 'closed issue'
end
step 'I should see issues from group "Owned" assigned to me' do
assigned_to_me(:issues).each do |issue|
- page.should have_content issue.title
+ expect(page).to have_content issue.title
end
end
step 'I should see merge requests from group "Owned" assigned to me' do
assigned_to_me(:merge_requests).each do |issue|
- page.should have_content issue.title[0..80]
+ expect(page).to have_content issue.title[0..80]
end
end
step 'I select user "Mary Jane" from list with role "Reporter"' do
user = User.find_by(name: "Mary Jane") || create(:user, name: "Mary Jane")
click_button 'Add members'
- within ".users-group-form" do
+ page.within ".users-group-form" do
select2(user.id, from: "#user_ids", multiple: true)
select "Reporter", from: "access_level"
end
@@ -82,22 +82,22 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
step 'I should see user "John Doe" in team list' do
projects_with_access = find(".panel .well-list")
- projects_with_access.should have_content("John Doe")
+ expect(projects_with_access).to have_content("John Doe")
end
step 'I should not see user "John Doe" in team list' do
projects_with_access = find(".panel .well-list")
- projects_with_access.should_not have_content("John Doe")
+ expect(projects_with_access).not_to have_content("John Doe")
end
step 'I should see user "Mary Jane" in team list' do
projects_with_access = find(".panel .well-list")
- projects_with_access.should have_content("Mary Jane")
+ expect(projects_with_access).to have_content("Mary Jane")
end
step 'I should not see user "Mary Jane" in team list' do
projects_with_access = find(".panel .well-list")
- projects_with_access.should_not have_content("Mary Jane")
+ expect(projects_with_access).not_to have_content("Mary Jane")
end
step 'project from group "Owned" has issues assigned to me' do
@@ -122,8 +122,8 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
step 'I should see new group "Owned" name' do
- within ".navbar-gitlab" do
- page.should have_content "new-name"
+ page.within ".navbar-gitlab" do
+ expect(page).to have_content "new-name"
end
end
@@ -134,12 +134,12 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
step 'I should see new group "Owned" avatar' do
- Group.find_by(name: "Owned").avatar.should be_instance_of AvatarUploader
- Group.find_by(name: "Owned").avatar.url.should == "/uploads/group/avatar/#{ Group.find_by(name:"Owned").id }/gitlab_logo.png"
+ expect(Group.find_by(name: "Owned").avatar).to be_instance_of AvatarUploader
+ expect(Group.find_by(name: "Owned").avatar.url).to eq "/uploads/group/avatar/#{ Group.find_by(name:"Owned").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 group "Owned" avatar' do
@@ -154,11 +154,11 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
step 'I should not see group "Owned" avatar' do
- Group.find_by(name: "Owned").avatar?.should be_false
+ expect(Group.find_by(name: "Owned").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 click on the "Remove User From Group" button for "John Doe"' do
@@ -172,17 +172,17 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
step 'I should not see the "Remove User From Group" button for "John Doe"' do
- find(:css, 'li', text: "John Doe").should_not have_selector(:css, 'a.btn-remove')
+ expect(find(:css, 'li', text: "John Doe")).not_to have_selector(:css, 'a.btn-remove')
# poltergeist always confirms popups.
end
step 'I should not see the "Remove User From Group" button for "Mary Jane"' do
- find(:css, 'li', text: "Mary Jane").should_not have_selector(:css, 'a.btn-remove')
+ expect(find(:css, 'li', text: "Mary Jane")).not_to have_selector(:css, 'a.btn-remove')
# poltergeist always confirms popups.
end
step 'I search for \'Mary\' member' do
- within '.member-search-form' do
+ page.within '.member-search-form' do
fill_in 'search', with: 'Mary'
click_button 'Search'
end
@@ -193,7 +193,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
step 'I should see group milestones index page has no milestones' do
- page.should have_content('No milestones to show')
+ expect(page).to have_content('No milestones to show')
end
step 'Group has projects with milestones' do
@@ -201,10 +201,10 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
step 'I should see group milestones index page with milestones' do
- page.should have_content('Version 7.2')
- page.should have_content('GL-113')
- page.should have_link('2 Issues', href: issues_group_path("owned", milestone_title: "Version 7.2"))
- page.should have_link('3 Merge Requests', href: merge_requests_group_path("owned", milestone_title: "GL-113"))
+ expect(page).to have_content('Version 7.2')
+ expect(page).to have_content('GL-113')
+ expect(page).to have_link('2 Issues', href: issues_group_path("owned", milestone_title: "Version 7.2"))
+ expect(page).to have_link('3 Merge Requests', href: merge_requests_group_path("owned", milestone_title: "GL-113"))
end
step 'I click on one group milestone' do
@@ -212,14 +212,14 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
step 'I should see group milestone with descriptions and expiry date' do
- page.should have_content('expires at Aug 20, 2114')
+ expect(page).to have_content('expires at Aug 20, 2114')
end
step 'I should see group milestone with all issues and MRs assigned to that milestone' do
- page.should have_content('Milestone GL-113')
- page.should have_content('Progress: 0 closed – 4 open')
- page.should have_link(@issue1.title, href: namespace_project_issue_path(@project1.namespace, @project1, @issue1))
- page.should have_link(@mr3.title, href: namespace_project_merge_request_path(@project3.namespace, @project3, @mr3))
+ expect(page).to have_content('Milestone GL-113')
+ expect(page).to have_content('Progress: 0 closed – 4 open')
+ expect(page).to have_link(@issue1.title, href: namespace_project_issue_path(@project1.namespace, @project1, @issue1))
+ expect(page).to have_link(@mr3.title, href: namespace_project_merge_request_path(@project3.namespace, @project3, @mr3))
end
protected