clean(deadcode): remove dead methods

This commit is contained in:
Martin 2022-05-17 15:22:25 +02:00 committed by mfo
parent 0eccb08f8b
commit 51f0be1034
2 changed files with 0 additions and 37 deletions

View file

@ -60,14 +60,6 @@ class Avis < ApplicationRecord
expert&.email
end
def self.link_avis_to_instructeur(instructeur)
Avis.where(email: instructeur.email).update_all(email: nil, instructeur_id: instructeur.id)
end
def self.avis_exists_and_email_belongs_to_avis?(avis_id, email)
Avis.find_by(id: avis_id)&.email == email
end
def spreadsheet_columns
[
['Dossier ID', dossier_id.to_s],

View file

@ -45,35 +45,6 @@ RSpec.describe Avis, type: :model do
end
end
describe '.avis_exists_and_email_belongs_to_avis?' do
let(:dossier) { create(:dossier) }
let(:invited_email) { 'invited@avis.com' }
let!(:avis) { create(:avis, email: invited_email, dossier: dossier) }
subject { Avis.avis_exists_and_email_belongs_to_avis?(avis_id, email) }
context 'when the avis is unknown' do
let(:avis_id) { 666 }
let(:email) { 'unknown@mystery.com' }
it { is_expected.to be false }
end
context 'when the avis is known' do
let(:avis_id) { avis.id }
context 'when the email belongs to the invitation' do
let(:email) { invited_email }
it { is_expected.to be true }
end
context 'when the email is unknown' do
let(:email) { 'unknown@mystery.com' }
it { is_expected.to be false }
end
end
end
describe "email sanitization" do
let(:expert) { create(:expert) }
let(:procedure) { create(:procedure) }