mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-20 14:54:15 +01:00
improved cash coupon test
This commit is contained in:
parent
76c1412177
commit
c582d4665d
@ -24,9 +24,11 @@ class CouponTest < ActiveSupport::TestCase
|
|||||||
assert c.invalid?
|
assert c.invalid?
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'coupon with cash amount has amount_off type' do
|
test 'valid coupon with cash amount' do
|
||||||
c = Coupon.new({name: 'Essential Box', code: 'KWXX2M', amount_off: 2000, validity_per_user: 'once', max_usages: 1})
|
c = Coupon.new({name: 'Essential Box', code: 'KWXX2M', amount_off: 2000, validity_per_user: 'once', max_usages: 1, active: true})
|
||||||
assert_equal 'amount_off', c.type
|
assert c.valid?
|
||||||
|
assert_equal 'active', c.status, 'Invalid coupon status'
|
||||||
|
assert_equal 'amount_off', c.type, 'Invalid coupon type'
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'coupon with cash amount cannot be used with cheaper cart' do
|
test 'coupon with cash amount cannot be used with cheaper cart' do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user