|
|
@ -39,30 +39,18 @@ describe WorkPackage do |
|
|
|
relation_dup_2_org |
|
|
|
relation_dup_2_org |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
shared_examples_for "work package closed" do |
|
|
|
describe "closes duplicates" do |
|
|
|
before { work_package.reload } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subject { work_package.closed? } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it { should be_true } |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe "duplicates are closed" do |
|
|
|
|
|
|
|
before do |
|
|
|
before do |
|
|
|
original.status = closed_state |
|
|
|
original.status = closed_state |
|
|
|
original.save! |
|
|
|
original.save! |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "first duplicate closed" do |
|
|
|
|
|
|
|
let(:work_package) { dup_1 } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it_behaves_like "work package closed" |
|
|
|
dup_1.reload |
|
|
|
|
|
|
|
dup_2.reload |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "second duplicate closed" do |
|
|
|
it "duplicates are closed" do |
|
|
|
let(:work_package) { dup_2 } |
|
|
|
dup_1.closed?.should be_true |
|
|
|
|
|
|
|
dup_2.closed?.should be_true |
|
|
|
it_behaves_like "work package closed" |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|