Fix Commentaire factory so that the default case creates a valid object
This commit is contained in:
parent
930fd345de
commit
fac20ed190
3 changed files with 3 additions and 3 deletions
|
@ -4,7 +4,7 @@ FactoryBot.define do
|
|||
|
||||
before(:create) do |commentaire, _evaluator|
|
||||
if !commentaire.dossier
|
||||
commentaire.dossier = create :dossier
|
||||
commentaire.dossier = create :dossier, :en_construction
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -32,7 +32,7 @@ RSpec.describe CommentaireHelper, type: :helper do
|
|||
end
|
||||
|
||||
describe '.commentaire_is_from_guest' do
|
||||
let(:dossier) { create(:dossier) }
|
||||
let(:dossier) { create(:dossier, :en_instruction) }
|
||||
let!(:guest) { create(:invite, dossier: dossier) }
|
||||
|
||||
subject { commentaire_is_from_guest(commentaire) }
|
||||
|
|
|
@ -3,7 +3,7 @@ describe 'shared/dossiers/messages/message.html.haml', type: :view do
|
|||
|
||||
subject { render 'shared/dossiers/messages/message.html.haml', commentaire: commentaire, messagerie_seen_at: seen_at, connected_user: dossier.user }
|
||||
|
||||
let(:dossier) { create(:dossier) }
|
||||
let(:dossier) { create(:dossier, :en_construction) }
|
||||
let(:commentaire) { create(:commentaire, dossier: dossier) }
|
||||
let(:seen_at) { commentaire.created_at + 1.hour }
|
||||
|
||||
|
|
Loading…
Reference in a new issue