mirror of
https://github.com/discourse/discourse.git
synced 2025-03-23 16:25:49 +08:00
collapse tests to improve perf of suite
This commit is contained in:
parent
6f88fc3aa3
commit
fbbe9f7a19
@ -14,40 +14,25 @@ describe PostRevisor do
|
|||||||
subject { described_class.new(post) }
|
subject { described_class.new(post) }
|
||||||
|
|
||||||
describe 'with the same body' do
|
describe 'with the same body' do
|
||||||
|
|
||||||
it 'returns false' do
|
|
||||||
subject.revise!(post.user, post.raw).should be_false
|
|
||||||
end
|
|
||||||
|
|
||||||
it "doesn't change version" do
|
it "doesn't change version" do
|
||||||
lambda { subject.revise!(post.user, post.raw); post.reload }.should_not change(post, :version)
|
lambda {
|
||||||
|
subject.revise!(post.user, post.raw).should be_false
|
||||||
|
post.reload
|
||||||
|
}.should_not change(post, :version)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'ninja editing' do
|
describe 'ninja editing' do
|
||||||
before do
|
it 'correctly applies edits' do
|
||||||
SiteSetting.expects(:ninja_edit_window).returns(1.minute.to_i)
|
SiteSetting.ninja_edit_window = 1.minute.to_i
|
||||||
subject.revise!(post.user, 'updated body', revised_at: post.updated_at + 10.seconds)
|
subject.revise!(post.user, 'updated body', revised_at: post.updated_at + 10.seconds)
|
||||||
post.reload
|
post.reload
|
||||||
end
|
|
||||||
|
|
||||||
it 'does not update version' do
|
|
||||||
post.version.should == 1
|
post.version.should == 1
|
||||||
end
|
|
||||||
|
|
||||||
it 'does not create a new revision' do
|
|
||||||
post.revisions.size.should == 0
|
post.revisions.size.should == 0
|
||||||
end
|
|
||||||
|
|
||||||
it "doesn't change the last_version_at" do
|
|
||||||
post.last_version_at.should == first_version_at
|
post.last_version_at.should == first_version_at
|
||||||
end
|
|
||||||
|
|
||||||
it "doesn't update a category" do
|
|
||||||
subject.category_changed.should be_blank
|
subject.category_changed.should be_blank
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'revision much later' do
|
describe 'revision much later' do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user