Cosmetic(ish): in spec, save changes to model
This commit is contained in:
parent
46da84a4ae
commit
f5e891f5d9
1 changed files with 8 additions and 17 deletions
|
@ -209,16 +209,16 @@ describe AttestationTemplate, type: :model do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'and their value in the dossier are not nil' do
|
context 'and their value in the dossier are not nil' do
|
||||||
before :each do
|
before do
|
||||||
dossier.champs
|
dossier.champs
|
||||||
.select { |champ| champ.libelle == 'libelleA' }
|
.select { |champ| champ.libelle == 'libelleA' }
|
||||||
.first
|
.first
|
||||||
.value = 'libelle1'
|
.update_attributes(value: 'libelle1')
|
||||||
|
|
||||||
dossier.champs
|
dossier.champs
|
||||||
.select { |champ| champ.libelle == 'libelleB' }
|
.select { |champ| champ.libelle == 'libelleB' }
|
||||||
.first
|
.first
|
||||||
.value = 'libelle2'
|
.update_attributes(value: 'libelle2')
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect(view_args[:title]).to eq('title libelle1') }
|
it { expect(view_args[:title]).to eq('title libelle1') }
|
||||||
|
@ -245,12 +245,7 @@ describe AttestationTemplate, type: :model do
|
||||||
let(:template_title) { 'title --libelleA--' }
|
let(:template_title) { 'title --libelleA--' }
|
||||||
|
|
||||||
context 'and its value in the dossier are not nil' do
|
context 'and its value in the dossier are not nil' do
|
||||||
before :each do
|
before { dossier.champs_private.first.update_attributes(value: 'libelle1') }
|
||||||
dossier.champs_private
|
|
||||||
.select { |champ| champ.libelle == 'libelleA' }
|
|
||||||
.first
|
|
||||||
.value = 'libelle1'
|
|
||||||
end
|
|
||||||
|
|
||||||
it { expect(view_args[:title]).to eq('title libelle1') }
|
it { expect(view_args[:title]).to eq('title libelle1') }
|
||||||
end
|
end
|
||||||
|
@ -267,16 +262,16 @@ describe AttestationTemplate, type: :model do
|
||||||
let(:template_title) { 'title --date-- --datetime--' }
|
let(:template_title) { 'title --date-- --datetime--' }
|
||||||
|
|
||||||
context 'and its value in the dossier are not nil' do
|
context 'and its value in the dossier are not nil' do
|
||||||
before :each do
|
before do
|
||||||
dossier.champs
|
dossier.champs
|
||||||
.select { |champ| champ.type_champ == 'date' }
|
.select { |champ| champ.type_champ == 'date' }
|
||||||
.first
|
.first
|
||||||
.value = '2017-04-15'
|
.update_attributes(value: '2017-04-15')
|
||||||
|
|
||||||
dossier.champs
|
dossier.champs
|
||||||
.select { |champ| champ.type_champ == 'datetime' }
|
.select { |champ| champ.type_champ == 'datetime' }
|
||||||
.first
|
.first
|
||||||
.value = '13/09/2017 09:00'
|
.update_attributes(value: '13/09/2017 09:00')
|
||||||
end
|
end
|
||||||
|
|
||||||
it { expect(view_args[:title]).to eq('title 15/04/2017 13/09/2017 09:00') }
|
it { expect(view_args[:title]).to eq('title 15/04/2017 13/09/2017 09:00') }
|
||||||
|
@ -285,11 +280,7 @@ describe AttestationTemplate, type: :model do
|
||||||
end
|
end
|
||||||
|
|
||||||
context "match breaking and non breaking spaces" do
|
context "match breaking and non breaking spaces" do
|
||||||
before do
|
before { dossier.champs.first.update_attributes(value: 'valeur') }
|
||||||
c = dossier.champs.first
|
|
||||||
c.value = 'valeur'
|
|
||||||
c.save
|
|
||||||
end
|
|
||||||
|
|
||||||
context "when the tag contains a non breaking space" do
|
context "when the tag contains a non breaking space" do
|
||||||
let(:template_body) { 'body --mon tag--' }
|
let(:template_body) { 'body --mon tag--' }
|
||||||
|
|
Loading…
Add table
Reference in a new issue