Files
fizzy/saas/test/models/plan_test.rb
T
2025-12-18 10:05:13 +01:00

19 lines
458 B
Ruby

require "test_helper"
class PlanTest < ActiveSupport::TestCase
test "free plan is free" do
assert Plan[:free_v1].free?
end
test "monthly plan is not free" do
assert_not Plan[:monthly_v1].free?
end
test "find plan by its price id" do
Plan.paid.stubs(:stripe_price_id).returns("price_monthly_v1")
assert_equal Plan.paid, Plan.find_by_price_id("price_monthly_v1")
assert_nil Plan.find_by_price_id("unknown_price_id")
end
end