commit
2543e37789
1 changed files with 24 additions and 10 deletions
|
@ -1,7 +1,20 @@
|
||||||
describe 'users/description/champs/render_list_champs.html.haml', type: :view do
|
describe 'users/description/champs/render_list_champs.html.haml', type: :view do
|
||||||
let(:type_champ) { create(:type_de_champ_public, :checkbox) }
|
let(:type_champ) { create(:type_de_champ_public, :checkbox) }
|
||||||
|
|
||||||
context "with a checkbox champ with value equals nil" do
|
context "with any champ" do
|
||||||
|
let!(:champ) { create(:champ, type_de_champ: type_champ, value: nil) }
|
||||||
|
|
||||||
|
before do
|
||||||
|
render 'users/description/champs/render_list_champs.html.haml', champs: Champ.all, order_place: 0
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should render the champ's libelle" do
|
||||||
|
expect(rendered).to have_content(champ.libelle)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context "with a checkbox champ" do
|
||||||
|
context "whose value equals nil" do
|
||||||
let!(:champ_checkbox_checked) { create(:champ, type_de_champ: type_champ, value: nil) }
|
let!(:champ_checkbox_checked) { create(:champ, type_de_champ: type_champ, value: nil) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
@ -13,7 +26,7 @@ describe 'users/description/champs/render_list_champs.html.haml', type: :view do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with a checkbox champ with value equals 'on'" do
|
context "whose value equals 'on'" do
|
||||||
let!(:champ_checkbox_checked) { create(:champ, type_de_champ: type_champ, value: 'on') }
|
let!(:champ_checkbox_checked) { create(:champ, type_de_champ: type_champ, value: 'on') }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
@ -24,6 +37,7 @@ describe 'users/description/champs/render_list_champs.html.haml', type: :view do
|
||||||
expect(rendered).to have_css('input[type=checkbox][checked]')
|
expect(rendered).to have_css('input[type=checkbox][checked]')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context 'with a dossier_link' do
|
context 'with a dossier_link' do
|
||||||
let(:type_champ) { create(:type_de_champ_public, type_champ: :dossier_link) }
|
let(:type_champ) { create(:type_de_champ_public, type_champ: :dossier_link) }
|
||||||
|
|
Loading…
Add table
Reference in a new issue