2016-11-14 18:00:26 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
feature 'backoffice: flux de commentaires' do
|
2017-07-18 15:26:33 +02:00
|
|
|
let(:procedure) { create(:procedure, :published) }
|
2016-11-14 18:00:26 +01:00
|
|
|
let(:gestionnaire) { create(:gestionnaire) }
|
2017-05-02 15:58:21 +02:00
|
|
|
let(:dossier) { create(:dossier, :with_entreprise, procedure: procedure, state: 'updated') }
|
2016-11-14 18:00:26 +01:00
|
|
|
let(:dossier_id) { dossier.id }
|
|
|
|
|
2017-05-02 15:58:21 +02:00
|
|
|
let(:champ1) { create(:champ, dossier: dossier, type_de_champ: create(:type_de_champ_public, libelle: "subtitle1")) }
|
|
|
|
let(:champ2) { create(:champ, dossier: dossier, type_de_champ: create(:type_de_champ_public, libelle: "subtitle2")) }
|
2016-11-14 18:00:26 +01:00
|
|
|
|
|
|
|
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
|
2017-05-02 15:58:21 +02:00
|
|
|
create :assign_to, gestionnaire: gestionnaire, procedure: procedure
|
2016-11-14 18:00:26 +01:00
|
|
|
login_as gestionnaire, scope: :gestionnaire
|
|
|
|
visit backoffice_dossier_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
|