Commit b9867966 authored by charlieablett's avatar charlieablett

Move divergent ee code from boards_spec

parent 5840c36a
...@@ -6,6 +6,8 @@ describe 'issue boards', :js do ...@@ -6,6 +6,8 @@ describe 'issue boards', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
let!(:board) { create(:board, project: project) } let!(:board) { create(:board, project: project) }
let(:milestone) { create(:milestone, title: "v2.2", project: project) }
let!(:board_with_milestone) { create(:board, project: project, milestone: milestone) }
context 'issue board focus mode' do context 'issue board focus mode' do
before do before do
...@@ -141,6 +143,22 @@ describe 'issue boards', :js do ...@@ -141,6 +143,22 @@ describe 'issue boards', :js do
end end
end end
context 'locked milestone' do
before do
visit project_board_path(project, board_with_milestone)
wait_for_requests
end
it 'should not have remove button' do
expect(page).to have_selector('.js-visual-token .remove-token', count: 0)
end
it 'should not be able to be backspaced' do
find('.input-token .filtered-search').native.send_key(:backspace)
expect(page).to have_selector('.js-visual-token', count: 1)
end
end
def badge(list) def badge(list)
find(".board[data-id='#{list.id}'] .issue-count-badge") find(".board[data-id='#{list.id}'] .issue-count-badge")
end end
......
...@@ -6,9 +6,7 @@ describe 'Issue Boards', :js do ...@@ -6,9 +6,7 @@ describe 'Issue Boards', :js do
let(:group) { create(:group, :nested) } let(:group) { create(:group, :nested) }
let(:project) { create(:project, :public, namespace: group) } let(:project) { create(:project, :public, namespace: group) }
let(:milestone) { create(:milestone, title: "v2.2", project: project) } let(:board) { create(:board, project: project) }
let!(:board) { create(:board, project: project) }
let!(:board_with_milestone) { create(:board, project: project, milestone: milestone) }
let(:user) { create(:user) } let(:user) { create(:user) }
let!(:user2) { create(:user) } let!(:user2) { create(:user) }
...@@ -23,7 +21,7 @@ describe 'Issue Boards', :js do ...@@ -23,7 +21,7 @@ describe 'Issue Boards', :js do
context 'no lists' do context 'no lists' do
before do before do
visit project_boards_path(project) visit project_board_path(project, board)
wait_for_requests wait_for_requests
expect(page).to have_selector('.board', count: 3) expect(page).to have_selector('.board', count: 3)
end end
...@@ -89,7 +87,7 @@ describe 'Issue Boards', :js do ...@@ -89,7 +87,7 @@ describe 'Issue Boards', :js do
let!(:issue10) { create(:labeled_issue, project: project, title: 'issue +', description: 'A+ great issue', labels: [a_plus]) } let!(:issue10) { create(:labeled_issue, project: project, title: 'issue +', description: 'A+ great issue', labels: [a_plus]) }
before do before do
visit project_boards_path(project) visit project_board_path(project, board)
wait_for_requests wait_for_requests
...@@ -168,7 +166,7 @@ describe 'Issue Boards', :js do ...@@ -168,7 +166,7 @@ describe 'Issue Boards', :js do
create(:labeled_issue, project: project, labels: [planning]) create(:labeled_issue, project: project, labels: [planning])
end end
visit project_boards_path(project) visit project_board_path(project, board)
wait_for_requests wait_for_requests
page.within(find('.board:nth-child(2)')) do page.within(find('.board:nth-child(2)')) do
...@@ -528,25 +526,9 @@ describe 'Issue Boards', :js do ...@@ -528,25 +526,9 @@ describe 'Issue Boards', :js do
end end
end end
context 'locked milestone' do
before do
visit project_board_path(project, board_with_milestone)
wait_for_requests
end
it 'should not have remove button' do
expect(page).to have_selector('.js-visual-token .remove-token', count: 0)
end
it 'should not be able to be backspaced' do
find('.input-token .filtered-search').native.send_key(:backspace)
expect(page).to have_selector('.js-visual-token', count: 1)
end
end
context 'keyboard shortcuts' do context 'keyboard shortcuts' do
before do before do
visit project_boards_path(project) visit project_board_path(project, board)
wait_for_requests wait_for_requests
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