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