Commit d7b8b38d authored by tauriedavis's avatar tauriedavis Committed by Phil Hughes

try and fix some tests

parent aaaa252e
- form = local_assigns.fetch(:form) - form = local_assigns.fetch(:form)
= render 'projects/merge_request_merge_settings', form: form = render 'projects/merge_request_merge_settings', form: form
\ No newline at end of file
...@@ -20,17 +20,23 @@ describe 'Edit Project Settings' do ...@@ -20,17 +20,23 @@ describe 'Edit Project Settings' do
visit edit_project_path(project) visit edit_project_path(project)
select 'Disabled', from: "project_project_feature_attributes_#{tool_name}_access_level" select 'Disabled', from: "project_project_feature_attributes_#{tool_name}_access_level"
click_button 'Save changes' page.within('.sharing-permissions') do
click_button 'Save changes'
end
wait_for_requests wait_for_requests
expect(page).not_to have_selector(".shortcuts-#{shortcut_name}") expect(page).not_to have_selector(".shortcuts-#{shortcut_name}")
select 'Everyone with access', from: "project_project_feature_attributes_#{tool_name}_access_level" select 'Everyone with access', from: "project_project_feature_attributes_#{tool_name}_access_level"
click_button 'Save changes' page.within('.sharing-permissions') do
click_button 'Save changes'
end
wait_for_requests wait_for_requests
expect(page).to have_selector(".shortcuts-#{shortcut_name}") expect(page).to have_selector(".shortcuts-#{shortcut_name}")
select 'Only team members', from: "project_project_feature_attributes_#{tool_name}_access_level" select 'Only team members', from: "project_project_feature_attributes_#{tool_name}_access_level"
click_button 'Save changes' page.within('.sharing-permissions') do
click_button 'Save changes'
end
wait_for_requests wait_for_requests
expect(page).to have_selector(".shortcuts-#{shortcut_name}") expect(page).to have_selector(".shortcuts-#{shortcut_name}")
......
...@@ -14,7 +14,9 @@ describe 'Edit Project Settings' do ...@@ -14,7 +14,9 @@ describe 'Edit Project Settings' do
it 'shows errors for invalid project name' do it 'shows errors for invalid project name' do
visit edit_project_path(project) visit edit_project_path(project)
fill_in 'project_name_edit', with: 'foo&bar' fill_in 'project_name_edit', with: 'foo&bar'
click_button 'Save changes' page.within('.general-settings') do
click_button 'Save changes'
end
expect(page).to have_field 'project_name_edit', with: 'foo&bar' expect(page).to have_field 'project_name_edit', with: 'foo&bar'
expect(page).to have_content "Name can contain only letters, digits, emojis, '_', '.', dash, space. It must start with letter, digit, emoji or '_'." expect(page).to have_content "Name can contain only letters, digits, emojis, '_', '.', dash, space. It must start with letter, digit, emoji or '_'."
expect(page).to have_button 'Save changes' expect(page).to have_button 'Save changes'
...@@ -23,7 +25,9 @@ describe 'Edit Project Settings' do ...@@ -23,7 +25,9 @@ describe 'Edit Project Settings' do
it 'shows a successful notice when the project is updated' do it 'shows a successful notice when the project is updated' do
visit edit_project_path(project) visit edit_project_path(project)
fill_in 'project_name_edit', with: 'hello world' fill_in 'project_name_edit', with: 'hello world'
click_button 'Save changes' page.within('.general-settings') do
click_button 'Save changes'
end
expect(page).to have_content "Project 'hello world' was successfully updated." expect(page).to have_content "Project 'hello world' was successfully updated."
end end
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