pull/4591/head
Oliver Günther 8 years ago
parent 4376f91bbd
commit 287613d684
  1. 1
      app/contracts/work_packages/update_contract.rb
  2. 9
      spec/contracts/work_packages/update_contract_spec.rb
  3. 8
      spec/features/work_packages/details/details_relations_spec.rb

@ -47,7 +47,6 @@ module WorkPackages
def user_allowed_to_edit
with_unchanged_project_id do
next if @can.allowed?(model, :edit)
next user_allowed_to_change_parent if @can.allowed?(model, :manage_subtasks)

@ -133,7 +133,10 @@ describe WorkPackages::UpdateContract do
context 'if the user has edit and subtasks permissions' do
let(:permissions) { [:edit_work_packages, :view_work_packages, :manage_subtasks] }
it('is valid') { expect(contract.errors).to be_empty }
it('is valid') do
expect(contract.errors).to be_empty
end
describe 'invalid lock version' do
before do
@ -154,7 +157,9 @@ describe WorkPackages::UpdateContract do
context 'with manage_subtasks permission' do
let(:permissions) { [:view_work_packages, :manage_subtasks] }
it('is valid') { expect(contract.errors).to be_empty }
it('is valid') do
expect(contract.errors).to be_empty
end
describe 'changing more than the parent_id' do
before do

@ -51,9 +51,7 @@ describe 'Work package relations tab', js: true, selenium: true do
end
context 'with insufficient permissions' do
let(:permissions) {
[ :view_work_packages, :edit_work_packages ]
}
let(:permissions) { %i(view_work_packages edit_work_packages) }
it 'does not allow editing the parent' do
within '.relation.parent' do
@ -68,9 +66,7 @@ describe 'Work package relations tab', js: true, selenium: true do
end
context 'with permissions' do
let(:permissions) {
[ :view_work_packages, :manage_subtasks ]
}
let(:permissions) { %i(view_work_packages manage_subtasks) }
it 'shows the parent relationship expanded' do
within '.relation.parent' do

Loading…
Cancel
Save