specs: always require rails_helper
Test helpers are separated between two files: spec_helper and rails_helper. This separation is meant to allow tests that do not require Rails (like testing standalone libs) to boot faster. The spec_helper file is always loaded, through `--require spec_helper` in the `.rspec` config file. When needed, the rails_helper file is expected to be required manually. This is fine, but: - Many test files have a redundant `require 'spec_helper'` line; - Many test files should require `rails_helper`, but don't. Not requiring `rails_helper` will cause the Rails-concerned section of the test environment not to be configured–which may cause subtle bugs (like the test database not being properly initialized). Moreover, Spring loads all the Rails files on preloading anyway. So the gains from using only `spec_helper` are thin. To streamline this process, this commit: - Configures `.rspec` to require `rails_helper` by default; - Remove all manual requires to spec_helper or rails_helper. Reference: https://stackoverflow.com/questions/24145329/how-is-spec-rails-helper-rb-different-from-spec-spec-helper-rb-do-i-need-it
This commit is contained in:
parent
d6f6a076dd
commit
4cb747fdb6
161 changed files with 23 additions and 336 deletions
2
.rspec
2
.rspec
|
@ -1,2 +1,2 @@
|
||||||
--color
|
--color
|
||||||
--require spec_helper
|
--require rails_helper
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Admin::AssignsController, type: :controller do
|
describe Admin::AssignsController, type: :controller do
|
||||||
let(:admin) { create(:administrateur) }
|
let(:admin) { create(:administrateur) }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Admin::InstructeursController, type: :controller do
|
describe Admin::InstructeursController, type: :controller do
|
||||||
let(:admin) { create(:administrateur) }
|
let(:admin) { create(:administrateur) }
|
||||||
let(:email_2) { 'plip@octo.com' }
|
let(:email_2) { 'plip@octo.com' }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Admin::MailTemplatesController, type: :controller do
|
describe Admin::MailTemplatesController, type: :controller do
|
||||||
let(:procedure) { create :procedure }
|
let(:procedure) { create :procedure }
|
||||||
let(:initiated_mail) { Mails::InitiatedMail.default_for_procedure(procedure) }
|
let(:initiated_mail) { Mails::InitiatedMail.default_for_procedure(procedure) }
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
require 'uri'
|
require 'uri'
|
||||||
|
|
||||||
describe Admin::ProceduresController, type: :controller do
|
describe Admin::ProceduresController, type: :controller do
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Administrations::OmniauthCallbacksController, type: :controller do
|
describe Administrations::OmniauthCallbacksController, type: :controller do
|
||||||
before(:each) do
|
before(:each) do
|
||||||
@request.env["devise.mapping"] = Devise.mappings[:administration]
|
@request.env["devise.mapping"] = Devise.mappings[:administration]
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe API::V1::DossiersController do
|
describe API::V1::DossiersController do
|
||||||
let(:admin) { create(:administrateur) }
|
let(:admin) { create(:administrateur) }
|
||||||
let(:token) { admin.renew_api_token }
|
let(:token) { admin.renew_api_token }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe API::V2::GraphqlController do
|
describe API::V2::GraphqlController do
|
||||||
let(:admin) { create(:administrateur) }
|
let(:admin) { create(:administrateur) }
|
||||||
let(:token) { admin.renew_api_token }
|
let(:token) { admin.renew_api_token }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe APIController, type: :controller do
|
describe APIController, type: :controller do
|
||||||
describe 'valid_token_for_procedure?' do
|
describe 'valid_token_for_procedure?' do
|
||||||
let(:procedure) { create(:procedure) }
|
let(:procedure) { create(:procedure) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe ApplicationController, type: :controller do
|
describe ApplicationController, type: :controller do
|
||||||
describe 'before_action: set_raven_context' do
|
describe 'before_action: set_raven_context' do
|
||||||
it 'is present' do
|
it 'is present' do
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe AttachmentsController, type: :controller do
|
describe AttachmentsController, type: :controller do
|
||||||
let(:user) { create(:user) }
|
let(:user) { create(:user) }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Champs::CarteController, type: :controller do
|
describe Champs::CarteController, type: :controller do
|
||||||
let(:user) { create(:user) }
|
let(:user) { create(:user) }
|
||||||
let(:procedure) { create(:procedure, :published) }
|
let(:procedure) { create(:procedure, :published) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Champs::DossierLinkController, type: :controller do
|
describe Champs::DossierLinkController, type: :controller do
|
||||||
let(:user) { create(:user) }
|
let(:user) { create(:user) }
|
||||||
let(:procedure) { create(:procedure, :published) }
|
let(:procedure) { create(:procedure, :published) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Champs::SiretController, type: :controller do
|
describe Champs::SiretController, type: :controller do
|
||||||
let(:user) { create(:user) }
|
let(:user) { create(:user) }
|
||||||
let(:procedure) { create(:procedure, :published) }
|
let(:procedure) { create(:procedure, :published) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'rails_helper'
|
|
||||||
|
|
||||||
RSpec.describe ProcedureContextConcern, type: :controller do
|
RSpec.describe ProcedureContextConcern, type: :controller do
|
||||||
class TestController < ActionController::Base
|
class TestController < ActionController::Base
|
||||||
include ProcedureContextConcern
|
include ProcedureContextConcern
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'rails_helper'
|
|
||||||
|
|
||||||
RSpec.describe Devise::StoreLocationExtension, type: :controller do
|
RSpec.describe Devise::StoreLocationExtension, type: :controller do
|
||||||
class TestController < ActionController::Base
|
class TestController < ActionController::Base
|
||||||
include Devise::Controllers::StoreLocation
|
include Devise::Controllers::StoreLocation
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Instructeurs::AvisController, type: :controller do
|
describe Instructeurs::AvisController, type: :controller do
|
||||||
context 'with a instructeur signed in' do
|
context 'with a instructeur signed in' do
|
||||||
render_views
|
render_views
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Instructeurs::DossiersController, type: :controller do
|
describe Instructeurs::DossiersController, type: :controller do
|
||||||
render_views
|
render_views
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Instructeurs::InstructeurController, type: :controller do
|
describe Instructeurs::InstructeurController, type: :controller do
|
||||||
describe 'before actions: authenticate_instructeur!' do
|
describe 'before actions: authenticate_instructeur!' do
|
||||||
it 'is present' do
|
it 'is present' do
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Instructeurs::ProceduresController, type: :controller do
|
describe Instructeurs::ProceduresController, type: :controller do
|
||||||
describe "before_action: ensure_ownership!" do
|
describe "before_action: ensure_ownership!" do
|
||||||
it "is present" do
|
it "is present" do
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Instructeurs::RechercheController, type: :controller do
|
describe Instructeurs::RechercheController, type: :controller do
|
||||||
let(:dossier) { create(:dossier, :en_construction) }
|
let(:dossier) { create(:dossier, :en_construction) }
|
||||||
let(:dossier2) { create(:dossier, :en_construction, procedure: dossier.procedure) }
|
let(:dossier2) { create(:dossier, :en_construction, procedure: dossier.procedure) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe InvitesController, type: :controller do
|
describe InvitesController, type: :controller do
|
||||||
let(:dossier) { create(:dossier, :en_construction) }
|
let(:dossier) { create(:dossier, :en_construction) }
|
||||||
let(:email) { 'plop@octo.com' }
|
let(:email) { 'plop@octo.com' }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe PingController, type: :controller do
|
describe PingController, type: :controller do
|
||||||
describe 'GET #index' do
|
describe 'GET #index' do
|
||||||
subject { get :index }
|
subject { get :index }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe RootController, type: :controller do
|
describe RootController, type: :controller do
|
||||||
subject { get :index }
|
subject { get :index }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe StatsController, type: :controller do
|
describe StatsController, type: :controller do
|
||||||
describe "#last_four_months_hash" do
|
describe "#last_four_months_hash" do
|
||||||
context "while a regular user is logged in" do
|
context "while a regular user is logged in" do
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe SupportController, type: :controller do
|
describe SupportController, type: :controller do
|
||||||
render_views
|
render_views
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Users::CommencerController, type: :controller do
|
describe Users::CommencerController, type: :controller do
|
||||||
let(:user) { create(:user) }
|
let(:user) { create(:user) }
|
||||||
let(:published_procedure) { create(:procedure, :published) }
|
let(:published_procedure) { create(:procedure, :published) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Users::ConfirmationsController, type: :controller do
|
describe Users::ConfirmationsController, type: :controller do
|
||||||
let!(:user) { create(:user, :unconfirmed) }
|
let!(:user) { create(:user, :unconfirmed) }
|
||||||
let(:confirmation_token) { user.confirmation_token }
|
let(:confirmation_token) { user.confirmation_token }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Users::DossiersController, type: :controller do
|
describe Users::DossiersController, type: :controller do
|
||||||
let(:user) { create(:user) }
|
let(:user) { create(:user) }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require "spec_helper"
|
|
||||||
|
|
||||||
describe Users::PasswordsController, type: :controller do
|
describe Users::PasswordsController, type: :controller do
|
||||||
before do
|
before do
|
||||||
@request.env["devise.mapping"] = Devise.mappings[:user]
|
@request.env["devise.mapping"] = Devise.mappings[:user]
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Users::ProfilController, type: :controller do
|
describe Users::ProfilController, type: :controller do
|
||||||
include ActiveJob::TestHelper
|
include ActiveJob::TestHelper
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Users::UserController, type: :controller do
|
describe Users::UserController, type: :controller do
|
||||||
describe 'before actions: authenticate_instructeur!' do
|
describe 'before actions: authenticate_instructeur!' do
|
||||||
it 'is present' do
|
it 'is present' do
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe WebhookController, type: :controller do
|
describe WebhookController, type: :controller do
|
||||||
describe '#helpscout' do
|
describe '#helpscout' do
|
||||||
before { allow(controller).to receive(:verify_signature!).and_return(true) }
|
before { allow(controller).to receive(:verify_signature!).and_return(true) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
feature 'As an administrateur', js: true do
|
feature 'As an administrateur', js: true do
|
||||||
let(:administration) { create(:administration) }
|
let(:administration) { create(:administration) }
|
||||||
let(:admin_email) { 'new_admin@gouv.fr' }
|
let(:admin_email) { 'new_admin@gouv.fr' }
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
require 'features/admin/procedure_spec_helper'
|
require 'features/admin/procedure_spec_helper'
|
||||||
|
|
||||||
feature 'As an administrateur I wanna clone a procedure', js: true do
|
feature 'As an administrateur I wanna clone a procedure', js: true do
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
require 'features/admin/procedure_spec_helper'
|
require 'features/admin/procedure_spec_helper'
|
||||||
|
|
||||||
feature 'As an administrateur I wanna create a new procedure', js: true do
|
feature 'As an administrateur I wanna create a new procedure', js: true do
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
feature 'procedure locked' do
|
feature 'procedure locked' do
|
||||||
let(:administrateur) { create(:administrateur) }
|
let(:administrateur) { create(:administrateur) }
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
require 'features/admin/procedure_spec_helper'
|
require 'features/admin/procedure_spec_helper'
|
||||||
|
|
||||||
feature 'Administrateurs can edit procedures', js: true do
|
feature 'Administrateurs can edit procedures', js: true do
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
feature 'France Connect Particulier Connexion' do
|
feature 'France Connect Particulier Connexion' do
|
||||||
let(:code) { 'plop' }
|
let(:code) { 'plop' }
|
||||||
let(:given_name) { 'titi' }
|
let(:given_name) { 'titi' }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
feature 'Getting help:' do
|
feature 'Getting help:' do
|
||||||
scenario 'a Help button is visible on public pages' do
|
scenario 'a Help button is visible on public pages' do
|
||||||
visit '/'
|
visit '/'
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
feature 'Inviting an expert:' do
|
feature 'Inviting an expert:' do
|
||||||
include ActiveJob::TestHelper
|
include ActiveJob::TestHelper
|
||||||
include ActionView::Helpers
|
include ActionView::Helpers
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
feature 'As an instructeur', js: true do
|
feature 'As an instructeur', js: true do
|
||||||
let(:administrateur) { create(:administrateur, :with_procedure) }
|
let(:administrateur) { create(:administrateur, :with_procedure) }
|
||||||
let(:procedure) { administrateur.procedures.first }
|
let(:procedure) { administrateur.procedures.first }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
feature 'Instructing a dossier:' do
|
feature 'Instructing a dossier:' do
|
||||||
include ActiveJob::TestHelper
|
include ActiveJob::TestHelper
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require "spec_helper"
|
|
||||||
|
|
||||||
feature "procedure filters" do
|
feature "procedure filters" do
|
||||||
let(:instructeur) { create(:instructeur) }
|
let(:instructeur) { create(:instructeur) }
|
||||||
let(:procedure) { create(:procedure, :published, :with_type_de_champ, instructeurs: [instructeur]) }
|
let(:procedure) { create(:procedure, :published, :with_type_de_champ, instructeurs: [instructeur]) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
feature 'As an administrateur I can edit types de champ', js: true do
|
feature 'As an administrateur I can edit types de champ', js: true do
|
||||||
let(:administrateur) { procedure.administrateurs.first }
|
let(:administrateur) { procedure.administrateurs.first }
|
||||||
let(:procedure) { create(:procedure) }
|
let(:procedure) { create(:procedure) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
feature 'Outdated browsers support:' do
|
feature 'Outdated browsers support:' do
|
||||||
context 'when the user browser is outdated' do
|
context 'when the user browser is outdated' do
|
||||||
before(:each) do
|
before(:each) do
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
feature 'The routing', js: true do
|
feature 'The routing', js: true do
|
||||||
let(:password) { 'a very complicated password' }
|
let(:password) { 'a very complicated password' }
|
||||||
let(:procedure) { create(:procedure, :with_type_de_champ, :with_service, :for_individual) }
|
let(:procedure) { create(:procedure, :with_type_de_champ, :with_service, :for_individual) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
feature 'Signin in:' do
|
feature 'Signin in:' do
|
||||||
let!(:user) { create(:user, password: password) }
|
let!(:user) { create(:user, password: password) }
|
||||||
let(:password) { 'démarches-simplifiées-pwd' }
|
let(:password) { 'démarches-simplifiées-pwd' }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'rails_helper'
|
|
||||||
|
|
||||||
feature 'The user' do
|
feature 'The user' do
|
||||||
let(:password) { 'démarches-simplifiées-pwd' }
|
let(:password) { 'démarches-simplifiées-pwd' }
|
||||||
let!(:user) { create(:user, password: password) }
|
let!(:user) { create(:user, password: password) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
feature 'Changing an email' do
|
feature 'Changing an email' do
|
||||||
let(:old_email) { 'old@email.com' }
|
let(:old_email) { 'old@email.com' }
|
||||||
let(:user) { create(:user, email: old_email) }
|
let(:user) { create(:user, email: old_email) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
feature 'Creating a new dossier:' do
|
feature 'Creating a new dossier:' do
|
||||||
let(:user) { create(:user) }
|
let(:user) { create(:user) }
|
||||||
let(:siret) { '40307130100044' }
|
let(:siret) { '40307130100044' }
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
require 'features/users/dossier_shared_examples.rb'
|
require 'features/users/dossier_shared_examples.rb'
|
||||||
|
|
||||||
feature 'Invitations' do
|
feature 'Invitations' do
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
feature 'linked dropdown lists' do
|
feature 'linked dropdown lists' do
|
||||||
let(:password) { 'démarches-simplifiées-pwd' }
|
let(:password) { 'démarches-simplifiées-pwd' }
|
||||||
let!(:user) { create(:user, password: password) }
|
let!(:user) { create(:user, password: password) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe 'user access to the list of their dossiers' do
|
describe 'user access to the list of their dossiers' do
|
||||||
let(:user) { create(:user) }
|
let(:user) { create(:user) }
|
||||||
let!(:dossier_brouillon) { create(:dossier, user: user) }
|
let!(:dossier_brouillon) { create(:dossier, user: user) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
feature 'Managing password:' do
|
feature 'Managing password:' do
|
||||||
context 'for simple users' do
|
context 'for simple users' do
|
||||||
let(:user) { create(:user) }
|
let(:user) { create(:user) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
feature 'Sign out' do
|
feature 'Sign out' do
|
||||||
context 'when a user is logged in' do
|
context 'when a user is logged in' do
|
||||||
let(:user) { create(:administrateur).user }
|
let(:user) { create(:administrateur).user }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
feature 'Signing up:' do
|
feature 'Signing up:' do
|
||||||
let(:user_email) { generate :user_email }
|
let(:user_email) { generate :user_email }
|
||||||
let(:user_password) { 'démarches-simplifiées-pwd' }
|
let(:user_password) { 'démarches-simplifiées-pwd' }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'rails_helper'
|
|
||||||
|
|
||||||
RSpec.describe CommentaireHelper, type: :helper do
|
RSpec.describe CommentaireHelper, type: :helper do
|
||||||
let(:commentaire) { create(:commentaire, email: "michel@pref.fr") }
|
let(:commentaire) { create(:commentaire, email: "michel@pref.fr") }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'rails_helper'
|
|
||||||
|
|
||||||
RSpec.describe ConservationDeDonneesHelper, type: :helper do
|
RSpec.describe ConservationDeDonneesHelper, type: :helper do
|
||||||
let(:procedure) { build(:procedure, duree_conservation_dossiers_dans_ds: dans_ds, duree_conservation_dossiers_hors_ds: hors_ds) }
|
let(:procedure) { build(:procedure, duree_conservation_dossiers_dans_ds: dans_ds, duree_conservation_dossiers_hors_ds: hors_ds) }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'rails_helper'
|
|
||||||
|
|
||||||
RSpec.describe DossierHelper, type: :helper do
|
RSpec.describe DossierHelper, type: :helper do
|
||||||
describe ".highlight_if_unseen_class" do
|
describe ".highlight_if_unseen_class" do
|
||||||
let(:seen_at) { Time.zone.now }
|
let(:seen_at) { Time.zone.now }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'rails_helper'
|
|
||||||
|
|
||||||
RSpec.describe AdministrateurActivateBeforeExpirationJob, type: :job do
|
RSpec.describe AdministrateurActivateBeforeExpirationJob, type: :job do
|
||||||
describe 'perform' do
|
describe 'perform' do
|
||||||
let(:administrateur) { create(:administrateur) }
|
let(:administrateur) { create(:administrateur) }
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
require 'rails_helper'
|
|
||||||
include ActiveJob::TestHelper
|
include ActiveJob::TestHelper
|
||||||
|
|
||||||
RSpec.describe ApplicationJob, type: :job do
|
RSpec.describe ApplicationJob, type: :job do
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'rails_helper'
|
|
||||||
|
|
||||||
RSpec.describe AutoArchiveProcedureJob, type: :job do
|
RSpec.describe AutoArchiveProcedureJob, type: :job do
|
||||||
let!(:procedure) { create(:procedure, :published, :with_instructeur, auto_archive_on: nil) }
|
let!(:procedure) { create(:procedure, :published, :with_instructeur, auto_archive_on: nil) }
|
||||||
let!(:procedure_hier) { create(:procedure, :published, :with_instructeur, auto_archive_on: 1.day.ago.to_date) }
|
let!(:procedure_hier) { create(:procedure, :published, :with_instructeur, auto_archive_on: 1.day.ago.to_date) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'rails_helper'
|
|
||||||
|
|
||||||
RSpec.describe DeclarativeProceduresJob, type: :job do
|
RSpec.describe DeclarativeProceduresJob, type: :job do
|
||||||
describe "perform" do
|
describe "perform" do
|
||||||
let(:date) { Time.utc(2017, 9, 1, 10, 5, 0) }
|
let(:date) { Time.utc(2017, 9, 1, 10, 5, 0) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'rails_helper'
|
|
||||||
|
|
||||||
RSpec.describe FindDubiousProceduresJob, type: :job do
|
RSpec.describe FindDubiousProceduresJob, type: :job do
|
||||||
describe 'perform' do
|
describe 'perform' do
|
||||||
let(:mailer_double) { double('mailer', deliver_later: true) }
|
let(:mailer_double) { double('mailer', deliver_later: true) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'rails_helper'
|
|
||||||
|
|
||||||
RSpec.describe WeeklyOverviewJob, type: :job do
|
RSpec.describe WeeklyOverviewJob, type: :job do
|
||||||
describe 'perform' do
|
describe 'perform' do
|
||||||
let!(:instructeur) { create(:instructeur) }
|
let!(:instructeur) { create(:instructeur) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe ApiCarto::API do
|
describe ApiCarto::API do
|
||||||
describe '.search_qp' do
|
describe '.search_qp' do
|
||||||
subject { described_class.search_qp(geojson) }
|
subject { described_class.search_qp(geojson) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe ApiCarto::CadastreAdapter do
|
describe ApiCarto::CadastreAdapter do
|
||||||
subject { described_class.new(coordinates).results }
|
subject { described_class.new(coordinates).results }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe ApiCarto::QuartiersPrioritairesAdapter do
|
describe ApiCarto::QuartiersPrioritairesAdapter do
|
||||||
subject { described_class.new(coordinates).results }
|
subject { described_class.new(coordinates).results }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe ApiEntreprise::API do
|
describe ApiEntreprise::API do
|
||||||
let(:procedure_id) { 12 }
|
let(:procedure_id) { 12 }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe ApiEntreprise::EntrepriseAdapter do
|
describe ApiEntreprise::EntrepriseAdapter do
|
||||||
let(:siren) { '418166096' }
|
let(:siren) { '418166096' }
|
||||||
let(:procedure_id) { 22 }
|
let(:procedure_id) { 22 }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe ApiEntreprise::EtablissementAdapter do
|
describe ApiEntreprise::EtablissementAdapter do
|
||||||
let(:procedure_id) { 33 }
|
let(:procedure_id) { 33 }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe ApiEntreprise::ExercicesAdapter do
|
describe ApiEntreprise::ExercicesAdapter do
|
||||||
let(:siret) { '41816609600051' }
|
let(:siret) { '41816609600051' }
|
||||||
let(:procedure_id) { 11 }
|
let(:procedure_id) { 11 }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe ApiEntreprise::RNAAdapter do
|
describe ApiEntreprise::RNAAdapter do
|
||||||
let(:siret) { '50480511000013' }
|
let(:siret) { '50480511000013' }
|
||||||
let(:procedure_id) { 22 }
|
let(:procedure_id) { 22 }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe ASN1::Timestamp do
|
describe ASN1::Timestamp do
|
||||||
let(:asn1timestamp) { File.read('spec/fixtures/files/bill_signature/signature.der') }
|
let(:asn1timestamp) { File.read('spec/fixtures/files/bill_signature/signature.der') }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe BizDev, lib: true do
|
describe BizDev, lib: true do
|
||||||
let(:first_biz_dev_id) { BizDev::PIPEDRIVE_ID }
|
let(:first_biz_dev_id) { BizDev::PIPEDRIVE_ID }
|
||||||
let(:non_biz_dev_id) { first_biz_dev_id - 1 }
|
let(:non_biz_dev_id) { first_biz_dev_id - 1 }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Helpscout::FormAdapter do
|
describe Helpscout::FormAdapter do
|
||||||
describe '#send_form' do
|
describe '#send_form' do
|
||||||
let(:api) { spy(double(:api)) }
|
let(:api) { spy(double(:api)) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Helpscout::UserConversationsAdapter do
|
describe Helpscout::UserConversationsAdapter do
|
||||||
let(:from) { Date.new(2017, 11) }
|
let(:from) { Date.new(2017, 11) }
|
||||||
let(:to) { Date.new(2017, 12) }
|
let(:to) { Date.new(2017, 12) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Pipedrive::DealAdapter do
|
describe Pipedrive::DealAdapter do
|
||||||
let(:url) { PIPEDRIVE_API_URL }
|
let(:url) { PIPEDRIVE_API_URL }
|
||||||
let(:status) { 200 }
|
let(:status) { 200 }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe 'graphql' do
|
describe 'graphql' do
|
||||||
let(:current_defn) { Api::V2::Schema.to_definition }
|
let(:current_defn) { Api::V2::Schema.to_definition }
|
||||||
let(:printout_defn) { File.read(Rails.root.join('app', 'graphql', 'schema.graphql')) }
|
let(:printout_defn) { File.read(Rails.root.join('app', 'graphql', 'schema.graphql')) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe ProgressReport, lib: true do
|
describe ProgressReport, lib: true do
|
||||||
context 'when the count pass above 100%' do
|
context 'when the count pass above 100%' do
|
||||||
let(:total) { 2 }
|
let(:total) { 2 }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Typhoeus::Cache::SuccessfulRequestsRailsCache, lib: true do
|
describe Typhoeus::Cache::SuccessfulRequestsRailsCache, lib: true do
|
||||||
let(:cache) { described_class.new }
|
let(:cache) { described_class.new }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Universign::API do
|
describe Universign::API do
|
||||||
describe '.request_timestamp', vcr: { cassette_name: 'universign' } do
|
describe '.request_timestamp', vcr: { cassette_name: 'universign' } do
|
||||||
subject { described_class.timestamp(digest) }
|
subject { described_class.timestamp(digest) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require "rails_helper"
|
|
||||||
|
|
||||||
RSpec.describe AvisMailer, type: :mailer do
|
RSpec.describe AvisMailer, type: :mailer do
|
||||||
describe '.avis_invitation' do
|
describe '.avis_invitation' do
|
||||||
let(:avis) { create(:avis) }
|
let(:avis) { create(:avis) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require "rails_helper"
|
|
||||||
|
|
||||||
RSpec.describe DossierMailer, type: :mailer do
|
RSpec.describe DossierMailer, type: :mailer do
|
||||||
let(:to_email) { 'instructeur@exemple.gouv.fr' }
|
let(:to_email) { 'instructeur@exemple.gouv.fr' }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require "spec_helper"
|
|
||||||
|
|
||||||
RSpec.describe NotificationMailer, type: :mailer do
|
RSpec.describe NotificationMailer, type: :mailer do
|
||||||
let(:user) { create(:user) }
|
let(:user) { create(:user) }
|
||||||
let(:procedure) { create(:simple_procedure) }
|
let(:procedure) { create(:simple_procedure) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require "rails_helper"
|
|
||||||
|
|
||||||
RSpec.describe UserMailer, type: :mailer do
|
RSpec.describe UserMailer, type: :mailer do
|
||||||
let(:user) { build(:user) }
|
let(:user) { build(:user) }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require "rails_helper"
|
|
||||||
|
|
||||||
describe Rack::Attack, type: :request do
|
describe Rack::Attack, type: :request do
|
||||||
let(:limit) { 5 }
|
let(:limit) { 5 }
|
||||||
let(:period) { 20 }
|
let(:period) { 20 }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Administrateur, type: :model do
|
describe Administrateur, type: :model do
|
||||||
let(:administration) { create(:administration) }
|
let(:administration) { create(:administration) }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Administration, type: :model do
|
describe Administration, type: :model do
|
||||||
describe '#invite_admin' do
|
describe '#invite_admin' do
|
||||||
let(:administration) { create :administration }
|
let(:administration) { create :administration }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'rails_helper'
|
|
||||||
|
|
||||||
RSpec.describe Avis, type: :model do
|
RSpec.describe Avis, type: :model do
|
||||||
let(:claimant) { create(:instructeur) }
|
let(:claimant) { create(:instructeur) }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'rails_helper'
|
|
||||||
|
|
||||||
RSpec.describe BillSignature, type: :model do
|
RSpec.describe BillSignature, type: :model do
|
||||||
describe 'validations' do
|
describe 'validations' do
|
||||||
subject(:bill_signature) { BillSignature.new }
|
subject(:bill_signature) { BillSignature.new }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Champ do
|
describe Champ do
|
||||||
describe '#private?' do
|
describe '#private?' do
|
||||||
let(:type_de_champ) { build(:type_de_champ, :private) }
|
let(:type_de_champ) { build(:type_de_champ, :private) }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Champ do
|
describe Champ do
|
||||||
require 'models/champ_shared_example.rb'
|
require 'models/champ_shared_example.rb'
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Champs::CarteChamp do
|
describe Champs::CarteChamp do
|
||||||
let(:champ) { Champs::CarteChamp.new(value: value) }
|
let(:champ) { Champs::CarteChamp.new(value: value) }
|
||||||
let(:value) { '' }
|
let(:value) { '' }
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Champs::CheckboxChamp do
|
describe Champs::CheckboxChamp do
|
||||||
let(:checkbox) { Champs::CheckboxChamp.new(value: value) }
|
let(:checkbox) { Champs::CheckboxChamp.new(value: value) }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Champs::DecimalNumberChamp do
|
describe Champs::DecimalNumberChamp do
|
||||||
subject { build(:champ_decimal_number, value: value).tap(&:valid?) }
|
subject { build(:champ_decimal_number, value: value).tap(&:valid?) }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Champs::HeaderSectionChamp do
|
describe Champs::HeaderSectionChamp do
|
||||||
describe '#section_index' do
|
describe '#section_index' do
|
||||||
let(:types_de_champ) do
|
let(:types_de_champ) do
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Champs::IntegerNumberChamp do
|
describe Champs::IntegerNumberChamp do
|
||||||
subject { build(:champ_integer_number, value: value).tap(&:valid?) }
|
subject { build(:champ_integer_number, value: value).tap(&:valid?) }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
describe Champs::LinkedDropDownListChamp do
|
describe Champs::LinkedDropDownListChamp do
|
||||||
describe '#unpack_value' do
|
describe '#unpack_value' do
|
||||||
let(:champ) { described_class.new(value: '["tata", "tutu"]') }
|
let(:champ) { described_class.new(value: '["tata", "tutu"]') }
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue