tests: fix unit tests.

* Move old post archive tests to post version tests.

* Fix pool tests that assumed that multiple edits by the same user
  weren't merged.

* Fix references to `is_active` and `notes` on artist model.
This commit is contained in:
evazion
2020-03-21 16:47:50 -05:00
parent 94ae10b1a6
commit 3656063a6b
16 changed files with 134 additions and 279 deletions

View File

@@ -1770,13 +1770,15 @@ class PostTest < ActiveSupport::TestCase
assert_equal("", @child.fav_string)
assert_equal([], @child.favorites.pluck(:user_id))
assert_equal(3, @parent.fav_count)
assert_equal(3, @parent.favorites.count)
assert_equal(2, @parent.fav_count)
assert_equal(2, @parent.favorites.count)
assert_equal("fav:#{@user1.id} fav:#{@gold1.id}", @parent.fav_string)
assert_equal([@user1.id, @gold1.id], @parent.favorites.pluck(:user_id))
end
should "create a vote for each user who can vote" do
assert(@parent.votes.where(user: @gold1).exists?)
assert_equal(4, @parent.score)
assert_equal(1, @parent.score)
end
end
end