style check
This commit is contained in:
parent
a7e6931303
commit
d557cee249
24 changed files with 67 additions and 78 deletions
|
@ -2,7 +2,7 @@ require 'spec_helper'
|
|||
|
||||
describe Cerfa do
|
||||
describe 'database columns' do
|
||||
it { is_expected.to have_db_column(:content)}
|
||||
it { is_expected.to have_db_column(:content) }
|
||||
end
|
||||
|
||||
describe 'associations' do
|
||||
|
@ -10,7 +10,7 @@ describe Cerfa do
|
|||
end
|
||||
|
||||
describe 'empty?' do
|
||||
subject { create(:cerfa, content: content)}
|
||||
subject { create(:cerfa, content: content) }
|
||||
context 'when content exist' do
|
||||
let(:content) { File.open('./spec/support/files/piece_jointe_388.pdf') }
|
||||
it { expect(subject).not_to be_empty }
|
||||
|
@ -20,4 +20,4 @@ describe Cerfa do
|
|||
it { expect(subject).to be_empty }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,4 +6,4 @@ describe Commentaire do
|
|||
it { is_expected.to have_db_column(:created_at) }
|
||||
it { is_expected.to have_db_column(:updated_at) }
|
||||
it { is_expected.to belong_to(:dossier) }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Dossier do
|
||||
|
||||
describe 'database columns' do
|
||||
it { is_expected.to have_db_column(:description) }
|
||||
it { is_expected.to have_db_column(:autorisation_donnees) }
|
||||
|
@ -26,7 +25,7 @@ describe Dossier do
|
|||
it { is_expected.to have_one(:entreprise) }
|
||||
end
|
||||
|
||||
describe "delegation" do
|
||||
describe 'delegation' do
|
||||
it { is_expected.to delegate_method(:siren).to(:entreprise) }
|
||||
it { is_expected.to delegate_method(:siret).to(:etablissement) }
|
||||
it { is_expected.to delegate_method(:types_piece_jointe).to(:formulaire) }
|
||||
|
@ -49,11 +48,11 @@ describe Dossier do
|
|||
|
||||
describe 'creation' do
|
||||
it 'create default cerfa' do
|
||||
expect{Dossier.create}.to change{ Cerfa.count }.by(1)
|
||||
expect { described_class.create }.to change { Cerfa.count }.by(1)
|
||||
end
|
||||
|
||||
it 'link cerfa to dossier' do
|
||||
dossier = Dossier.create
|
||||
dossier = described_class.create
|
||||
expect(dossier.cerfa).to eq(Cerfa.last)
|
||||
end
|
||||
end
|
||||
|
@ -81,4 +80,4 @@ describe Dossier do
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -20,4 +20,4 @@ describe Entreprise do
|
|||
it { is_expected.to belong_to(:dossier) }
|
||||
it { is_expected.to have_one(:etablissement) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -13,9 +13,9 @@ describe EvenementVie do
|
|||
end
|
||||
|
||||
describe '.for_admi_facile' do
|
||||
let(:evenement_for_admi_facile) { EvenementVie.where(use_admi_facile: true).first }
|
||||
let(:evenement_not_for_admi_facile) { EvenementVie.where(use_admi_facile: false).first }
|
||||
subject { EvenementVie.for_admi_facile }
|
||||
let(:evenement_for_admi_facile) { described_class.where(use_admi_facile: true).first }
|
||||
let(:evenement_not_for_admi_facile) { described_class.where(use_admi_facile: false).first }
|
||||
subject { described_class.for_admi_facile }
|
||||
it 'returns elements where use_admi_facile is true' do
|
||||
expect(subject).to include(evenement_for_admi_facile)
|
||||
end
|
||||
|
@ -23,4 +23,4 @@ describe EvenementVie do
|
|||
expect(subject).not_to include(evenement_not_for_admi_facile)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -26,8 +26,8 @@ describe Formulaire do
|
|||
|
||||
describe '.for_admi_facile' do
|
||||
it 'retruns Formulaire where use_admi_facile is true' do
|
||||
expect(Formulaire.for_admi_facile.size).to eq(Formulaire.where(use_admi_facile: true).count)
|
||||
expect(Formulaire.for_admi_facile).to include(Formulaire.where(use_admi_facile: true).first)
|
||||
expect(described_class.for_admi_facile.size).to eq(described_class.where(use_admi_facile: true).count)
|
||||
expect(described_class.for_admi_facile).to include(described_class.where(use_admi_facile: true).first)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -27,4 +27,4 @@ describe PieceJointe do
|
|||
it { is_expected.to be_falsey }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -19,4 +19,4 @@ describe TypePieceJointe do
|
|||
it { is_expected.to have_many(:pieces_jointes) }
|
||||
it { is_expected.to belong_to(:formulaire) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue