Add tests
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user