Remove the TypeDeChamp decorators

This commit is contained in:
gregoirenovel 2018-12-27 14:22:04 +01:00 committed by Pierre de La Morinerie
parent 9c130c41da
commit 9466442aff
12 changed files with 107 additions and 181 deletions

View file

@ -36,18 +36,18 @@ describe 'admin/types_de_champ/show.html.haml', type: :view do
end
context 'when there is only one field in database' do
let!(:type_de_champ_0) { create(:type_de_champ, procedure: procedure, order_place: 0) }
it { expect(subject).to have_css('#btn_down_0[style*="visibility: hidden"]') }
it { expect(subject).to have_css('#btn_up_0[style*="visibility: hidden"]') }
it { expect(subject).not_to have_css('#btn_down_0') }
it { expect(subject).not_to have_css('#btn_up_0') }
it { expect(subject).not_to have_css('#btn_up_1') }
it { expect(subject).not_to have_css('#btn_down_1') }
end
context 'when there are 2 fields in database' do
let!(:type_de_champ_0) { create(:type_de_champ, procedure: procedure, order_place: 0) }
let!(:type_de_champ_1) { create(:type_de_champ, procedure: procedure, order_place: 1) }
it { expect(subject).not_to have_css('#btn_up_0') }
it { expect(subject).to have_css('#btn_down_0') }
it { expect(subject).to have_css('#btn_up_0[style*="visibility: hidden"]') }
it { expect(subject).to have_css('#btn_up_1') }
it { expect(subject).to have_css('#btn_down_1[style*="visibility: hidden"]') }
it { expect(subject).not_to have_css('#btn_down_1') }
end
end
end

View file

@ -44,8 +44,8 @@ describe 'admin/types_de_champ/show.html.haml', type: :view do
end
context 'when there is only one field in database' do
let!(:type_de_champ_0) { create(:type_de_champ, :private, procedure: procedure, order_place: 0) }
it { expect(subject).to have_css('#btn_down_0[style*="visibility: hidden"]') }
it { expect(subject).to have_css('#btn_up_0[style*="visibility: hidden"]') }
it { expect(subject).not_to have_css('#btn_down_0') }
it { expect(subject).not_to have_css('#btn_up_0') }
it { expect(subject).not_to have_css('#btn_up_1') }
it { expect(subject).not_to have_css('#btn_down_1') }
end
@ -53,9 +53,9 @@ describe 'admin/types_de_champ/show.html.haml', type: :view do
let!(:type_de_champ_0) { create(:type_de_champ, :private, procedure: procedure, order_place: 0) }
let!(:type_de_champ_1) { create(:type_de_champ, :private, procedure: procedure, order_place: 1) }
it { expect(subject).to have_css('#btn_down_0') }
it { expect(subject).to have_css('#btn_up_0[style*="visibility: hidden"]') }
it { expect(subject).not_to have_css('#btn_up_0') }
it { expect(subject).to have_css('#btn_up_1') }
it { expect(subject).to have_css('#btn_down_1[style*="visibility: hidden"]') }
it { expect(subject).not_to have_css('#btn_down_1') }
end
end
end