From 22a59123c1bfc01c893eff82e1fd9db459a8f74a Mon Sep 17 00:00:00 2001 From: JC Date: Tue, 13 Dec 2016 16:10:03 +0100 Subject: [PATCH] Adding launchy to put save_and_open_page in capybara specs, fixing many red tests by removing/changing expectations according to new UI. Need to pursue on spec/features/backoffice/flux_de_commentaires_spec.rb (not priority), and spec/controllers/root_controller_spec.rb (unkonw) --- Gemfile | 1 + Gemfile.lock | 3 + app/controllers/root_controller.rb | 2 +- .../controllers/backoffice_controller_spec.rb | 2 +- spec/features/admin/connection_spec.rb | 7 +- .../backoffice/add_commentaire_spec.rb | 14 --- spec/features/backoffice/connection_spec.rb | 3 +- ..._page_pref_list_dossier_backoffice_spec.rb | 17 +-- .../backoffice/navigate_to_dossier_spec.rb | 22 +--- spec/features/backoffice/onglets_link_spec.rb | 103 ------------------ .../france_connect_particulier_spec.rb | 6 +- spec/features/users/complete_demande_spec.rb | 5 +- spec/features/users/list_dossiers_spec.rb | 4 +- .../previsualisations/show.html.haml_spec.rb | 2 - .../dossiers/show.html.html_spec.rb | 97 ----------------- spec/views/dossiers/_infos_dossier_spec.rb | 4 - spec/views/layouts/_navbar_spec.rb | 14 +-- .../users/description/show.html.haml_spec.rb | 2 - .../users/dossiers/index_html.haml_spec.rb | 6 +- .../recapitulatif/_commentaires_flux_spec.rb | 16 --- .../recapitulatif/show.html.haml_spec.rb | 59 +--------- 21 files changed, 32 insertions(+), 357 deletions(-) delete mode 100644 spec/features/backoffice/onglets_link_spec.rb diff --git a/Gemfile b/Gemfile index 46e959907..ebd173029 100644 --- a/Gemfile +++ b/Gemfile @@ -96,6 +96,7 @@ gem 'browser' group :test do gem 'capybara' + gem 'launchy' gem 'factory_girl' gem 'database_cleaner' gem 'selenium-webdriver' diff --git a/Gemfile.lock b/Gemfile.lock index 9b9b2d2b7..367d2b5e0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -344,6 +344,8 @@ GEM actionpack (>= 3.0.0) activesupport (>= 3.0.0) kgio (2.10.0) + launchy (2.4.3) + addressable (~> 2.3) leaflet-draw-rails (0.1.0) leaflet-markercluster-rails (0.7.0) railties (>= 3.1) @@ -657,6 +659,7 @@ DEPENDENCIES hashie jbuilder (~> 2.0) jquery-rails + launchy leaflet-draw-rails leaflet-markercluster-rails (~> 0.7.0) leaflet-rails diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb index 325a06b76..71d81ee9d 100644 --- a/app/controllers/root_controller.rb +++ b/app/controllers/root_controller.rb @@ -24,4 +24,4 @@ class RootController < ApplicationController render 'landing' end end -end \ No newline at end of file +end diff --git a/spec/controllers/backoffice_controller_spec.rb b/spec/controllers/backoffice_controller_spec.rb index b802d38e3..00db207ae 100644 --- a/spec/controllers/backoffice_controller_spec.rb +++ b/spec/controllers/backoffice_controller_spec.rb @@ -19,4 +19,4 @@ describe BackofficeController, type: :controller do it { expect(response).to redirect_to :backoffice_dossiers } end end -end \ No newline at end of file +end diff --git a/spec/features/admin/connection_spec.rb b/spec/features/admin/connection_spec.rb index 6d67e8ece..0511521da 100644 --- a/spec/features/admin/connection_spec.rb +++ b/spec/features/admin/connection_spec.rb @@ -25,14 +25,15 @@ feature 'Administrator connection' do end scenario 'it displays the menu' do expect(page).to have_css('a#profile') - expect(page).to have_css('a#admin_sign_out') + expect(page).to have_css('#sign_out') + expect(page).to have_css('a.fa-sign-out') end context 'when clicking on sign_out' do before do stub_request(:get, "https://api.github.com/repos/sgmap/tps/releases/latest"). to_return(:status => 200, :body => '{"tag_name": "plip", "body": "blabla", "published_at": "2016-02-09T16:46:47Z"}', :headers => {}) - page.find_by_id('admin_sign_out').click + page.find_by_id('sign_out').find('a.fa-sign-out').click end scenario 'admin is redireted to home page' do expect(page).to have_css('#landing') @@ -52,7 +53,7 @@ feature 'Administrator connection' do end scenario 'it redirects to procedure page' do - expect(page).to have_content('Gestion des procédures') + expect(page).to have_content('Procédures') end end end diff --git a/spec/features/backoffice/add_commentaire_spec.rb b/spec/features/backoffice/add_commentaire_spec.rb index 2d821dc1e..723f2e416 100644 --- a/spec/features/backoffice/add_commentaire_spec.rb +++ b/spec/features/backoffice/add_commentaire_spec.rb @@ -14,20 +14,6 @@ feature 'add commentaire on backoffice' do visit backoffice_dossier_path(dossier) end - context 'Affichage du flux de commentaire' do - scenario 'l\'email du contact est présent' do - expect(page).to have_selector('span[id=email_contact]') - end - - scenario 'la date du commentaire est présent' do - expect(page).to have_selector('span[id=created_at]') - end - - scenario 'le corps du commentaire est présent' do - expect(page).to have_selector('div[class=description][id=body]') - end - end - context 'Affichage du formulaire de commentaire' do scenario 'Le formulaire envoie vers /dossiers/:dossier_id/commentaire en #POST' do expect(page).to have_selector("form[action='/backoffice/commentaires?dossier_id=#{dossier_id}'][method=post]") diff --git a/spec/features/backoffice/connection_spec.rb b/spec/features/backoffice/connection_spec.rb index ee9acfa42..c428b965b 100644 --- a/spec/features/backoffice/connection_spec.rb +++ b/spec/features/backoffice/connection_spec.rb @@ -24,6 +24,7 @@ feature 'when gestionnaire come to /backoffice and is not authenticated' do let(:gestionnaire) { create(:gestionnaire, administrateurs: [administrateur]) } before do + create :assign_to, gestionnaire: gestionnaire, procedure: procedure page.find_by_id(:gestionnaire_email).set gestionnaire.email page.find_by_id(:gestionnaire_password).set gestionnaire.password page.click_on 'Se connecter' @@ -32,4 +33,4 @@ feature 'when gestionnaire come to /backoffice and is not authenticated' do expect(page).to have_css('#backoffice_index') end end -end \ No newline at end of file +end diff --git a/spec/features/backoffice/lateral_page_pref_list_dossier_backoffice_spec.rb b/spec/features/backoffice/lateral_page_pref_list_dossier_backoffice_spec.rb index a30e2f513..654f8a544 100644 --- a/spec/features/backoffice/lateral_page_pref_list_dossier_backoffice_spec.rb +++ b/spec/features/backoffice/lateral_page_pref_list_dossier_backoffice_spec.rb @@ -50,11 +50,6 @@ feature 'usage of pref list dossier lateral panel', js: true do expect(page).to have_css('#delete_pref_list_entreprise_siren') end - scenario 'dossier is brought up to date' do - wait_for_ajax - expect(page).to have_selector("a.sortable[data-attr='entreprise.siren']") - end - context 'when on click on delete attribut button' do before do page.click_on 'delete_pref_list_entreprise_siren' @@ -69,18 +64,8 @@ feature 'usage of pref list dossier lateral panel', js: true do wait_for_ajax expect(page).not_to have_selector("a.sortable[data-attr='entreprise.siren']") end - - context 'when on click on close pref list button' do - before do - page.click_on 'pref_list_dossier_close_action' - end - - scenario 'lateral panel is masked' do - expect(page).to have_css('#pref_list_menu', visible: false) - end - end end end end end -end \ No newline at end of file +end diff --git a/spec/features/backoffice/navigate_to_dossier_spec.rb b/spec/features/backoffice/navigate_to_dossier_spec.rb index 1c19cb3f9..a58c68a69 100644 --- a/spec/features/backoffice/navigate_to_dossier_spec.rb +++ b/spec/features/backoffice/navigate_to_dossier_spec.rb @@ -4,7 +4,6 @@ feature 'on backoffice page' do let(:administrateur) { create(:administrateur) } let(:gestionnaire) { create(:gestionnaire, administrateurs: [administrateur]) } let(:procedure) { create(:procedure, administrateur: administrateur) } - let!(:dossier) { create(:dossier, :with_entreprise, procedure: procedure, state: 'updated') } before do @@ -14,6 +13,7 @@ feature 'on backoffice page' do end context 'when gestionnaire is logged in' do + before do page.find_by_id(:gestionnaire_email).set gestionnaire.email page.find_by_id(:gestionnaire_password).set gestionnaire.password @@ -21,7 +21,9 @@ feature 'on backoffice page' do page.click_on 'Se connecter' end context 'when he click on first dossier', js: true do + before do + page.find("#all_dossiers").click page.find("#tr_dossier_#{dossier.id}").click end @@ -29,21 +31,5 @@ feature 'on backoffice page' do expect(page).to have_css('#backoffice_dossier_show') end end - - context 'when gestionnaire have enterprise and individual dossier in his inbox', js: true do - let!(:procedure_individual) { create :procedure, libelle: 'procedure individual', administrateur: administrateur, for_individual: true } - let!(:dossier_individual) { create :dossier, procedure: procedure_individual, state: 'updated' } - - before do - create :assign_to, gestionnaire: gestionnaire, procedure: procedure_individual - - visit backoffice_path - page.find("#tr_dossier_#{dossier_individual.id}").click - end - - scenario 'it redirect to dossier page' do - expect(page).to have_css('#backoffice_dossier_show') - end - end end -end \ No newline at end of file +end diff --git a/spec/features/backoffice/onglets_link_spec.rb b/spec/features/backoffice/onglets_link_spec.rb deleted file mode 100644 index 087bb3d95..000000000 --- a/spec/features/backoffice/onglets_link_spec.rb +++ /dev/null @@ -1,103 +0,0 @@ -require 'spec_helper' - -feature 'on click on tabs button' do - let(:administrateur) { create(:administrateur) } - let(:gestionnaire) { create(:gestionnaire, administrateurs: [administrateur]) } - - let(:procedure) { create :procedure, administrateur: administrateur } - - before do - create(:dossier, :with_entreprise, procedure: procedure, state: 'initiated') - create(:dossier, :with_entreprise, procedure: procedure, state: 'replied') - create(:dossier, :with_entreprise, procedure: procedure, state: 'updated') - create(:dossier, :with_entreprise, procedure: procedure, state: 'validated') - create(:dossier, :with_entreprise, procedure: procedure, state: 'submitted') - create(:dossier, :with_entreprise, procedure: procedure, state: 'received') - create(:dossier, :with_entreprise, procedure: procedure, state: 'closed') - create(:dossier, :with_entreprise, procedure: procedure, state: 'refused') - create(:dossier, :with_entreprise, procedure: procedure, state: 'without_continuation') - - create :assign_to, gestionnaire: gestionnaire, procedure: procedure - - login_as gestionnaire, scope: :gestionnaire - end - - context 'when gestionnaire is logged in' do - context 'when he click on tabs nouveaux' do - before do - visit backoffice_dossiers_url(liste: :nouveaux) - page.click_on 'Nouveaux 1' - end - - scenario 'it redirect to backoffice dossier termine' do - expect(page).to have_css('#backoffice_index') - end - end - - context 'when he click on tabs a traite' do - before do - visit backoffice_dossiers_url(liste: :a_traiter) - page.click_on 'Ouverts 2' - end - - scenario 'it redirect to backoffice dossier termine' do - expect(page).to have_css('#backoffice_index') - end - end - - context 'when he click on tabs en attente' do - before do - visit backoffice_dossiers_url(liste: :figes) - page.click_on 'Figés 1' - end - - scenario 'it redirect to backoffice dossier en attente' do - expect(page).to have_css('#backoffice_index') - end - end - - context 'when he click on tabs a receptionner' do - before do - visit backoffice_dossiers_url(liste: :deposes) - page.click_on 'À réceptionner 1' - end - - scenario 'it redirect to backoffice dossier a_receptionner' do - expect(page).to have_css('#backoffice_index') - end - end - - context 'when he click on tabs a instruire' do - before do - visit backoffice_dossiers_url(liste: :a_instruire) - page.click_on 'À instruire 1' - end - - scenario 'it redirect to backoffice dossier termine' do - expect(page).to have_css('#backoffice_index') - end - end - - context 'when he click on tabs termine' do - before do - visit backoffice_dossiers_url(liste: :termine) - page.click_on 'Terminé 3' - end - - scenario 'it redirect to backoffice dossier termine' do - expect(page).to have_css('#backoffice_index') - end - end - end - - context "OpenSimplif" do - before do - allow(Features).to receive(:opensimplif).and_return(true) - visit backoffice_dossiers_url - end - - scenario "it hides the tabs" do - expect(page).to_not have_content('Nouveaux') - end - end -end diff --git a/spec/features/france_connect/france_connect_particulier_spec.rb b/spec/features/france_connect/france_connect_particulier_spec.rb index b28bcc36f..01592e8af 100644 --- a/spec/features/france_connect/france_connect_particulier_spec.rb +++ b/spec/features/france_connect/france_connect_particulier_spec.rb @@ -62,7 +62,7 @@ feature 'France Connect Particulier Connexion' do end scenario 'he is redirected to user dossiers page' do - expect(page).to have_content('Mes dossiers') + expect(page).to have_content('Dossiers') end end end @@ -74,7 +74,7 @@ feature 'France Connect Particulier Connexion' do end scenario 'he is redirected to user dossiers page' do - expect(page).to have_content('Mes dossiers') + expect(page).to have_content('Dossiers') end end end @@ -96,4 +96,4 @@ feature 'France Connect Particulier Connexion' do end end end -end \ No newline at end of file +end diff --git a/spec/features/users/complete_demande_spec.rb b/spec/features/users/complete_demande_spec.rb index 61f071c0c..6c55fd215 100644 --- a/spec/features/users/complete_demande_spec.rb +++ b/spec/features/users/complete_demande_spec.rb @@ -71,9 +71,6 @@ feature 'user path for dossier creation' do page.find_by_id("champs_#{Dossier.last.champs.first.id}").set 'Mon super projet' page.click_on 'Soumettre mon dossier' end - scenario 'user is on recap page' do - expect(page).to have_css('#recap_dossier') - end end end end @@ -90,4 +87,4 @@ feature 'user path for dossier creation' do expect(page).to have_content('La procédure n\'existe pas') end end -end \ No newline at end of file +end diff --git a/spec/features/users/list_dossiers_spec.rb b/spec/features/users/list_dossiers_spec.rb index b3a767551..d970de7b4 100644 --- a/spec/features/users/list_dossiers_spec.rb +++ b/spec/features/users/list_dossiers_spec.rb @@ -37,7 +37,7 @@ feature 'user access to the list of his dossier' do page.find("#tr_dossier_#{dossier1.id}").click end scenario 'user is redirected to dossier page' do - expect(page).to have_css('#recap_dossier') + expect(page).to have_css('#users_recapitulatif_dossier_show') end end -end \ No newline at end of file +end diff --git a/spec/views/admin/previsualisations/show.html.haml_spec.rb b/spec/views/admin/previsualisations/show.html.haml_spec.rb index 16127ddac..03e9bd4f8 100644 --- a/spec/views/admin/previsualisations/show.html.haml_spec.rb +++ b/spec/views/admin/previsualisations/show.html.haml_spec.rb @@ -79,13 +79,11 @@ describe 'admin/previsualisations/show.html.haml', type: :view do describe 'first champs' do subject { dossier.champs.first } - it { expect(rendered).to have_css(".type_champ-#{subject.type_champ}") } it { expect(rendered).to have_css("#champs_#{subject.id}") } end describe 'last champs' do subject { dossier.champs.last } - it { expect(rendered).to have_css(".type_champ-#{subject.type_champ}") } it { expect(rendered).to have_css("#champs_#{subject.id}") } end end diff --git a/spec/views/backoffice/dossiers/show.html.html_spec.rb b/spec/views/backoffice/dossiers/show.html.html_spec.rb index d09aadeaa..87c771913 100644 --- a/spec/views/backoffice/dossiers/show.html.html_spec.rb +++ b/spec/views/backoffice/dossiers/show.html.html_spec.rb @@ -23,16 +23,7 @@ describe 'backoffice/dossiers/show.html.haml', type: :view do expect(rendered).not_to have_css('#UploadPJmodal') end - it 'enterprise informations are present' do - expect(rendered).to have_selector('#infos_entreprise') - end - - it 'dossier informations are present' do - expect(rendered).to have_selector('#infos_dossier') - end - it 'dossier number is present' do - expect(rendered).to have_selector('#dossier_id') expect(rendered).to have_content(dossier_id) end @@ -52,50 +43,6 @@ describe 'backoffice/dossiers/show.html.haml', type: :view do end context 'dossier state changements' do - context 'when dossier have state initiated' do - let(:state) { 'initiated' } - - before do - render - end - - it { expect(rendered).to have_content('Nouveau') } - - it 'button Déclarer complet is present' do - expect(rendered).to have_css('.action_button') - expect(rendered).to have_content('Déclarer complet') - end - end - - context 'when dossier have state replied' do - let(:state) { 'replied' } - - before do - render - end - - it { expect(rendered).to have_content('Répondu') } - - it 'button Déclarer complet is present' do - expect(rendered).to have_css('.action_button') - expect(rendered).to have_content('Déclarer complet') - end - end - - context 'when dossier have state update' do - let(:state) { 'updated' } - - before do - render - end - - it { expect(rendered).to have_content('Mis à jour') } - - it 'button Déclarer complet is present' do - expect(rendered).to have_css('.action_button') - expect(rendered).to have_content('Déclarer complet') - end - end context 'when dossier have state validated' do let(:state) { 'validated' } @@ -104,49 +51,11 @@ describe 'backoffice/dossiers/show.html.haml', type: :view do render end - it { expect(rendered).to have_content('Figé') } - it 'button Déclarer complet is not present' do - expect(rendered).not_to have_css('.action_button') expect(rendered).not_to have_content('Déclarer complet') end end - context 'when dossier have state submitted' do - let(:state) { 'submitted' } - - before do - render - end - - it { expect(rendered).to have_content('Déposé') } - - it 'button Accuser réception is present' do - expect(rendered).to have_css('.action_button') - expect(rendered).to have_content('Accuser réception') - end - - it 'button Déclarer complet is not present' do - expect(rendered).not_to have_content('Accepter le dossier') - end - end - - context 'when dossier have state received' do - let(:state) { 'received' } - - before do - render - end - - it { expect(rendered).to have_content('Reçu') } - - it 'button accepter / refuser / classer sans suite are present' do - expect(rendered).to have_css('.action_button[data-toggle="tooltip"][title="Accepter"]') - expect(rendered).to have_css('.action_button[data-toggle="tooltip"][title="Classer sans suite"]') - expect(rendered).to have_css('.action_button[data-toggle="tooltip"][title="Refuser"]') - end - end - context 'when dossier have state closed' do let(:state) { 'closed' } @@ -154,8 +63,6 @@ describe 'backoffice/dossiers/show.html.haml', type: :view do render end - it { expect(rendered).to have_content('Accepté') } - it 'button Accepter le dossier is not present' do expect(rendered).not_to have_css('.action_button[data-toggle="tooltip"][title="Accepter"]') expect(rendered).not_to have_css('.action_button[data-toggle="tooltip"][title="Classer sans suite"]') @@ -170,8 +77,6 @@ describe 'backoffice/dossiers/show.html.haml', type: :view do render end - it { expect(rendered).to have_content('Sans suite') } - it 'button Déclarer complet is not present' do expect(rendered).not_to have_css('.action_button[data-toggle="tooltip"][title="Accepter"]') expect(rendered).not_to have_css('.action_button[data-toggle="tooltip"][title="Classer sans suite"]') @@ -186,8 +91,6 @@ describe 'backoffice/dossiers/show.html.haml', type: :view do render end - it { expect(rendered).to have_content('Refusé') } - it 'button Déclarer complet is not present' do expect(rendered).not_to have_css('.action_button[data-toggle="tooltip"][title="Accepter"]') expect(rendered).not_to have_css('.action_button[data-toggle="tooltip"][title="Classer sans suite"]') diff --git a/spec/views/dossiers/_infos_dossier_spec.rb b/spec/views/dossiers/_infos_dossier_spec.rb index cb77000e1..ed6c1e76f 100644 --- a/spec/views/dossiers/_infos_dossier_spec.rb +++ b/spec/views/dossiers/_infos_dossier_spec.rb @@ -21,9 +21,5 @@ describe 'dossiers/_infos_dossier.html.haml', type: :view do it { expect(rendered).to have_content(champs.last.libelle) } it { expect(rendered).to have_content(champs.last.value) } - - context 'when api carto is used' do - it { expect(rendered).to have_css('#map') } - end end end diff --git a/spec/views/layouts/_navbar_spec.rb b/spec/views/layouts/_navbar_spec.rb index c9e9b887e..ee7f3f98f 100644 --- a/spec/views/layouts/_navbar_spec.rb +++ b/spec/views/layouts/_navbar_spec.rb @@ -13,12 +13,10 @@ describe 'layouts/_navbar.html.haml', type: :view do render end subject { rendered } - it { is_expected.to match(/href="\/users\/sign_in">Utilisateur/) } + it { is_expected.not_to match(/href="\/users\/sign_in">Utilisateur/) } it { is_expected.to match(/href="\/gestionnaires\/sign_in">Accompagnateur/) } - it { is_expected.to match(/href="\/administrateurs\/sign_in">Administrateur/) } - it { is_expected.not_to match(/Mes Dossiers/) } - it { is_expected.not_to match(/Mes Procédures/) } - it { is_expected.not_to match(/Se déconnecter/) } + it { is_expected.not_to match(/href="\/administrateurs\/sign_in">Administrateur/) } + it { is_expected.to match(/Connexion/) } end context 'when administrateur is connected' do @@ -33,9 +31,7 @@ describe 'layouts/_navbar.html.haml', type: :view do it { is_expected.not_to match(/href="\/users\/sign_in">Utilisateur/) } it { is_expected.not_to match(/href="\/gestionnaires\/sign_in">Accompagnateur/) } it { is_expected.not_to match(/href="\/administrateurs\/sign_in">Administrateur/) } - it { is_expected.not_to match(/Mes dossiers/) } - it { is_expected.to match(/Mes procédures/) } - it { is_expected.to match(/Se déconnecter/) } + it { is_expected.to match(/Déconnexion/) } end context 'when gestionnaire is connected' do @@ -50,8 +46,6 @@ describe 'layouts/_navbar.html.haml', type: :view do it { is_expected.not_to match(/href="\/users\/sign_in">Utilisateur/) } it { is_expected.not_to match(/href="\/gestionnaires\/sign_in">Accompagnateur/) } it { is_expected.not_to match(/href="\/administrateurs\/sign_in">Administrateur/) } - it { is_expected.not_to match(/Mes procédures/) } - it { is_expected.to match(/Mes dossiers/) } it { is_expected.to match(/Déconnexion/) } end diff --git a/spec/views/users/description/show.html.haml_spec.rb b/spec/views/users/description/show.html.haml_spec.rb index 3f0a74850..8d4434af2 100644 --- a/spec/views/users/description/show.html.haml_spec.rb +++ b/spec/views/users/description/show.html.haml_spec.rb @@ -73,13 +73,11 @@ describe 'users/description/show.html.haml', type: :view do describe 'first champs' do subject { dossier.champs.first } - it { expect(rendered).to have_css(".type_champ-#{subject.type_champ}") } it { expect(rendered).to have_css("#champs_#{subject.id}") } end describe 'last champs' do subject { dossier.champs.last } - it { expect(rendered).to have_css(".type_champ-#{subject.type_champ}") } it { expect(rendered).to have_css("#champs_#{subject.id}") } end diff --git a/spec/views/users/dossiers/index_html.haml_spec.rb b/spec/views/users/dossiers/index_html.haml_spec.rb index 6cc25cc27..f7a4173b4 100644 --- a/spec/views/users/dossiers/index_html.haml_spec.rb +++ b/spec/views/users/dossiers/index_html.haml_spec.rb @@ -40,10 +40,6 @@ describe 'users/dossiers/index.html.haml', type: :view do end it { expect(dossiers_to_display.count).to eq total_dossiers } - - describe 'active tab' do - it { is_expected.to have_selector(active_class) } - end end describe 'on tab en construction' do @@ -120,4 +116,4 @@ describe 'users/dossiers/index.html.haml', type: :view do let(:decorate_dossier_at_check) { decorate_dossier_invite } end end -end \ No newline at end of file +end diff --git a/spec/views/users/recapitulatif/_commentaires_flux_spec.rb b/spec/views/users/recapitulatif/_commentaires_flux_spec.rb index b930f8d18..26bd2eb05 100644 --- a/spec/views/users/recapitulatif/_commentaires_flux_spec.rb +++ b/spec/views/users/recapitulatif/_commentaires_flux_spec.rb @@ -35,20 +35,4 @@ describe 'users/recapitulatif/_commentaires_flux.html.haml', type: :view, vcr: { end end end - - context 'Affichage du formulaire de commentaire' do - it 'Le formulaire envoie vers /dossiers/:dossier_id/commentaire en #POST' do - expect(rendered).to have_selector("form[action='/users/dossiers/#{dossier_id}/commentaire'][method=post]") - end - - it 'Champs de texte' do - expect(rendered).to have_selector('textarea[id=texte_commentaire][name=texte_commentaire]') - end - - describe 'File input' do - it 'have file_input tag' do - expect(rendered).to have_css('#piece_justificative_content') - end - end - end end diff --git a/spec/views/users/recapitulatif/show.html.haml_spec.rb b/spec/views/users/recapitulatif/show.html.haml_spec.rb index 739319181..a98359bab 100644 --- a/spec/views/users/recapitulatif/show.html.haml_spec.rb +++ b/spec/views/users/recapitulatif/show.html.haml_spec.rb @@ -17,15 +17,10 @@ describe 'users/recapitulatif/show.html.haml', type: :view do end it 'la section infos dossier est présente' do - expect(rendered).to have_selector('#infos_dossier') - end - - it 'le flux de commentaire est présent' do - expect(rendered).to have_selector('#commentaires_flux') + expect(rendered).to have_selector('#dossier') end it 'le numéro de dossier est présent' do - expect(rendered).to have_selector('#dossier_id') expect(rendered).to have_content(dossier_id) end @@ -40,27 +35,17 @@ describe 'users/recapitulatif/show.html.haml', type: :view do end end - context 'lien carte' do - it 'le lien vers carte est présent' do + context 'lien mise à jour pj' do + it 'le lien vers la mise à jour des pj est présent' do expect(rendered).to have_css('#maj_pj') end end - context 'lien carte' do + context 'lien siret' do it 'le lien vers le renseignement un SIRET est présent' do expect(rendered).to have_css('#add_siret') end end - - context 'lien carte' do - it 'le lien vers carte est présent' do - expect(rendered).to have_css('#maj_carte') - end - - it 'le lien vers description est correct' do - expect(rendered).to have_selector("a[id=maj_carte][href='/users/dossiers/#{dossier_id}/carte']") - end - end end end @@ -71,8 +56,6 @@ describe 'users/recapitulatif/show.html.haml', type: :view do render end - it { expect(rendered).to have_content('Nouveau') } - it 'button Modifier les document est present' do expect(rendered).to have_content('Modifier les documents') expect(rendered).to have_css('#UploadPJmodal') @@ -80,26 +63,6 @@ describe 'users/recapitulatif/show.html.haml', type: :view do end - context 'when dossier state is replied' do - let(:state) { 'replied' } - - before do - render - end - - it { expect(rendered).to have_content('Répondu') } - end - - context 'when dossier state is updated' do - let(:state) { 'updated' } - - before do - render - end - - it { expect(rendered).to have_content('Mis à jour') } - end - context 'when dossier state is validated' do let(:state) { 'validated' } @@ -107,11 +70,6 @@ describe 'users/recapitulatif/show.html.haml', type: :view do render end - it 'button Procéder au dépôt définitif est present' do - expect(rendered).to have_css('#validate_button') - expect(rendered).to have_content('Procéder au dépôt définitif') - end - it 'button Editer mon dossier n\'est plus present' do expect(rendered).not_to have_css('#maj_infos') expect(rendered).not_to have_content('Modifier mon dossier') @@ -129,8 +87,6 @@ describe 'users/recapitulatif/show.html.haml', type: :view do render end - it { expect(rendered).to have_content('Déposé') } - it 'button Editer mon dossier n\'est plus present' do expect(rendered).not_to have_css('#maj_infos') expect(rendered).not_to have_content('Modifier mon dossier') @@ -143,7 +99,6 @@ describe 'users/recapitulatif/show.html.haml', type: :view do before do render end - it { expect(rendered).to have_content('Accepté') } it 'button Editer mon dossier n\'est plus present' do expect(rendered).not_to have_css('#maj_infos') @@ -157,7 +112,6 @@ describe 'users/recapitulatif/show.html.haml', type: :view do before do render end - it { expect(rendered).to have_content('Refusé') } it 'button Editer mon dossier n\'est plus present' do expect(rendered).not_to have_css('#maj_infos') @@ -171,7 +125,6 @@ describe 'users/recapitulatif/show.html.haml', type: :view do before do render end - it { expect(rendered).to have_content('Sans suite') } it 'button Editer mon dossier n\'est plus present' do expect(rendered).not_to have_css('#maj_infos') @@ -238,10 +191,6 @@ describe 'users/recapitulatif/show.html.haml', type: :view do expect(rendered).to have_css('#maj_infos') end - it 'map link is present' do - expect(rendered).to have_css('#maj_carte') - end - it 'PJ link is present' do expect(rendered).to have_css('#maj_pj') end