Correction, so that we can still edit an orga, even if it has no submitter
This commit is contained in:
parent
7dd9d65ea9
commit
7afa2951d0
@ -43,7 +43,7 @@ class Orga < ApplicationRecord
|
||||
end
|
||||
|
||||
after_create do
|
||||
send_secret
|
||||
send_secret if submitter.present?
|
||||
# Send email to moderators when an new orga is received
|
||||
ModerationorgaMailer.create(self).deliver_now!
|
||||
end
|
||||
|
@ -40,6 +40,22 @@ class OrgasControllerTest < ActionController::TestCase
|
||||
assert_redirected_to :root
|
||||
end
|
||||
|
||||
test 'should create minimalist orga' do
|
||||
sign_in users(:one)
|
||||
assert_difference 'Orga.count' do
|
||||
post :create, orga: {
|
||||
kind_id: @orga.kind_id,
|
||||
name: @orga.name,
|
||||
region_id: @orga.region.id,
|
||||
url: @orga.url
|
||||
}
|
||||
|
||||
assert_empty assigns(:orga).errors.messages
|
||||
end
|
||||
|
||||
assert_redirected_to :root
|
||||
end
|
||||
|
||||
test 'should not create orga' do
|
||||
sign_in users(:one)
|
||||
assert_no_difference 'Orga.count' do
|
||||
|
Loading…
Reference in New Issue
Block a user