post disapprovals: refactor disapproval reasons.

* Factor out reasons into a constant
* Change column default and eliminate unused `legacy` reason.
This commit is contained in:
evazion
2020-04-03 15:57:29 -05:00
parent 3e792019e5
commit fde42022c0
9 changed files with 20 additions and 15 deletions

View File

@@ -26,7 +26,7 @@ class PostDisapprovalTest < ActiveSupport::TestCase
context "made by alice" do
setup do
@disapproval = PostDisapproval.create(:user => @alice, :post => @post_1)
@disapproval = create(:post_disapproval, user: @alice, post: @post_1)
end
context "when the current user is alice" do
@@ -57,9 +57,7 @@ class PostDisapprovalTest < ActiveSupport::TestCase
setup do
@post = FactoryBot.create(:post)
@user = FactoryBot.create(:user)
travel_to(2.months.ago) do
@disapproval = PostDisapproval.create(:user => @user, :post => @post)
end
@disapproval = create(:post_disapproval, user: @user, post: @post, created_at: 2.months.ago)
end
should "be pruned" do