diff options
Diffstat (limited to 'spec/views')
| -rw-r--r-- | spec/views/line_referentials/show.html.slim_spec.rb | 22 | ||||
| -rw-r--r-- | spec/views/line_referentials/stop_area_referentials/show.html.slim_spec.rb | 22 | 
2 files changed, 44 insertions, 0 deletions
| diff --git a/spec/views/line_referentials/show.html.slim_spec.rb b/spec/views/line_referentials/show.html.slim_spec.rb new file mode 100644 index 000000000..0516677cb --- /dev/null +++ b/spec/views/line_referentials/show.html.slim_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +describe "/line_referentials/show", :type => :view do + +  let!(:line_referential) { assign :line_referential, create(:line_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_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 new file mode 100644 index 000000000..71a8d16f5 --- /dev/null +++ b/spec/views/line_referentials/stop_area_referentials/show.html.slim_spec.rb @@ -0,0 +1,22 @@ +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 | 
