Commit 80f4fa87 authored by Simon Knox's avatar Simon Knox

move edit test

parent 32ac090e
......@@ -54,9 +54,7 @@ body.modal-open {
}
.modal.popup-dialog {
display: flex;
justify-content: center;
align-items: center;
display: block;
@media (min-width: $screen-md-min) {
.modal-dialog {
......
require 'rails_helper'
describe 'issue board config', :js do
let(:user) { create(:user) }
let(:project) { create(:project, :public) }
let!(:planning) { create(:label, project: project, name: 'Planning') }
let!(:board) { create(:board, project: project) }
before do
stub_licensed_features(multiple_issue_boards: true)
end
context 'user with edit permissions' do
before do
project.team << [user, :master]
login_as(user)
visit project_boards_path(project)
wait_for_requests
end
it 'edits board' do
click_button 'Edit board'
page.within('.popup-dialog') do
fill_in 'board-new-name', with: 'Testing'
click_button 'Save'
end
expect('.dropdown-menu-toggle', text: 'Testing').to exist
end
end
context 'user without edit permissions' do
before do
visit project_boards_path(project)
wait_for_requests
end
it 'shows board scope' do
click_button 'View scope'
page.within('.popup-dialog') do
expect(page).not_to have_link('Edit')
expect(page).not_to have_button('Edit')
expect(page).not_to have_button('Save')
end
end
end
end
\ No newline at end of file
......@@ -67,24 +67,6 @@ describe 'Multiple Issue Boards', :js do
expect(page).to have_button('This is a new board')
end
it 'edits board name' do
click_button board.name
page.within('.dropdown-menu') do
click_link 'Edit board name'
fill_in 'board-new-name', with: 'Testing'
click_button 'Save'
end
wait_for_requests
page.within('.dropdown-menu') do
expect(page).to have_content('Testing')
end
end
it 'deletes board' do
click_button board.name
......@@ -156,7 +138,6 @@ describe 'Multiple Issue Boards', :js do
page.within('.dropdown-menu') do
expect(page).not_to have_content('Create new board')
expect(page).not_to have_content('Edit board name')
expect(page).not_to have_content('Delete board')
end
end
......@@ -178,7 +159,7 @@ describe 'Multiple Issue Boards', :js do
click_button board.name
page.within('.dropdown-menu') do
expect(page).to have_content('Edit board name')
expect(page).to have_content('Edit board')
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