Nicer API

This commit is contained in:
David Heinemeier Hansson
2025-04-06 13:26:10 +02:00
parent cdd78b41ee
commit a58fcd3123
4 changed files with 13 additions and 20 deletions
@@ -11,14 +11,14 @@ class Bubbles::TaggingsControllerTest < ActionDispatch::IntegrationTest
end
test "toggle tag on" do
assert_changes "bubbles(:logo).tagged_with?(tags(:mobile).title)", from: false, to: true do
assert_changes "bubbles(:logo).tagged_with?(tags(:mobile))", from: false, to: true do
post bubble_taggings_url(bubbles(:logo)), params: { tag_title: tags(:mobile).title }, as: :turbo_stream
end
assert_response :success
end
test "toggle tag off" do
assert_changes "bubbles(:logo).tagged_with?(tags(:web).title)", from: true, to: false do
assert_changes "bubbles(:logo).tagged_with?(tags(:web))", from: true, to: false do
post bubble_taggings_url(bubbles(:logo)), params: { tag_title: tags(:web).title }, as: :turbo_stream
end
assert_response :success