Files
fizzy/test/models/bubble_test.rb
T
2024-10-03 16:11:29 +01:00

18 lines
659 B
Ruby

require "test_helper"
class BubbleTest < ActiveSupport::TestCase
test "searchable by title" do
bubble = buckets(:writebook).bubbles.create! title: "Insufficient haggis", creator: users(:kevin)
assert_includes Bubble.search("haggis"), bubble
end
test "mentioning" do
bubble = buckets(:writebook).bubbles.create! title: "Insufficient haggis", creator: users(:kevin)
bubbles(:logo).comments.create! body: "I hate haggis", creator: users(:kevin)
bubbles(:text).comments.create! body: "I love haggis", creator: users(:kevin)
assert_equal [ bubble, bubbles(:logo), bubbles(:text) ].sort, Bubble.mentioning("haggis").sort
end
end