Files
fizzy/test/controllers/bubbles/boosts_controller_test.rb
T
David Heinemeier Hansson c06802856e Move boosts under bubbles
But also remove the need for a bucket nesting
2025-04-06 21:04:28 +02:00

28 lines
804 B
Ruby

require "test_helper"
class Bubbles::BoostsControllerTest < ActionDispatch::IntegrationTest
setup do
sign_in_as :kevin
end
test "create" do
boost_count = bubbles(:logo).boosts_count
assert_difference "bubbles(:logo).reload.boosts_count", +1 do
post bubble_boosts_path(bubbles(:logo), params: { boost_count: boost_count }, format: :turbo_stream)
end
assert_turbo_stream action: :update, target: dom_id(bubbles(:logo), :boosts)
end
test "create with value" do
boost_count = 10
assert_changes "bubbles(:logo).reload.boosts_count", to: boost_count do
post bubble_boosts_path(bubbles(:logo), params: { boost_count: boost_count }, format: :turbo_stream)
end
assert_turbo_stream action: :update, target: dom_id(bubbles(:logo), :boosts)
end
end