Files
fizzy/test/controllers/bubbles/pops_controller_test.rb
T
2024-10-09 12:48:21 -04:00

28 lines
661 B
Ruby

require "test_helper"
class Bubbles::PopsControllerTest < ActionDispatch::IntegrationTest
setup do
sign_in_as :kevin
end
test "create" do
bubble = bubbles(:logo)
assert_changes -> { bubble.reload.popped? }, from: false, to: true do
post bucket_bubble_pop_url(bubble.bucket, bubble)
end
assert_redirected_to bucket_bubble_url(bubble.bucket, bubble)
end
test "destroy" do
bubble = bubbles(:shipping)
assert_changes -> { bubble.reload.popped? }, from: true, to: false do
delete bucket_bubble_pop_url(bubble.bucket, bubble)
end
assert_redirected_to bucket_bubble_url(bubble.bucket, bubble)
end
end