Clean up activity score tests
This commit is contained in:
@@ -14,10 +14,8 @@ class BubbleTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
test "boosting" do
|
||||
assert_changes "bubbles(:logo).activity_score", +1 do
|
||||
assert_difference %w[ bubbles(:logo).boost_count Event.count ], +1 do
|
||||
bubbles(:logo).boost!
|
||||
end
|
||||
assert_difference %w[ bubbles(:logo).boost_count bubbles(:logo).activity_score Event.count ], +1 do
|
||||
bubbles(:logo).boost!
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -12,16 +12,12 @@ class CommentTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
test "updating bubble counter" do
|
||||
assert_changes "bubbles(:logo).activity_score" do
|
||||
assert_difference "bubbles(:logo).comments_count", 1 do
|
||||
bubbles(:logo).capture Comment.new(body: "I'd prefer something more rustic")
|
||||
end
|
||||
assert_difference %w[ bubbles(:logo).comments_count bubbles(:logo).activity_score ], +1 do
|
||||
bubbles(:logo).capture Comment.new(body: "I'd prefer something more rustic")
|
||||
end
|
||||
|
||||
assert_changes "bubbles(:logo).activity_score" do
|
||||
assert_difference "bubbles(:logo).comments_count", -1 do
|
||||
bubbles(:logo).messages.comments.last.destroy
|
||||
end
|
||||
assert_difference %w[ bubbles(:logo).comments_count bubbles(:logo).activity_score ], -1 do
|
||||
bubbles(:logo).messages.comments.last.destroy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user