Merge pull request #3384 from betagouv/dev

2019-02-06-01
This commit is contained in:
LeSim 2019-02-06 15:11:52 +01:00 committed by GitHub
commit 78aac493bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View file

@ -190,8 +190,8 @@ class Procedure < ApplicationRecord
procedure = self.deep_clone(include:
{
attestation_template: nil,
types_de_champ: :drop_down_list,
types_de_champ_private: :drop_down_list
types_de_champ: [:drop_down_list, types_de_champ: :drop_down_list],
types_de_champ_private: [:drop_down_list, types_de_champ: :drop_down_list]
})
procedure.path = nil
procedure.aasm_state = :brouillon

View file

@ -20,7 +20,8 @@ shared_dirs = [
'log',
'sockets',
'tmp/cache',
'tmp/pids'
'tmp/pids',
'vendor/bundle'
]
set :domain, ENV.fetch('domain')

View file

@ -141,6 +141,11 @@ shared_examples 'type_de_champ_spec' do
type_de_champ.types_de_champ << type_de_champ_text
expect(type_de_champ.types_de_champ.size).to eq(2)
expect(type_de_champ_text.parent).to eq(type_de_champ)
admin = create(:administrateur)
cloned_procedure = procedure.clone(admin, false)
expect(cloned_procedure.types_de_champ.first.types_de_champ).not_to be_empty
end
end
end