pull/581/head
Hagen Schink 11 years ago
parent cfc9c121c7
commit 9f6be8f878
  1. 27
      spec/models/work_package/work_package_acts_as_journalized_spec.rb

@ -62,30 +62,31 @@ describe WorkPackage do
it { Journal.all.count.should eq(1) }
end
context "line endings changed" do
context "different newlines" do
let(:description) { "Description\n\nwith newlines\n\nembedded" }
let(:work_package_1) { FactoryGirl.create(:work_package,
project_id: project.id,
type: type,
description: description,
priority: priority) }
let!(:work_package_1) { FactoryGirl.create(:work_package,
project_id: project.id,
type: type,
description: description,
priority: priority) }
before do
work_package_1
work_package_1.description = "Description\r\n\r\nwith newlines\r\n\r\nembedded"
work_package_1.save!
end
describe "does not change journal count" do
subject { Journal.count }
it { should eq(2) } # work_package + work_package_1
it { expect(JournalManager.changed? work_package_1).to be_false }
end
describe "does not change work package description" do
subject { work_package_1.description }
before do
work_package_1.subject = "changed"
work_package_1.save!
end
subject { work_package_1.journals.last.data.description }
it { should eq(description) }
it { expect(subject).to eq(description) }
end
end

Loading…
Cancel
Save