Files
fizzy/test/models/comment_test.rb
T
2024-11-19 14:18:27 -06:00

24 lines
714 B
Ruby

require "test_helper"
class CommentTest < ActiveSupport::TestCase
setup do
Current.session = sessions(:david)
end
test "searchable by body" do
message = bubbles(:logo).capture Comment.new(body: "I'd prefer something more rustic")
assert_includes Comment.search("something rustic"), message.comment
end
test "updating bubble counter" do
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_difference %w[ bubbles(:logo).comments_count bubbles(:logo).activity_score ], -1 do
bubbles(:logo).messages.comments.last.destroy
end
end
end