Files
fizzy/test/controllers/bubbles/pops_controller_test.rb
T
Jorge Manrubia f960b3fc83 Add tests
2025-04-04 13:35:54 +02:00

30 lines
739 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, reason: "Scope too big")
end
assert_equal "Scope too big", bubble.pop.reason
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