2016-11-14 18:00:26 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
feature 'users: flux de commentaires' do
|
|
|
|
let(:user) { create(:user) }
|
2017-12-14 15:51:45 +01:00
|
|
|
let(:dossier) { create(:dossier, :with_entreprise, user: user, state: "en_construction") }
|
2016-11-14 18:00:26 +01:00
|
|
|
let(:dossier_id) { dossier.id }
|
|
|
|
|
|
|
|
let(:champ1) { dossier.champs.first }
|
|
|
|
let(:champ2) { create(:champ, dossier: dossier, type_de_champ: create(:type_de_champ_public, libelle: "subtitle")) }
|
|
|
|
|
|
|
|
let!(:commentaire1) { create(:commentaire, dossier: dossier, champ: champ1) }
|
|
|
|
let!(:commentaire2) { create(:commentaire, dossier: dossier) }
|
|
|
|
let!(:commentaire3) { create(:commentaire, dossier: dossier, champ: champ2) }
|
|
|
|
let!(:commentaire4) { create(:commentaire, dossier: dossier, champ: champ1) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
login_as user, scope: :user
|
|
|
|
visit users_dossier_recapitulatif_path(dossier)
|
|
|
|
end
|
|
|
|
|
2016-11-16 16:23:43 +01:00
|
|
|
scenario "seuls les commentaires généraux sont affichés" do
|
2016-12-14 18:41:33 +01:00
|
|
|
comments = find(".commentaires")
|
|
|
|
expect(comments).to have_selector(".content", count: 1)
|
2016-11-14 18:00:26 +01:00
|
|
|
end
|
|
|
|
end
|