force order place to index for type de champ

This commit is contained in:
Tanguy PATTE 2015-11-17 17:18:00 +01:00
parent 008fb396b7
commit cf81623937
2 changed files with 3 additions and 1 deletions

View file

@ -10,7 +10,7 @@
%h4 Description
= ff.text_area :description, class: 'form-control description', placeholder: 'Description'
.form-group
= ff.hidden_field :order_place
= ff.hidden_field :order_place, value: ff.index
= ff.hidden_field :id
/ .form-group.order_type_de_champ_button{id: "order_type_de_champ_#{type_de_champ.id || index}_button", style: ("display:none" if type_de_champ.id.nil?)}

View file

@ -35,6 +35,7 @@ feature 'add a new type de champs', js: true do
expect(subject.libelle).to eq(libelle)
expect(subject.type_champ).to eq(type_champ)
expect(subject.description).to eq(description)
expect(subject.order_place).to eq(0)
end
context 'user fill another one' do
@ -55,6 +56,7 @@ feature 'add a new type de champs', js: true do
expect(subject.libelle).to eq(libelle)
expect(subject.type_champ).to eq(type_champ)
expect(subject.description).to eq(description)
expect(subject.order_place).to eq(1)
expect(procedure.types_de_champ.count).to eq(2)
end