Files
fizzy/test/controllers/cards/watches_controller_test.rb
T
2025-10-06 10:48:31 +02:00

24 lines
556 B
Ruby

require "test_helper"
class Cards::WatchesControllerTest < ActionDispatch::IntegrationTest
setup do
sign_in_as :kevin
end
test "create" do
cards(:logo).unwatch_by users(:kevin)
assert_changes -> { cards(:logo).watched_by?(users(:kevin)) }, from: false, to: true do
post card_watch_path(cards(:logo))
end
end
test "destroy" do
cards(:logo).watch_by users(:kevin)
assert_changes -> { cards(:logo).watched_by?(users(:kevin)) }, from: true, to: false do
delete card_watch_path(cards(:logo))
end
end
end