|
|
|
@ -40,7 +40,7 @@ describe ::API::V3::WorkPackages::Schema::SpecificWorkPackageSchema do |
|
|
|
|
double('current user').tap do |u| |
|
|
|
|
allow(u) |
|
|
|
|
.to receive(:allowed_to?) |
|
|
|
|
.and_return(true) |
|
|
|
|
.and_return(true) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
@ -92,9 +92,11 @@ describe ::API::V3::WorkPackages::Schema::SpecificWorkPackageSchema do |
|
|
|
|
.to receive(:readonly_status?) |
|
|
|
|
.and_return(false) |
|
|
|
|
|
|
|
|
|
is_expected.to_not be_readonly |
|
|
|
|
expect(subject.writable?(:status)).to be_truthy |
|
|
|
|
expect(subject.writable?(:subject)).to be_truthy |
|
|
|
|
# As the writability is memoized we need to have a new schema |
|
|
|
|
new_schema = described_class.new(work_package: work_package) |
|
|
|
|
expect(new_schema).to_not be_readonly |
|
|
|
|
expect(new_schema.writable?(:status)).to be_truthy |
|
|
|
|
expect(new_schema.writable?(:subject)).to be_truthy |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|