2023-03-22 17:30:37 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-06-28 15:56:37 +02:00
|
|
|
require 'test_helper'
|
|
|
|
|
|
|
|
class EventTest < ActiveSupport::TestCase
|
|
|
|
test 'event must have a category' do
|
|
|
|
e = Event.first
|
2016-07-25 16:16:25 +02:00
|
|
|
assert_not_nil e.category
|
2016-06-28 15:56:37 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
test 'event must have a theme' do
|
|
|
|
e = Event.find(1)
|
|
|
|
assert_not_empty e.themes
|
|
|
|
end
|
|
|
|
|
|
|
|
test 'event must have an age range' do
|
|
|
|
e = Event.find(2)
|
2016-06-29 11:23:21 +02:00
|
|
|
assert_not_nil e.age_range.name
|
2016-06-28 15:56:37 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
test 'event must not have any age range' do
|
|
|
|
e = Event.find(3)
|
|
|
|
assert_nil e.age_range
|
|
|
|
end
|
|
|
|
end
|