Commit 80bda874 authored by Phil Hughes's avatar Phil Hughes

Updated tests

parent 5c4416bb
...@@ -19,7 +19,7 @@ feature 'issue move to another project' do ...@@ -19,7 +19,7 @@ feature 'issue move to another project' do
end end
scenario 'moving issue to another project not allowed' do scenario 'moving issue to another project not allowed' do
expect(page).to have_no_select('move_to_project_id') expect(page).to have_no_selector('#move_to_project_id')
end end
end end
...@@ -37,7 +37,7 @@ feature 'issue move to another project' do ...@@ -37,7 +37,7 @@ feature 'issue move to another project' do
end end
scenario 'moving issue to another project' do scenario 'moving issue to another project' do
select(new_project.name_with_namespace, from: 'move_to_project_id') first('#move_to_project_id', visible: false).set(new_project.id)
click_button('Save changes') click_button('Save changes')
expect(current_url).to include project_path(new_project) expect(current_url).to include project_path(new_project)
...@@ -47,14 +47,19 @@ feature 'issue move to another project' do ...@@ -47,14 +47,19 @@ feature 'issue move to another project' do
expect(page).to have_content(issue.title) expect(page).to have_content(issue.title)
end end
context 'projects user does not have permission to move issue to exist' do context 'projects user does not have permission to move issue to exist', js: true do
let!(:private_project) { create(:project, :private) } let!(:private_project) { create(:project, :private) }
let(:another_project) { create(:project) } let(:another_project) { create(:project) }
background { another_project.team << [user, :guest] } background { another_project.team << [user, :guest] }
scenario 'browsing projects in projects select' do scenario 'browsing projects in projects select' do
options = [ '', 'No project', new_project.name_with_namespace ] options = [ '', 'No project', new_project.name_with_namespace ]
expect(page).to have_select('move_to_project_id', options: options) click_link 'Select project'
page.within '.select2-results' do
expect(page).to have_content 'No project'
expect(page).to have_content new_project.name_with_namespace
end
end end
end end
...@@ -65,7 +70,7 @@ feature 'issue move to another project' do ...@@ -65,7 +70,7 @@ feature 'issue move to another project' do
end end
scenario 'user wants to move issue that has already been moved' do scenario 'user wants to move issue that has already been moved' do
expect(page).to have_no_select('move_to_project_id') expect(page).to have_no_selector('#move_to_project_id')
end end
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