mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
distributed memoizer added to ensure absolute duplicate posts don't get through
in case of an absolute dupe just return the memoized post This works around issues with wordpress being crazy
This commit is contained in:
@@ -282,6 +282,18 @@ describe PostsController do
|
||||
::JSON.parse(response.body).should be_present
|
||||
end
|
||||
|
||||
it 'protects against dupes' do
|
||||
# TODO we really should be using a mock redis here
|
||||
xhr :post, :create, {raw: 'this is a test post 123', title: 'this is a test title 123', wpid: 1}
|
||||
response.should be_success
|
||||
original = response.body
|
||||
|
||||
xhr :post, :create, {raw: 'this is a test post 123', title: 'this is a test title 123', wpid: 2}
|
||||
response.should be_success
|
||||
|
||||
response.body.should == original
|
||||
end
|
||||
|
||||
context "errors" do
|
||||
|
||||
let(:post_with_errors) { Fabricate.build(:post, user: user)}
|
||||
|
||||
Reference in New Issue
Block a user