Add specs for Fix forum topics are not copied on project copy

pull/1700/head
Ion Biziiac 10 years ago
parent 5d1c2e9ee2
commit 1c1e69b636
  1. 29
      spec/models/project/copy_spec.rb

@ -338,16 +338,33 @@ describe Project::Copy do
end
describe :copy_boards do
before do
FactoryGirl.create(:board, project: project)
let(:board) { FactoryGirl.create(:board, project: project) }
copy.send(:copy_boards, project)
copy.save
context "boards are copied" do
before do
copy.send(:copy_boards, project)
copy.save
end
subject { copy.boards.count }
it { should == project.boards.count }
end
subject { copy.boards.count }
context "board topics are copied" do
before do
topic = FactoryGirl.create(:message, board: board)
message = FactoryGirl.create(:message, board: board, parent_id: topic.id)
copy.send(:copy_boards, project)
copy.save
end
it { should == project.boards.count }
it "should copy topics without replies" do
expect(copy.boards.first.topics.count).to eq(project.boards.first.topics.count)
expect(copy.boards.first.messages.count).to_not eq(project.boards.first.messages.count)
end
end
end
describe :copy_versions do

Loading…
Cancel
Save