mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
Move the unique post key storage code into the Post model
This commit is contained in:
parent
48ee89940e
commit
78c15d5810
4 changed files with 14 additions and 6 deletions
|
@ -38,7 +38,7 @@ describe Validators::PostValidator do
|
|||
|
||||
context "post is unique" do
|
||||
before do
|
||||
$redis.stubs(:exists).with(post.unique_post_key).returns(nil)
|
||||
post.stubs(:matches_recent_post?).returns(false)
|
||||
end
|
||||
|
||||
it "should not add an error" do
|
||||
|
@ -49,7 +49,7 @@ describe Validators::PostValidator do
|
|||
|
||||
context "post is not unique" do
|
||||
before do
|
||||
$redis.stubs(:exists).with(post.unique_post_key).returns('1')
|
||||
post.stubs(:matches_recent_post?).returns(true)
|
||||
end
|
||||
|
||||
it "should add an error" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue