FIX: Correctly pass `invite_to_topic` param to invites (#18229)
Ensures the correct mailer template is used.
This commit is contained in:
parent
3f2c3d5360
commit
08009cd4d1
|
@ -140,6 +140,7 @@ class InvitesController < ApplicationController
|
|||
topic_id: topic&.id,
|
||||
group_ids: groups&.map(&:id),
|
||||
expires_at: params[:expires_at],
|
||||
invite_to_topic: params[:invite_to_topic]
|
||||
)
|
||||
|
||||
if invite.present?
|
||||
|
|
|
@ -203,9 +203,9 @@ RSpec.describe InvitesController do
|
|||
it 'works' do
|
||||
sign_in(user)
|
||||
|
||||
post '/invites.json', params: { email: 'test@example.com', topic_id: topic.id }
|
||||
post '/invites.json', params: { email: 'test@example.com', topic_id: topic.id, invite_to_topic: true }
|
||||
expect(response.status).to eq(200)
|
||||
expect(Jobs::InviteEmail.jobs.first['args'].first['invite_to_topic']).to be_falsey
|
||||
expect(Jobs::InviteEmail.jobs.first['args'].first['invite_to_topic']).to be_truthy
|
||||
end
|
||||
|
||||
it 'fails when topic_id is invalid' do
|
||||
|
|
Loading…
Reference in New Issue