|
|
@ -117,8 +117,12 @@ describe ::API::V3::WorkPackages::Schema::WorkPackageSchema do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
describe 'utility methods' do |
|
|
|
describe 'utility methods' do |
|
|
|
it 'detects leaf' do |
|
|
|
context 'leaf' do |
|
|
|
expect(subject.nil_or_leaf? work_package).to be true |
|
|
|
let(:work_package) { FactoryGirl.create(:work_package) } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it 'detects leaf' do |
|
|
|
|
|
|
|
expect(subject.nil_or_leaf? work_package).to be true |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context 'parent' do |
|
|
|
context 'parent' do |
|
|
@ -161,7 +165,7 @@ describe ::API::V3::WorkPackages::Schema::WorkPackageSchema do |
|
|
|
|
|
|
|
|
|
|
|
describe 'leaf or nil' do |
|
|
|
describe 'leaf or nil' do |
|
|
|
it 'evaluates nil work package as nil' do |
|
|
|
it 'evaluates nil work package as nil' do |
|
|
|
expect(subject.nil_or_leaf? nil).to be_true |
|
|
|
expect(subject.nil_or_leaf? nil).to be true |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|