describe '#method' rather than describe '.method' for instance methods
This commit is contained in:
parent
5c9e5018f1
commit
13d251d970
16 changed files with 32 additions and 32 deletions
|
@ -5,7 +5,7 @@ describe Administrateurs::SessionsController, type: :controller do
|
|||
@request.env["devise.mapping"] = Devise.mappings[:administrateur]
|
||||
end
|
||||
|
||||
describe '.create' do
|
||||
describe '#create' do
|
||||
it { expect(described_class).to be < Sessions::SessionsController }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@ describe Gestionnaires::SessionsController, type: :controller do
|
|||
@request.env["devise.mapping"] = Devise.mappings[:gestionnaire]
|
||||
end
|
||||
|
||||
describe '.create' do
|
||||
describe '#create' do
|
||||
it { expect(described_class).to be < Sessions::SessionsController }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -152,7 +152,7 @@ describe NewGestionnaire::AvisController, type: :controller do
|
|||
end
|
||||
|
||||
context 'without a gestionnaire signed in' do
|
||||
describe '.sign_up' do
|
||||
describe '#sign_up' do
|
||||
let(:invited_email) { 'invited@avis.com' }
|
||||
let(:dossier) { create(:dossier) }
|
||||
let!(:avis) { create(:avis, email: invited_email, dossier: dossier) }
|
||||
|
@ -215,7 +215,7 @@ describe NewGestionnaire::AvisController, type: :controller do
|
|||
end
|
||||
end
|
||||
|
||||
describe '.create_gestionnaire' do
|
||||
describe '#create_gestionnaire' do
|
||||
let(:invited_email) { 'invited@avis.com' }
|
||||
let(:dossier) { create(:dossier) }
|
||||
let!(:avis) { create(:avis, email: invited_email, dossier: dossier) }
|
||||
|
|
|
@ -11,7 +11,7 @@ describe Sessions::SessionsController, type: :controller do
|
|||
let(:gestionnaire) { create(:gestionnaire) }
|
||||
let(:administrateur) { create(:administrateur) }
|
||||
|
||||
describe '.create' do
|
||||
describe '#create' do
|
||||
before do
|
||||
@request.env["devise.mapping"] = Devise.mappings[:user]
|
||||
end
|
||||
|
@ -22,7 +22,7 @@ describe Sessions::SessionsController, type: :controller do
|
|||
end
|
||||
end
|
||||
|
||||
describe '.create with user connected' do
|
||||
describe '#create with user connected' do
|
||||
before do
|
||||
@request.env["devise.mapping"] = Devise.mappings[:user]
|
||||
|
||||
|
@ -35,7 +35,7 @@ describe Sessions::SessionsController, type: :controller do
|
|||
end
|
||||
end
|
||||
|
||||
describe '.create with gestionnaire connected' do
|
||||
describe '#create with gestionnaire connected' do
|
||||
before do
|
||||
@request.env["devise.mapping"] = Devise.mappings[:gestionnaire]
|
||||
|
||||
|
@ -48,7 +48,7 @@ describe Sessions::SessionsController, type: :controller do
|
|||
end
|
||||
end
|
||||
|
||||
describe '.create with administrateur connected' do
|
||||
describe '#create with administrateur connected' do
|
||||
before do
|
||||
@request.env["devise.mapping"] = Devise.mappings[:administrateur]
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ describe Users::RegistrationsController, type: :controller do
|
|||
@request.env["devise.mapping"] = Devise.mappings[:user]
|
||||
end
|
||||
|
||||
describe '.create' do
|
||||
describe '#create' do
|
||||
subject { post :create, params: { user: user } }
|
||||
|
||||
context 'when user is correct' do
|
||||
|
|
|
@ -8,7 +8,7 @@ describe Users::SessionsController, type: :controller do
|
|||
@request.env["devise.mapping"] = Devise.mappings[:user]
|
||||
end
|
||||
|
||||
describe '.create' do
|
||||
describe '#create' do
|
||||
it { expect(described_class).to be < Sessions::SessionsController }
|
||||
|
||||
describe 'France Connect attribut' do
|
||||
|
@ -99,7 +99,7 @@ describe Users::SessionsController, type: :controller do
|
|||
end
|
||||
end
|
||||
|
||||
describe '.destroy' do
|
||||
describe '#destroy' do
|
||||
before do
|
||||
sign_in user
|
||||
delete :destroy
|
||||
|
@ -181,7 +181,7 @@ describe Users::SessionsController, type: :controller do
|
|||
end
|
||||
end
|
||||
|
||||
describe '.new' do
|
||||
describe '#new' do
|
||||
subject { get :new }
|
||||
|
||||
context 'when procedure_id is not present in user_return_to session params' do
|
||||
|
|
|
@ -10,25 +10,25 @@ describe AdminProceduresShowFacades do
|
|||
|
||||
subject { AdminProceduresShowFacades.new procedure }
|
||||
|
||||
describe '.procedure' do
|
||||
describe '#procedure' do
|
||||
subject { super().procedure }
|
||||
|
||||
it { is_expected.to eq(procedure) }
|
||||
end
|
||||
|
||||
describe '.dossiers' do
|
||||
describe '#dossiers' do
|
||||
subject { super().dossiers }
|
||||
|
||||
it { expect(subject.size).to eq(3) }
|
||||
end
|
||||
|
||||
describe '.dossiers_for_pie_highchart' do
|
||||
describe '#dossiers_for_pie_highchart' do
|
||||
subject { super().dossiers_for_pie_highchart }
|
||||
|
||||
it { expect(subject).to eq({ 'En construction' => 2 }) }
|
||||
end
|
||||
|
||||
describe '.dossiers_archived_by_state_total' do
|
||||
describe '#dossiers_archived_by_state_total' do
|
||||
subject { super().dossiers_archived_by_state_total }
|
||||
|
||||
it { expect(subject.size).to eq(1) }
|
||||
|
@ -37,19 +37,19 @@ describe AdminProceduresShowFacades do
|
|||
it { expect(subject.first.total).to eq(1) }
|
||||
end
|
||||
|
||||
describe 'dossiers_archived_total' do
|
||||
describe '#dossiers_archived_total' do
|
||||
subject { super().dossiers_archived_total }
|
||||
|
||||
it { is_expected.to eq(1) }
|
||||
end
|
||||
|
||||
describe 'dossiers_total' do
|
||||
describe '#dossiers_total' do
|
||||
subject { super().dossiers_total }
|
||||
|
||||
it { is_expected.to eq(3) }
|
||||
end
|
||||
|
||||
describe 'dossiers_termine_total' do
|
||||
describe '#dossiers_termine_total' do
|
||||
subject { super().dossiers_termine_total }
|
||||
|
||||
it { is_expected.to eq(0) }
|
||||
|
|
|
@ -19,13 +19,13 @@ describe Carto::GeoAPI::Driver do
|
|||
it { is_expected.to eq File.open('app/lib/carto/geo_api/pays.json').read }
|
||||
end
|
||||
|
||||
describe 'departements_url' do
|
||||
describe '.departements_url' do
|
||||
subject { described_class.departements_url }
|
||||
|
||||
it { is_expected.to eq 'https://geo.api.gouv.fr/departements' }
|
||||
end
|
||||
|
||||
describe 'regions_url' do
|
||||
describe '.regions_url' do
|
||||
subject { described_class.regions_url }
|
||||
|
||||
it { is_expected.to eq 'https://geo.api.gouv.fr/regions' }
|
||||
|
|
|
@ -3,7 +3,7 @@ require 'rails_helper'
|
|||
RSpec.describe Avis, type: :model do
|
||||
let(:claimant) { create(:gestionnaire) }
|
||||
|
||||
describe '.email_to_display' do
|
||||
describe '#email_to_display' do
|
||||
let(:invited_email) { 'invited@avis.com' }
|
||||
let!(:avis) do
|
||||
avis = create(:avis, email: invited_email, dossier: create(:dossier))
|
||||
|
@ -58,7 +58,7 @@ RSpec.describe Avis, type: :model do
|
|||
end
|
||||
end
|
||||
|
||||
describe '.avis_exists_and_email_belongs_to_avis' do
|
||||
describe '.avis_exists_and_email_belongs_to_avis?' do
|
||||
let(:dossier) { create(:dossier) }
|
||||
let(:invited_email) { 'invited@avis.com' }
|
||||
let!(:avis) { create(:avis, email: invited_email, dossier: dossier) }
|
||||
|
|
|
@ -33,14 +33,14 @@ describe MailTemplateConcern do
|
|||
end
|
||||
end
|
||||
|
||||
describe '.subject_for_dossier' do
|
||||
describe '#subject_for_dossier' do
|
||||
before { initiated_mail.subject = template }
|
||||
subject { initiated_mail.subject_for_dossier(dossier) }
|
||||
|
||||
it_behaves_like "can replace tokens in template"
|
||||
end
|
||||
|
||||
describe '.body_for_dossier' do
|
||||
describe '#body_for_dossier' do
|
||||
before { initiated_mail.body = template }
|
||||
subject { initiated_mail.body_for_dossier(dossier) }
|
||||
|
||||
|
@ -63,7 +63,7 @@ describe MailTemplateConcern do
|
|||
end
|
||||
end
|
||||
|
||||
describe '.replace_tags' do
|
||||
describe '#replace_tags' do
|
||||
before { initiated_mail.body = "n --numéro du dossier--" }
|
||||
it "avoids side effects" do
|
||||
expect(initiated_mail.body_for_dossier(dossier)).to eq("n #{dossier.id}")
|
||||
|
|
|
@ -621,7 +621,7 @@ describe Dossier do
|
|||
end
|
||||
end
|
||||
|
||||
describe '.build_attestation' do
|
||||
describe '#build_attestation' do
|
||||
let(:attestation_template) { nil }
|
||||
let(:procedure) { create(:procedure, attestation_template: attestation_template) }
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe FranceConnectParticulierClient do
|
||||
describe '.initialize' do
|
||||
describe '#initialize' do
|
||||
subject { FranceConnectParticulierClient.new(code) }
|
||||
|
||||
context 'when given code in params' do
|
||||
|
|
|
@ -174,7 +174,7 @@ describe Gestionnaire, type: :model do
|
|||
end
|
||||
end
|
||||
|
||||
describe '.can_view_dossier?' do
|
||||
describe '#can_view_dossier?' do
|
||||
subject{ gestionnaire.can_view_dossier?(dossier.id) }
|
||||
|
||||
context 'when gestionnaire is assigned on dossier' do
|
||||
|
|
|
@ -7,7 +7,7 @@ describe Individual do
|
|||
it { is_expected.to have_db_column(:birthdate) }
|
||||
it { is_expected.to belong_to(:dossier) }
|
||||
|
||||
describe ".save" do
|
||||
describe "#save" do
|
||||
let(:individual) { build(:individual) }
|
||||
|
||||
subject { individual.save }
|
||||
|
|
|
@ -495,7 +495,7 @@ describe Procedure do
|
|||
it { expect(Procedure.default_sort).to eq("{\"table\":\"self\",\"column\":\"id\",\"order\":\"desc\"}") }
|
||||
end
|
||||
|
||||
describe ".export_filename" do
|
||||
describe "#export_filename" do
|
||||
before { Timecop.freeze(Time.new(2018, 1, 2, 23, 11, 14)) }
|
||||
|
||||
subject { procedure.export_filename }
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Search do
|
||||
describe '.results' do
|
||||
describe '#results' do
|
||||
subject { liste_dossiers }
|
||||
|
||||
let(:liste_dossiers) do
|
||||
|
|
Loading…
Reference in a new issue