improve factories
Co-authored-by: mfo <mfo@users.noreply.github.com>
This commit is contained in:
parent
15cea714c1
commit
9530099d23
3 changed files with 8 additions and 3 deletions
|
@ -170,15 +170,20 @@ FactoryBot.define do
|
||||||
|
|
||||||
factory :champ_do_not_use_rna, class: 'Champs::RNAChamp' do
|
factory :champ_do_not_use_rna, class: 'Champs::RNAChamp' do
|
||||||
value { 'W173847273' }
|
value { 'W173847273' }
|
||||||
|
value_json { AddressProxy::ADDRESS_PARTS.index_by(&:itself) }
|
||||||
end
|
end
|
||||||
|
|
||||||
factory :champ_do_not_use_engagement_juridique, class: 'Champs::EngagementJuridiqueChamp' do
|
factory :champ_do_not_use_engagement_juridique, class: 'Champs::EngagementJuridiqueChamp' do
|
||||||
|
value { 'EJ' }
|
||||||
end
|
end
|
||||||
|
|
||||||
factory :champ_do_not_use_cojo, class: 'Champs::COJOChamp' do
|
factory :champ_do_not_use_cojo, class: 'Champs::COJOChamp' do
|
||||||
end
|
end
|
||||||
|
|
||||||
factory :champ_do_not_use_rnf, class: 'Champs::RNFChamp' do
|
factory :champ_do_not_use_rnf, class: 'Champs::RNFChamp' do
|
||||||
|
value { '075-FDD-00003-01' }
|
||||||
|
external_id { '075-FDD-00003-01' }
|
||||||
|
value_json { AddressProxy::ADDRESS_PARTS.index_by(&:itself) }
|
||||||
end
|
end
|
||||||
|
|
||||||
factory :champ_do_not_use_expression_reguliere, class: 'Champs::ExpressionReguliereChamp' do
|
factory :champ_do_not_use_expression_reguliere, class: 'Champs::ExpressionReguliereChamp' do
|
||||||
|
|
|
@ -20,7 +20,7 @@ module Maintenance
|
||||||
end
|
end
|
||||||
it 'updates value_json' do
|
it 'updates value_json' do
|
||||||
expect { subject }.to change { element.reload.value_json }
|
expect { subject }.to change { element.reload.value_json }
|
||||||
.from(nil)
|
.from(anything)
|
||||||
.to({
|
.to({
|
||||||
"street_number" => "33",
|
"street_number" => "33",
|
||||||
"street_name" => "de Modagor",
|
"street_name" => "de Modagor",
|
||||||
|
|
|
@ -53,7 +53,7 @@ module Maintenance
|
||||||
|
|
||||||
it 'updates value_json' do
|
it 'updates value_json' do
|
||||||
expect { subject }.to change { element.reload.value_json }
|
expect { subject }.to change { element.reload.value_json }
|
||||||
.from(nil)
|
.from(anything)
|
||||||
.to({
|
.to({
|
||||||
"street_number" => "16",
|
"street_number" => "16",
|
||||||
"street_name" => "Rue du Général de Boissieu",
|
"street_name" => "Rue du Général de Boissieu",
|
||||||
|
@ -79,7 +79,7 @@ module Maintenance
|
||||||
|
|
||||||
it 'updates value_json' do
|
it 'updates value_json' do
|
||||||
expect { subject }.to change { element.reload.value_json }
|
expect { subject }.to change { element.reload.value_json }
|
||||||
.from(nil)
|
.from(anything)
|
||||||
.to({
|
.to({
|
||||||
"street_number" => "16",
|
"street_number" => "16",
|
||||||
"street_name" => "Rue du Général de Boissieu",
|
"street_name" => "Rue du Général de Boissieu",
|
||||||
|
|
Loading…
Reference in a new issue