fix spec procedure_cloning
add zone to new procedure
This commit is contained in:
parent
cfc2aec334
commit
f4977f358b
2 changed files with 15 additions and 1 deletions
|
@ -116,6 +116,15 @@ FactoryBot.define do
|
|||
end
|
||||
end
|
||||
|
||||
trait :with_zone do
|
||||
zones {
|
||||
[
|
||||
create(:zone, labels:
|
||||
[{ designated_on: Time.zone.now, name: "Ministère 1" }])
|
||||
]
|
||||
}
|
||||
end
|
||||
|
||||
trait :routee do
|
||||
after(:create) do |procedure, _evaluator|
|
||||
procedure.groupe_instructeurs.create(label: 'deuxième groupe')
|
||||
|
|
|
@ -6,7 +6,7 @@ describe 'As an administrateur I wanna clone a procedure', js: true do
|
|||
let(:administrateur) { create(:administrateur) }
|
||||
|
||||
before do
|
||||
create(:procedure, :with_service, :with_instructeur,
|
||||
create(:procedure, :with_service, :with_instructeur, :with_zone,
|
||||
aasm_state: :publiee,
|
||||
administrateurs: [administrateur],
|
||||
libelle: 'libellé de la procédure',
|
||||
|
@ -29,6 +29,11 @@ describe 'As an administrateur I wanna clone a procedure', js: true do
|
|||
find("#service .fr-btn").click
|
||||
click_on "Assigner"
|
||||
|
||||
# select zone
|
||||
find("#zones .fr-btn").click
|
||||
check Zone.last.current_label
|
||||
click_on 'Enregistrer'
|
||||
|
||||
# then publish
|
||||
find('#publish-procedure-link').click
|
||||
expect(find_field('procedure_path').value).to eq 'libelle-de-la-procedure'
|
||||
|
|
Loading…
Reference in a new issue