mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:03:34 +08:00
FIX: disagree flag should unhide hidden post
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user