1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00
fab-manager/test/models/price_category_test.rb

16 lines
465 B
Ruby
Raw Normal View History

2016-08-24 12:30:48 +02:00
require 'test_helper'
class PriceCategoryTest < ActiveSupport::TestCase
test 'price category name must be unique' do
2020-03-30 10:59:11 +02:00
pc = PriceCategory.new(name: '- DE 25 ANS', conditions: 'Tarif préférentiel pour les jeunes')
assert pc.invalid?
assert pc.errors[:name].present?
end
test 'associated price category cannot be destroyed' do
pc = PriceCategory.find(1)
assert_not pc.safe_destroy
assert_not_empty PriceCategory.where(id: 1)
end
2016-08-24 12:30:48 +02:00
end