Move the unique post key storage code into the Post model

This commit is contained in:
Neil Lalonde
2013-09-09 16:17:31 -04:00
parent 48ee89940e
commit 78c15d5810
4 changed files with 14 additions and 6 deletions

View File

@ -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