Commit 5b2b770e authored by Winnie Hellmann's avatar Winnie Hellmann

Make selector in multiple_boards_spec.rb more specific

parent 7d9f342e
...@@ -7,6 +7,8 @@ describe 'Multiple Issue Boards', :js do ...@@ -7,6 +7,8 @@ describe 'Multiple Issue Boards', :js do
let!(:board) { create(:board, project: project) } let!(:board) { create(:board, project: project) }
let!(:board2) { create(:board, project: project) } let!(:board2) { create(:board, project: project) }
dropdown_selector = '.js-boards-selector .dropdown-menu'
context 'with multiple issue boards enabled' do context 'with multiple issue boards enabled' do
context 'authorized user' do context 'authorized user' do
before do before do
...@@ -27,7 +29,7 @@ describe 'Multiple Issue Boards', :js do ...@@ -27,7 +29,7 @@ describe 'Multiple Issue Boards', :js do
it 'shows a list of boards' do it 'shows a list of boards' do
click_button board.name click_button board.name
page.within('.dropdown-menu') do page.within(dropdown_selector) do
expect(page).to have_content(board.name) expect(page).to have_content(board.name)
expect(page).to have_content(board2.name) expect(page).to have_content(board2.name)
end end
...@@ -36,7 +38,7 @@ describe 'Multiple Issue Boards', :js do ...@@ -36,7 +38,7 @@ describe 'Multiple Issue Boards', :js do
it 'switches current board' do it 'switches current board' do
click_button board.name click_button board.name
page.within('.dropdown-menu') do page.within(dropdown_selector) do
click_link board2.name click_link board2.name
end end
...@@ -50,7 +52,7 @@ describe 'Multiple Issue Boards', :js do ...@@ -50,7 +52,7 @@ describe 'Multiple Issue Boards', :js do
it 'creates new board without detailed configuration' do it 'creates new board without detailed configuration' do
click_button board.name click_button board.name
page.within('.dropdown-menu') do page.within(dropdown_selector) do
click_button 'Create new board' click_button 'Create new board'
end end
...@@ -66,7 +68,7 @@ describe 'Multiple Issue Boards', :js do ...@@ -66,7 +68,7 @@ describe 'Multiple Issue Boards', :js do
wait_for_requests wait_for_requests
page.within('.dropdown-menu') do page.within(dropdown_selector) do
click_button 'Delete board' click_button 'Delete board'
end end
...@@ -74,7 +76,7 @@ describe 'Multiple Issue Boards', :js do ...@@ -74,7 +76,7 @@ describe 'Multiple Issue Boards', :js do
click_button 'Delete' click_button 'Delete'
click_button board2.name click_button board2.name
page.within('.dropdown-menu') do page.within(dropdown_selector) do
expect(page).not_to have_content(board.name) expect(page).not_to have_content(board.name)
expect(page).to have_content(board2.name) expect(page).to have_content(board2.name)
end end
...@@ -83,7 +85,7 @@ describe 'Multiple Issue Boards', :js do ...@@ -83,7 +85,7 @@ describe 'Multiple Issue Boards', :js do
it 'adds a list to the none default board' do it 'adds a list to the none default board' do
click_button board.name click_button board.name
page.within('.dropdown-menu') do page.within(dropdown_selector) do
click_link board2.name click_link board2.name
end end
...@@ -107,7 +109,7 @@ describe 'Multiple Issue Boards', :js do ...@@ -107,7 +109,7 @@ describe 'Multiple Issue Boards', :js do
click_button board2.name click_button board2.name
page.within('.dropdown-menu') do page.within(dropdown_selector) do
click_link board.name click_link board.name
end end
...@@ -136,7 +138,7 @@ describe 'Multiple Issue Boards', :js do ...@@ -136,7 +138,7 @@ describe 'Multiple Issue Boards', :js do
it 'does not show action links' do it 'does not show action links' do
click_button board.name click_button board.name
page.within('.dropdown-menu') do page.within(dropdown_selector) do
expect(page).not_to have_content('Create new board') expect(page).not_to have_content('Create new board')
expect(page).not_to have_content('Delete board') expect(page).not_to have_content('Delete board')
end end
...@@ -158,7 +160,7 @@ describe 'Multiple Issue Boards', :js do ...@@ -158,7 +160,7 @@ describe 'Multiple Issue Boards', :js do
click_button board.name click_button board.name
page.within('.dropdown-menu') do page.within(dropdown_selector) do
expect(page).not_to have_content('Create new board') expect(page).not_to have_content('Create new board')
expect(page).not_to have_content('Delete board') expect(page).not_to have_content('Delete board')
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