Add tests

This commit is contained in:
Jorge Manrubia
2025-04-04 13:34:32 +02:00
parent de8a1120eb
commit f960b3fc83
2 changed files with 7 additions and 4 deletions
@@ -9,9 +9,11 @@ class Bubbles::PopsControllerTest < ActionDispatch::IntegrationTest
bubble = bubbles(:logo)
assert_changes -> { bubble.reload.popped? }, from: false, to: true do
post bucket_bubble_pop_url(bubble.bucket, bubble)
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
+4 -3
View File
@@ -1,7 +1,8 @@
require "test_helper"
class PopTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
test "default to the fallback reason if no reason is given" do
assert_equal "Not now", Pop.new(reason: "Not now").reason
assert_equal Account::PopReasons::FALLBACK_LABEL, Pop.new.reason
end
end