clean(deadcode): remove dead methods
This commit is contained in:
parent
0eccb08f8b
commit
51f0be1034
2 changed files with 0 additions and 37 deletions
|
@ -60,14 +60,6 @@ class Avis < ApplicationRecord
|
||||||
expert&.email
|
expert&.email
|
||||||
end
|
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
|
def spreadsheet_columns
|
||||||
[
|
[
|
||||||
['Dossier ID', dossier_id.to_s],
|
['Dossier ID', dossier_id.to_s],
|
||||||
|
|
|
@ -45,35 +45,6 @@ RSpec.describe Avis, type: :model do
|
||||||
end
|
end
|
||||||
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
|
describe "email sanitization" do
|
||||||
let(:expert) { create(:expert) }
|
let(:expert) { create(:expert) }
|
||||||
let(:procedure) { create(:procedure) }
|
let(:procedure) { create(:procedure) }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue