mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
Rename ninja_edit_window
to editing_grace_period
:'(
This commit is contained in:
@ -451,7 +451,7 @@ describe Category do
|
||||
before do
|
||||
post = create_post(user: @category.user, category: @category.name)
|
||||
|
||||
SiteSetting.stubs(:ninja_edit_window).returns(1.minute.to_i)
|
||||
SiteSetting.stubs(:editing_grace_period).returns(1.minute.to_i)
|
||||
post.revise(post.user, { raw: 'updated body' }, revised_at: post.updated_at + 2.minutes)
|
||||
|
||||
Category.update_stats
|
||||
|
@ -481,7 +481,7 @@ describe Post do
|
||||
|
||||
describe 'ninja editing & edit windows' do
|
||||
|
||||
before { SiteSetting.stubs(:ninja_edit_window).returns(1.minute.to_i) }
|
||||
before { SiteSetting.stubs(:editing_grace_period).returns(1.minute.to_i) }
|
||||
|
||||
it 'works' do
|
||||
revised_at = post.updated_at + 2.minutes
|
||||
@ -548,7 +548,7 @@ describe Post do
|
||||
context 'second poster posts again quickly' do
|
||||
|
||||
it 'is a ninja edit, because the second poster posted again quickly' do
|
||||
SiteSetting.expects(:ninja_edit_window).returns(1.minute.to_i)
|
||||
SiteSetting.expects(:editing_grace_period).returns(1.minute.to_i)
|
||||
post.revise(changed_by, { raw: 'yet another updated body' }, revised_at: post.updated_at + 10.seconds)
|
||||
post.reload
|
||||
|
||||
|
@ -464,7 +464,7 @@ describe Topic do
|
||||
|
||||
it "doesn't bump the topic on an edit to the last post that doesn't result in a new version" do
|
||||
expect {
|
||||
SiteSetting.expects(:ninja_edit_window).returns(5.minutes)
|
||||
SiteSetting.expects(:editing_grace_period).returns(5.minutes)
|
||||
@last_post.revise(@last_post.user, { raw: 'updated contents' }, revised_at: @last_post.created_at + 10.seconds)
|
||||
@topic.reload
|
||||
}.not_to change(@topic, :bumped_at)
|
||||
|
Reference in New Issue
Block a user