2019-06-03 16:51:43 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-01 17:36:38 +02:00
|
|
|
require 'test_helper'
|
|
|
|
|
|
|
|
class OrganizationTest < ActiveSupport::TestCase
|
2019-06-03 16:51:43 +02:00
|
|
|
test 'an organization with name and address is valid' do
|
|
|
|
a = Address.new(address: '14 avenue du Maréchal Tartanpion, 12345 Saint-Robert-sur-Mer')
|
|
|
|
o = Organization.new(name: 'Menuiserie G. Dubois', address: a)
|
|
|
|
assert o.valid?
|
|
|
|
end
|
|
|
|
|
2016-08-03 17:25:00 +02:00
|
|
|
test 'organization must have a name' do
|
2019-06-03 16:51:43 +02:00
|
|
|
a = Address.new(address: '14 avenue du Maréchal Tartanpion, 12345 Saint-Robert-sur-Mer')
|
|
|
|
o = Organization.new(address: a)
|
2016-08-03 17:25:00 +02:00
|
|
|
assert o.invalid?
|
|
|
|
end
|
|
|
|
|
|
|
|
test 'organization must have an address' do
|
2019-06-03 16:51:43 +02:00
|
|
|
o = Organization.new(name: 'Menuiserie G. Dubois')
|
2016-08-03 17:25:00 +02:00
|
|
|
assert o.invalid?
|
|
|
|
end
|
2016-08-01 17:36:38 +02:00
|
|
|
end
|