update features specs to use revisions

This commit is contained in:
Paul Chavard 2020-08-27 19:56:34 +02:00
parent 1488e0964b
commit dee12a2b0b
5 changed files with 18 additions and 22 deletions

View file

@ -97,9 +97,7 @@ feature 'The user' do
end
let(:procedure_with_repetition) do
tdc = create(:type_de_champ_repetition, libelle: 'repetition')
tdc.types_de_champ << create(:type_de_champ_text, libelle: 'text')
create(:procedure, :published, :for_individual, types_de_champ: [tdc])
create(:procedure, :published, :for_individual, :with_repetition)
end
scenario 'fill a dossier with repetition', js: true do
@ -107,13 +105,13 @@ feature 'The user' do
fill_individual
fill_in('text', with: 'super texte')
expect(page).to have_field('text', with: 'super texte')
fill_in('sub type de champ', with: 'super texte')
expect(page).to have_field('sub type de champ', with: 'super texte')
click_on 'Ajouter un élément pour'
within '.row-1' do
fill_in('text', with: 'un autre texte')
fill_in('sub type de champ', with: 'un autre texte')
end
expect(page).to have_content('Supprimer', count: 2)
@ -132,7 +130,7 @@ feature 'The user' do
end
let(:simple_procedure) do
tdcs = [create(:type_de_champ, mandatory: true, libelle: 'texte obligatoire')]
tdcs = [build(:type_de_champ, mandatory: true, libelle: 'texte obligatoire')]
create(:procedure, :published, :for_individual, types_de_champ: tdcs)
end
@ -161,14 +159,14 @@ feature 'The user' do
end
let(:procedure_with_pj) do
tdcs = [create(:type_de_champ_piece_justificative, mandatory: true, libelle: 'Pièce justificative')]
tdcs = [build(:type_de_champ_piece_justificative, mandatory: true, libelle: 'Pièce justificative')]
create(:procedure, :published, :for_individual, types_de_champ: tdcs)
end
let(:procedure_with_pjs) do
tdcs = [
create(:type_de_champ_piece_justificative, mandatory: true, libelle: 'Pièce justificative 1', order_place: 1),
create(:type_de_champ_piece_justificative, mandatory: true, libelle: 'Pièce justificative 2', order_place: 2)
build(:type_de_champ_piece_justificative, mandatory: true, libelle: 'Pièce justificative 1', position: 1),
build(:type_de_champ_piece_justificative, mandatory: true, libelle: 'Pièce justificative 2', position: 2)
]
create(:procedure, :published, :for_individual, types_de_champ: tdcs)
end

View file

@ -13,12 +13,10 @@ feature 'linked dropdown lists' do
Secondary 2.3
END_OF_LIST
end
let(:type_de_champ) { create(:type_de_champ_linked_drop_down_list, libelle: 'linked dropdown', drop_down_list_value: list_items) }
let(:type_de_champ) { build(:type_de_champ_linked_drop_down_list, libelle: 'linked dropdown', drop_down_list_value: list_items) }
let!(:procedure) do
p = create(:procedure, :published, :for_individual)
p.types_de_champ << type_de_champ
p
create(:procedure, :published, :for_individual, types_de_champ: [type_de_champ])
end
let(:user_dossier) { user.dossiers.first }