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
|
||||
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
|
||||
end
|
||||
@ -100,9 +102,7 @@ class EventsControllerTest < ActionController::TestCase
|
||||
end
|
||||
|
||||
test 'should not update event' do
|
||||
patch :update, id: @event, secret: @event.secret, event: {
|
||||
title: nil
|
||||
}
|
||||
patch :update, id: @event, secret: @event.secret, event: { title: nil }
|
||||
|
||||
assert_not_empty assigns(:event).errors.messages
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user