Commit a49882e4 authored by Robert Speicher's avatar Robert Speicher

Use `page.within` instead of `within`

parent 02d421c8
......@@ -12,7 +12,7 @@ class Spinach::Features::AdminEmail < Spinach::FeatureSteps
@selected_group.add_user(create(:user), Gitlab::Access::DEVELOPER)
end
within('form#new-admin-email') do
page.within('form#new-admin-email') do
fill_in :subject, with: 'my subject'
fill_in :body, with: @email_text
......
......@@ -104,9 +104,9 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
user = User.find_by(name: "Mary Jane")
member = Group.find_by(name: "Owned").members.where(user_id: user.id).first
within "#group_member_#{member.id}" do
page.within "#group_member_#{member.id}" do
find(".js-toggle-button").click
within "#edit_group_member_#{member.id}" do
page.within "#edit_group_member_#{member.id}" do
select 'Developer', from: 'group_member_access_level'
click_on 'Save'
end
......@@ -118,7 +118,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
step 'I should see the audit event listed' do
within ('table#audits') do
page.within('table#audits') do
expect(page).to have_content 'Add user access as reporter'
expect(page).to have_content 'Change access level from reporter to developer'
expect(page).to have_content 'Remove user access'
......@@ -147,7 +147,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
And 'I change group name' do
within '#tab-edit' do
page.within '#tab-edit' do
fill_in 'group_name', with: 'new-name'
click_button "Save group"
end
......@@ -345,7 +345,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
step 'I add a new LDAP synchronization' do
within('form#new_ldap_group_link') do
page.within('form#new_ldap_group_link') do
find('#ldap_group_link_cn', visible: false).set('my-group-cn')
# fill_in('LDAP Group cn', with: 'my-group-cn', visible: false)
select 'Developer', from: "ldap_group_link_group_access"
......
......@@ -347,19 +347,19 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
step 'I click link "Approve"' do
within '.mr-state-widget' do
page.within '.mr-state-widget' do
click_button 'Approve Merge Request'
end
end
step 'I should not see merge button' do
within '.mr-state-widget' do
page.within '.mr-state-widget' do
expect(page).not_to have_button("Accept Merge Request")
end
end
step 'I should see approved merge request "Bug NS-04"' do
within '.mr-state-widget' do
page.within '.mr-state-widget' do
expect(page).to have_button("Accept Merge Request")
end
end
......
......@@ -78,7 +78,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end
step 'I should see project "Shop" README link' do
within '.project-side' do
page.within '.project-side' do
expect(page).to have_content "README.md"
end
end
......@@ -134,7 +134,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps
user = User.find_by(name: "Pete")
project_member = @project.project_members.find_by(user_id: user)
within "#project_member_#{project_member.id}" do
page.within "#project_member_#{project_member.id}" do
click_button "Edit access level"
select "Master", from: "project_member_access_level"
click_button "Save"
......@@ -148,7 +148,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps
end
step 'I should see the audit event listed' do
within ('table#audits') do
page.within('table#audits') do
expect(page).to have_content "Change access level from developer to master"
expect(page).to have_content(project.owner.name)
expect(page).to have_content('Pete')
......
......@@ -5,13 +5,13 @@ class Spinach::Features::ProjectGroupLinks < Spinach::FeatureSteps
include Select2Helper
step 'I should see project already shared with group "Ops"' do
within '.enabled-groups' do
page.within '.enabled-groups' do
expect(page).to have_content "Ops"
end
end
step 'I should see project is not shared with group "Market"' do
within '.enabled-groups' do
page.within '.enabled-groups' do
expect(page).not_to have_content "Market"
end
end
......@@ -24,7 +24,7 @@ class Spinach::Features::ProjectGroupLinks < Spinach::FeatureSteps
end
step 'I should see project is shared with group "Market"' do
within '.enabled-groups' do
page.within '.enabled-groups' do
expect(page).to have_content "Market"
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment