bug(liens-invitation): ne devrait pas pointer sur l'avis ayant le même id que l'invitation
This commit is contained in:
parent
42f93e241f
commit
4f4791a864
2 changed files with 10 additions and 0 deletions
|
@ -51,6 +51,15 @@ RSpec.describe InviteMailer, type: :mailer do
|
|||
.from(0).to(1)
|
||||
end
|
||||
|
||||
context 'when an avis exists with same id' do
|
||||
it 'associate the TargetedUserLink to the good model [does not search by id only]' do
|
||||
avis = create(:avis, id: invite.id)
|
||||
link_on_avis_with_same_id = create(:targeted_user_link, target_model: avis, target_context: TargetedUserLink.target_contexts[:avis])
|
||||
deliver
|
||||
expect(invite.targeted_user_link).not_to eq(link_on_avis_with_same_id)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when it fails' do
|
||||
it 'creates only one target_user_link' do
|
||||
send_mail_values = [:raise, true]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue