highlight routing criteria label when updated

This commit is contained in:
Christophe Robillard 2020-02-26 22:17:55 +01:00
parent 60251013f7
commit 924702699f
6 changed files with 38 additions and 4 deletions

View file

@ -67,6 +67,31 @@ describe 'shared/dossiers/champs.html.haml', type: :view do
expect(subject).to include(procedure.routing_criteria_name)
expect(subject).to include(dossier.groupe_instructeur.label)
end
context "with seen_at" do
let(:dossier) { create(:dossier) }
let(:nouveau_groupe_instructeur) { create(:groupe_instructeur, procedure: dossier.procedure) }
let(:champ1) { create(:champ, :checkbox, value: "on") }
let(:champs) { [champ1] }
context "with a demande_seen_at after groupe_instructeur_updated_at" do
let(:demande_seen_at) { dossier.groupe_instructeur_updated_at + 1.hour }
it "expect to not highlight new group instructeur label" do
dossier.assign_to_groupe_instructeur(nouveau_groupe_instructeur)
expect(subject).not_to have_css(".highlighted")
end
end
context "with a demande_seen_at before groupe_instructeur_updated_at" do
let(:demande_seen_at) { dossier.groupe_instructeur_updated_at - 1.hour }
it "expect to not highlight new group instructeur label" do
dossier.assign_to_groupe_instructeur(nouveau_groupe_instructeur)
expect(subject).to have_css(".highlighted")
end
end
end
end
context "with a dossier champ, but we are not authorized to acces the dossier" do