FIX: disagree flag should unhide hidden post

This commit is contained in:
Régis Hanol
2014-08-11 10:48:00 +02:00
parent f897c89d48
commit e64d3b8a42
7 changed files with 27 additions and 23 deletions

View File

@ -847,4 +847,21 @@ describe Post do
end
end
describe ".unhide!" do
before { SiteSetting.stubs(:unique_posts_mins).returns(5) }
it "will unhide the post" do
post = create_post(user: Fabricate(:newuser))
post.update_columns(hidden: true, hidden_at: Time.now, hidden_reason_id: 1)
post.reload
post.hidden.should == true
post.unhide!
post.reload
post.hidden.should == false
end
end
end