1# frozen_string_literal: true
2
3require "test_helper"
4require "plan"
5
6class PlanTest < Minitest::Test
7 def test_for_non_existing
8 assert_raises do
9 Plan.for("non_existing")
10 end
11 end
12
13 def test_currency
14 assert_equal :USD, Plan.for("test_usd").currency
15 end
16
17 def test_merchant_account
18 assert_equal "merchant_usd", Plan.for("test_usd").merchant_account
19 end
20
21 def test_merchant_account_bad_currency
22 assert_raises do
23 Plan.for("test_bad_currency").merchant_account
24 end
25 end
26
27 def test_message_limit
28 assert_equal "unlimited messages", Plan.for("test_usd").message_limit.to_s
29 end
30
31 def test_minute_limit
32 assert_equal(
33 "$1.0440 of calling credit per calendar month (overage $0.0087 / minute)",
34 Plan.for("test_usd").minute_limit.to_s
35 )
36 end
37end