Fix some tests

This commit is contained in:
Xavier J 2016-12-27 15:50:45 +01:00
parent fb737df463
commit e7b7652388
6 changed files with 5 additions and 6 deletions

View file

@ -2,6 +2,6 @@ class InviteDossierFacades < DossierFacades
#TODO rechercher en fonction de la personne/email
def initialize dossier_id, email
@dossier = (Invite.where(email: email).find(dossier_id)).dossier
@dossier = Invite.where(email: email, dossier_id: dossier_id).first!.dossier
end
end

View file

@ -7,7 +7,7 @@ describe Users::DescriptionController, type: :controller, vcr: {cassette_name: '
let(:invite_by_user) { create :user, email: 'invite@plop.com' }
let(:procedure) { create(:procedure, :with_two_type_de_piece_justificative, :with_type_de_champ, :with_datetime, cerfa_flag: true) }
let(:dossier) { create(:dossier, procedure: procedure, user: owner_user) }
let(:dossier) { create(:dossier, procedure: procedure, user: owner_user, state: 'initiated') }
let(:dossier_id) { dossier.id }
let(:bad_dossier_id) { Dossier.count + 10000 }

View file

@ -1,4 +1,4 @@
RSpec.describe Users::Dossiers::InvitesController, type: :controller do
describe Users::Dossiers::InvitesController, type: :controller do
describe '#authenticate_user!' do
let(:user) { create :user }
let(:invite) { create :invite }

View file

@ -3,7 +3,6 @@ require 'spec_helper'
describe Notification do
it { is_expected.to have_db_column(:already_read) }
it { is_expected.to have_db_column(:liste) }
it { is_expected.to have_db_column(:multiple) }
it { is_expected.to have_db_column(:type_notif) }
it { is_expected.to have_db_column(:created_at) }
it { is_expected.to have_db_column(:updated_at) }

View file

@ -41,7 +41,7 @@ Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, js_errors: true, port: 44_678 + ENV['TEST_ENV_NUMBER'].to_i, phantomjs_options: ['--proxy-type=none'], timeout: 180)
end
#ActiveSupport::Deprecation.silenced = true
ActiveSupport::Deprecation.silenced = true
Capybara.default_max_wait_time = 1

View file

@ -29,6 +29,6 @@ describe 'admin/gestionnaires/index.html.haml', type: :view do
array: true))
render
end
it { expect(rendered).to match(/plop\d+@plop.com/) }
it { expect(rendered).to match(/gest\d+@plop.com/) }
end
end