Add on gestionnaire dossier view the private form

This commit is contained in:
Xavier J 2016-08-08 12:52:30 +02:00
parent ddb64878c8
commit 480431ea01
28 changed files with 320 additions and 88 deletions

View file

@ -1,40 +1,7 @@
require 'spec_helper'
describe Champ do
describe 'database columns' do
it { is_expected.to have_db_column(:value) }
end
require 'models/champ_shared_example.rb'
describe 'associations' do
it { is_expected.to belong_to(:dossier) }
it { is_expected.to belong_to(:type_de_champ) }
end
describe 'delegation' do
it { is_expected.to delegate_method(:libelle).to(:type_de_champ) }
it { is_expected.to delegate_method(:type_champ).to(:type_de_champ) }
it { is_expected.to delegate_method(:order_place).to(:type_de_champ) }
end
describe 'data_provide' do
let(:champ) { create :champ }
subject { champ.data_provide }
context 'when type_champ is datetime' do
before do
champ.type_de_champ = create :type_de_champ_public, type_champ: 'datetime'
end
it { is_expected.to eq 'datepicker' }
end
context 'when type_champ is address' do
before do
champ.type_de_champ = create :type_de_champ_public, type_champ: 'address'
end
it { is_expected.to eq 'typeahead' }
end
end
it_should_behave_like "champ_spec"
end