demarches-normaliennes/spec/views/backoffice/index.html.haml_spec.rb

25 lines
983 B
Ruby
Raw Normal View History

2015-09-22 10:15:12 +02:00
require 'spec_helper'
describe 'backoffice/index.html.haml', type: :view do
let(:administrateur) { create(:administrateur) }
let(:gestionnaire) { create(:gestionnaire, administrateur: administrateur) }
let!(:procedure) { create(:procedure, administrateur: administrateur) }
2015-09-24 18:33:10 +02:00
let!(:decorate_dossier) { create(:dossier, :with_user, procedure: procedure).decorate }
2015-09-22 10:15:12 +02:00
before do
assign(:dossiers_a_traiter, Dossier.a_traiter(gestionnaire).decorate)
assign(:dossiers_en_attente, Dossier.en_attente(gestionnaire).decorate)
assign(:dossiers_termine, Dossier.termine(gestionnaire).decorate)
2015-09-24 18:33:10 +02:00
decorate_dossier.initiated!
2015-09-22 10:15:12 +02:00
render
end
subject { rendered }
it { is_expected.to have_css('#backoffice') }
it { is_expected.to have_content(procedure.libelle) }
2015-09-24 18:33:10 +02:00
it { is_expected.to have_content(decorate_dossier.nom_projet) }
it { is_expected.to have_content(decorate_dossier.state_fr) }
it { is_expected.to have_content(decorate_dossier.last_update) }
2015-09-22 10:15:12 +02:00
end