~singpolyma/sgx-jmp

sgx-jmp/test/test_plan.rb -rw-r--r-- 765 bytes
cd3111beStephen Paul Weber Merge branch 'snikket' 18 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# frozen_string_literal: true

require "test_helper"
require "plan"

class PlanTest < Minitest::Test
	def test_for_non_existing
		assert_raises do
			Plan.for("non_existing")
		end
	end

	def test_currency
		assert_equal :USD, Plan.for("test_usd").currency
	end

	def test_merchant_account
		assert_equal "merchant_usd", Plan.for("test_usd").merchant_account
	end

	def test_merchant_account_bad_currency
		assert_raises do
			Plan.for("test_bad_currency").merchant_account
		end
	end

	def test_message_limit
		assert_equal "unlimited messages", Plan.for("test_usd").message_limit.to_s
	end

	def test_minute_limit
		assert_equal(
			"$1.0440 of calling credit per calendar month (overage $0.0087 / minute)",
			Plan.for("test_usd").minute_limit.to_s
		)
	end
end