The test for event creation is better populated
This commit is contained in:
parent
5b009c6980
commit
17fc14deb7
@ -57,7 +57,9 @@ class EventsControllerTest < ActionController::TestCase
|
|||||||
|
|
||||||
test 'should not create event' do
|
test 'should not create event' do
|
||||||
assert_no_difference 'Event.count' do
|
assert_no_difference 'Event.count' do
|
||||||
post :create, event: { title: @event.title }
|
post :create, event: {
|
||||||
|
title: @event.title, start_time: @event.start_time, tags: @event.tags
|
||||||
|
}
|
||||||
|
|
||||||
assert_not_empty assigns(:event).errors.messages
|
assert_not_empty assigns(:event).errors.messages
|
||||||
end
|
end
|
||||||
@ -100,9 +102,7 @@ class EventsControllerTest < ActionController::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
test 'should not update event' do
|
test 'should not update event' do
|
||||||
patch :update, id: @event, secret: @event.secret, event: {
|
patch :update, id: @event, secret: @event.secret, event: { title: nil }
|
||||||
title: nil
|
|
||||||
}
|
|
||||||
|
|
||||||
assert_not_empty assigns(:event).errors.messages
|
assert_not_empty assigns(:event).errors.messages
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user