From fa1f0fc240f916c3d0db539a9c797adab55ec23f Mon Sep 17 00:00:00 2001 From: Damien Le Thiec Date: Tue, 4 Oct 2022 17:19:30 +0200 Subject: [PATCH] Improve rna champ tests --- .../api_education/annuaire_education_adapter_spec.rb | 4 ++-- spec/lib/api_entreprise/rna_adapter_spec.rb | 2 +- spec/models/champs/rna_champ_spec.rb | 12 +++++------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/spec/lib/api_education/annuaire_education_adapter_spec.rb b/spec/lib/api_education/annuaire_education_adapter_spec.rb index d47e9c29c..2b29c9b7e 100644 --- a/spec/lib/api_education/annuaire_education_adapter_spec.rb +++ b/spec/lib/api_education/annuaire_education_adapter_spec.rb @@ -12,7 +12,7 @@ describe APIEducation::AnnuaireEducationAdapter do let(:body) { File.read('spec/fixtures/files/api_education/annuaire_education.json') } let(:status) { 200 } - it '#to_params return vaid hash' do + it '#to_params return valid hash' do expect(subject).to be_an_instance_of(Hash) expect(subject['identifiant_de_l_etablissement']).to eq(search_term) expect(subject['code_type_contrat_prive']).to eq(99) @@ -23,7 +23,7 @@ describe APIEducation::AnnuaireEducationAdapter do let(:body) { File.read('spec/fixtures/files/api_education/annuaire_education_bug.json') } let(:status) { 200 } - it '#to_params return vaid hash' do + it '#to_params return valid hash' do expect(subject).to be_an_instance_of(Hash) expect(subject['identifiant_de_l_etablissement']).to eq(search_term) expect(subject['code_type_contrat_prive']).to eq(99) diff --git a/spec/lib/api_entreprise/rna_adapter_spec.rb b/spec/lib/api_entreprise/rna_adapter_spec.rb index 94101dcb2..fc48cc35d 100644 --- a/spec/lib/api_entreprise/rna_adapter_spec.rb +++ b/spec/lib/api_entreprise/rna_adapter_spec.rb @@ -24,7 +24,7 @@ describe APIEntreprise::RNAAdapter do let(:body) { File.read('spec/fixtures/files/api_entreprise/associations.json') } let(:status) { 200 } - it '#to_params return vaid hash' do + it '#to_params return valid hash' do expect(subject).to be_an_instance_of(Hash) expect(subject["association_rna"]).to eq('W595001988') expect(subject["association_titre"]).to eq('UN SUR QUATRE') diff --git a/spec/models/champs/rna_champ_spec.rb b/spec/models/champs/rna_champ_spec.rb index 5ef1b93f4..47b2e7f79 100644 --- a/spec/models/champs/rna_champ_spec.rb +++ b/spec/models/champs/rna_champ_spec.rb @@ -2,13 +2,11 @@ describe Champs::RNAChamp do let(:champ) { create(:champ_rna, value: "W182736273") } describe '#valid?' do - it do - expect(build(:champ_rna, value: nil)).to be_valid - expect(build(:champ_rna, value: "2736251627")).to_not be_valid - expect(build(:champ_rna, value: "A172736283")).to_not be_valid - expect(build(:champ_rna, value: "W1827362718")).to_not be_valid - expect(build(:champ_rna, value: "W182736273")).to be_valid - end + it { expect(build(:champ_rna, value: nil)).to be_valid } + it { expect(build(:champ_rna, value: "2736251627")).to_not be_valid } + it { expect(build(:champ_rna, value: "A172736283")).to_not be_valid } + it { expect(build(:champ_rna, value: "W1827362718")).to_not be_valid } + it { expect(build(:champ_rna, value: "W182736273")).to be_valid } end describe "#export" do