Fix tests

This commit is contained in:
Damien Le Thiec 2022-10-05 13:07:39 +02:00
parent a3468fca27
commit abbbef1461
3 changed files with 30 additions and 27 deletions

View file

@ -55,6 +55,7 @@ class TypeDeChamp < ApplicationRecord
explication: CADRE,
dossier_link: CADRE,
piece_justificative: STANDARD,
rna: REFERENTIEL_EXTERNE,
siret: PAIEMENT_IDENTIFICATION,
carte: REFERENTIEL_EXTERNE,
repetition: CADRE,

View file

@ -110,32 +110,34 @@ describe Champs::RNAController, type: :controller do
let(:status) { 200 }
let(:body) { File.read('spec/fixtures/files/api_entreprise/associations.json') }
let(:expected_data) do
{ "association_id"=>"W595001988",
"association_titre"=>"UN SUR QUATRE",
"association_objet"=>"valoriser, transmettre et partager auprès des publics les plus larges possibles, les bienfaits de l'immigration, la richesse de la diversité et la curiosité de l'autre autrement",
"association_siret"=>nil,
"association_date_creation"=>"2014-01-23",
"association_date_declaration"=>"2014-01-24",
"association_date_publication"=>"2014-02-08",
"association_date_dissolution"=>"0001-01-01",
"association_adresse_siege"=> {
"complement"=>"",
"numero_voie"=>"61",
"type_voie"=>"RUE",
"libelle_voie"=>"des Noyers",
"distribution"=>"_",
"code_insee"=>"93063",
"code_postal"=>"93230",
"commune"=>"Romainville"
{
"association_id" => "W595001988",
"association_titre" => "UN SUR QUATRE",
"association_objet" => "valoriser, transmettre et partager auprès des publics les plus larges possibles, les bienfaits de l'immigration, la richesse de la diversité et la curiosité de l'autre autrement",
"association_siret" => nil,
"association_date_creation" => "2014-01-23",
"association_date_declaration" => "2014-01-24",
"association_date_publication" => "2014-02-08",
"association_date_dissolution" => "0001-01-01",
"association_adresse_siege" => {
"complement" => "",
"numero_voie" => "61",
"type_voie" => "RUE",
"libelle_voie" => "des Noyers",
"distribution" => "_",
"code_insee" => "93063",
"code_postal" => "93230",
"commune" => "Romainville"
},
"association_code_civilite_dirigeant"=>"PM",
"association_civilite_dirigeant"=>"Monsieur le Président",
"association_code_etat"=>"A",
"association_etat"=>"Active",
"association_code_groupement"=>"S",
"association_groupement"=>"simple",
"association_mise_a_jour"=>1392295833,
"association_rna"=>"W595001988" }
"association_code_civilite_dirigeant" => "PM",
"association_civilite_dirigeant" => "Monsieur le Président",
"association_code_etat" => "A",
"association_etat" => "Active",
"association_code_groupement" => "S",
"association_groupement" => "simple",
"association_mise_a_jour" => 1392295833,
"association_rna" => "W595001988"
}
end
subject! { get :show, params: params, format: :turbo_stream }

View file

@ -14,9 +14,9 @@ describe '20220705164551_remove_unused_champs' do
describe 'remove_unused_champs' do
it "with bad champs" do
expect(Champ.where(dossier: dossier).count).to eq(40)
run_task
expect(Champ.where(dossier: dossier).count).to eq(39)
run_task
expect(Champ.where(dossier: dossier).count).to eq(38)
end
end
end