Newer
Older
echarp
a validé
# Test the notes life cycle
include Devise::TestHelpers
sign_in users(:one)
echarp
a validé
test 'should get new' do
get :new, moderation_id: @note.event.id
echarp
a validé
test 'should create note' do
assert_difference 'Note.count' do
post :create, moderation_id: @note.event.id, note: {
assert_redirected_to moderations_path
assert_difference 'Note.count' do
post :create, moderation_id: @note.event.id, envoiParMail: 'oui', note: {
contents: @note.contents
}
end
assert ActionMailer::Base.deliveries.present?
assert_redirected_to moderations_path
end
test 'should not create note' do
assert_no_difference 'Note.count' do
post :create, moderation_id: @note.event.id, note: {
nothing: 'almost'
}
end
end