From e6c6fb7e7544d840bec4d84f8249ed9d5c01661c Mon Sep 17 00:00:00 2001 From: Luc Donnet Date: Thu, 19 Apr 2018 09:17:18 +0200 Subject: Fix spec and i18n Refs #6545 @1 --- app/views/line_referentials/show.html.slim | 1 - app/views/stop_area_referentials/show.html.slim | 2 +- config/locales/stop_area_referentials.en.yml | 5 ++++- config/locales/stop_area_referentials.fr.yml | 3 +++ .../views/line_referentials/show.html.slim_spec.rb | 2 -- .../stop_area_referentials/show.html.slim_spec.rb | 22 ---------------------- .../stop_area_referentials/show.html.slim_spec.rb | 20 ++++++++++++++++++++ 7 files changed, 28 insertions(+), 27 deletions(-) delete mode 100644 spec/views/line_referentials/stop_area_referentials/show.html.slim_spec.rb create mode 100644 spec/views/stop_area_referentials/show.html.slim_spec.rb diff --git a/app/views/line_referentials/show.html.slim b/app/views/line_referentials/show.html.slim index 4a4acc427..8db94609a 100644 --- a/app/views/line_referentials/show.html.slim +++ b/app/views/line_referentials/show.html.slim @@ -1,5 +1,4 @@ - breadcrumb :line_referential, @line_referential -- page_header_content_for @line_referential - if policy(@line_referential).synchronize? - content_for :page_header_actions do = link_to(t('actions.sync'), sync_line_referential_path(@line_referential), method: :post, class: 'btn btn-default') diff --git a/app/views/stop_area_referentials/show.html.slim b/app/views/stop_area_referentials/show.html.slim index 9a0079330..a76e39439 100644 --- a/app/views/stop_area_referentials/show.html.slim +++ b/app/views/stop_area_referentials/show.html.slim @@ -2,7 +2,7 @@ - if policy(@stop_area_referential).synchronize? - content_for :page_header_actions do = link_to(t('actions.sync'), sync_stop_area_referential_path(@stop_area_referential), method: :post, class: 'btn btn-default') - + .page_content .container-fluid .row diff --git a/config/locales/stop_area_referentials.en.yml b/config/locales/stop_area_referentials.en.yml index 9d49d7c5d..3fa91bc92 100644 --- a/config/locales/stop_area_referentials.en.yml +++ b/config/locales/stop_area_referentials.en.yml @@ -4,7 +4,10 @@ en: sync: "Launch a new reflex synchronization" cancel_sync: "Cancel reflex synchronization" show: - title: 'Stop area referential' + title: 'Synchronization iCAR' + synchronized: Synchronized + status: status + message: Message activerecord: models: stop_area_referential: diff --git a/config/locales/stop_area_referentials.fr.yml b/config/locales/stop_area_referentials.fr.yml index bb4c4463a..956e801f1 100644 --- a/config/locales/stop_area_referentials.fr.yml +++ b/config/locales/stop_area_referentials.fr.yml @@ -5,6 +5,9 @@ fr: cancel_sync: "Annuler la synchronisation Reflex" show: title: 'Synchronisation iCAR' + synchronized: Synchronisé + status: Statut + message: Message activerecord: models: stop_area_referential: diff --git a/spec/views/line_referentials/show.html.slim_spec.rb b/spec/views/line_referentials/show.html.slim_spec.rb index 0516677cb..6734957c8 100644 --- a/spec/views/line_referentials/show.html.slim_spec.rb +++ b/spec/views/line_referentials/show.html.slim_spec.rb @@ -10,13 +10,11 @@ describe "/line_referentials/show", :type => :view do it "should not present syncing infos and button" do expect(view.content_for(:page_header_actions)).to_not have_selector("a[href=\"#{view.sync_line_referential_path(line_referential)}\"]") - expect(view.content_for(:page_header_meta)).to_not have_selector(".last-update") end with_permission "line_referentials.synchronize" do it "should present syncing infos and button" do expect(view.content_for(:page_header_actions)).to have_selector("a[href=\"#{view.sync_line_referential_path(line_referential)}\"]", count: 1) - expect(view.content_for(:page_header_meta)).to have_selector(".last-update", count: 1) end end end diff --git a/spec/views/line_referentials/stop_area_referentials/show.html.slim_spec.rb b/spec/views/line_referentials/stop_area_referentials/show.html.slim_spec.rb deleted file mode 100644 index 71a8d16f5..000000000 --- a/spec/views/line_referentials/stop_area_referentials/show.html.slim_spec.rb +++ /dev/null @@ -1,22 +0,0 @@ -require 'spec_helper' - -describe "/stop_area_referentials/show", :type => :view do - - let!(:stop_area_referential) { assign :stop_area_referential, create(:stop_area_referential) } - - before :each do - render - end - - it "should not present syncing infos and button" do - expect(view.content_for(:page_header_actions)).to_not have_selector("a[href=\"#{view.sync_stop_area_referential_path(stop_area_referential)}\"]") - expect(view.content_for(:page_header_meta)).to_not have_selector(".last-update") - end - - with_permission "stop_area_referentials.synchronize" do - it "should present syncing infos and button" do - expect(view.content_for(:page_header_actions)).to have_selector("a[href=\"#{view.sync_stop_area_referential_path(stop_area_referential)}\"]", count: 1) - expect(view.content_for(:page_header_meta)).to have_selector(".last-update", count: 1) - end - end -end diff --git a/spec/views/stop_area_referentials/show.html.slim_spec.rb b/spec/views/stop_area_referentials/show.html.slim_spec.rb new file mode 100644 index 000000000..a7567a969 --- /dev/null +++ b/spec/views/stop_area_referentials/show.html.slim_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe "/stop_area_referentials/show", :type => :view do + + let!(:stop_area_referential) { assign :stop_area_referential, create(:stop_area_referential) } + + before :each do + render + end + + it "should not present syncing infos and button" do + expect(view.content_for(:page_header_actions)).to_not have_selector("a[href=\"#{view.sync_stop_area_referential_path(stop_area_referential)}\"]") + end + + with_permission "stop_area_referentials.synchronize" do + it "should present syncing infos and button" do + expect(view.content_for(:page_header_actions)).to have_selector("a[href=\"#{view.sync_stop_area_referential_path(stop_area_referential)}\"]", count: 1) + end + end +end -- cgit v1.2.3