diff options
Diffstat (limited to 'spec/views')
| -rw-r--r-- | spec/views/connection_links/index.html.erb_spec.rb | 8 | ||||
| -rw-r--r-- | spec/views/connection_links/show.html.erb_spec.rb | 35 | ||||
| -rw-r--r-- | spec/views/offer_workbenches/show.html.erb_spec.rb | 1 | ||||
| -rw-r--r-- | spec/views/stop_areas/index.html.erb_spec.rb | 25 | ||||
| -rw-r--r-- | spec/views/stop_areas/index.html.slim_spec.rb | 4 | 
5 files changed, 7 insertions, 66 deletions
| diff --git a/spec/views/connection_links/index.html.erb_spec.rb b/spec/views/connection_links/index.html.erb_spec.rb index a01380094..1f133e31e 100644 --- a/spec/views/connection_links/index.html.erb_spec.rb +++ b/spec/views/connection_links/index.html.erb_spec.rb @@ -17,9 +17,11 @@ describe "/connection_links/index", :type => :view do      end    end -  it "should render a link to create a new group" do -    render -    expect(view.content_for(:sidebar)).to have_selector(".actions a[href='#{new_referential_connection_link_path(referential)}']") +  with_permission "connection_links.create" do +    it "should render a link to create a new group" do +      render +      expect(view.content_for(:sidebar)).to have_selector(".actions a[href='#{new_referential_connection_link_path(referential)}']") +    end    end  end diff --git a/spec/views/connection_links/show.html.erb_spec.rb b/spec/views/connection_links/show.html.erb_spec.rb deleted file mode 100644 index c04a4f3f1..000000000 --- a/spec/views/connection_links/show.html.erb_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -require 'spec_helper' - -describe "/connection_links/show", :type => :view do - -  assign_referential -  let!(:connection_link) { assign(:connection_link, create(:connection_link)) } -  let!(:map) { assign(:map, double(:to_html => '<div id="map"/>'.html_safe)) } - -  before do -    allow(view).to receive_messages(current_organisation: referential.organisation) -  end - -  it "should render h2 with the connection_link name" do -    render -    expect(rendered).to have_selector("h2", :text => Regexp.new(connection_link.name)) -  end - -#  it "should display a map with class 'connection_link'" do -#    pending ": map not yet implemented" -#     render -#     expect(rendered).to have_selector("#map", :class => 'connection_link') -#  end - -  it "should render a link to edit the connection_link" do -    render -    expect(view.content_for(:sidebar)).to have_selector(".actions a[href='#{view.edit_referential_connection_link_path(referential, connection_link)}']") -  end - -  it "should render a link to remove the connection_link" do -    render -    expect(view.content_for(:sidebar)).to have_selector(".actions a[href='#{view.referential_connection_link_path(referential, connection_link)}'][class='remove']") -  end - -end - diff --git a/spec/views/offer_workbenches/show.html.erb_spec.rb b/spec/views/offer_workbenches/show.html.erb_spec.rb index cc01c9d0e..138a1560d 100644 --- a/spec/views/offer_workbenches/show.html.erb_spec.rb +++ b/spec/views/offer_workbenches/show.html.erb_spec.rb @@ -53,5 +53,4 @@ describe "workbenches/show", :type => :view do        expect(rendered).to have_box_for_item different_organisation_referential, true      end    end -  end diff --git a/spec/views/stop_areas/index.html.erb_spec.rb b/spec/views/stop_areas/index.html.erb_spec.rb deleted file mode 100644 index 2dfae1bfd..000000000 --- a/spec/views/stop_areas/index.html.erb_spec.rb +++ /dev/null @@ -1,25 +0,0 @@ -require 'spec_helper' - -describe "/stop_areas/index", :type => :view do - -  let!(:stop_area_referential) { assign :stop_area_referential, create(:stop_area_referential) } -  let!(:stop_areas) { assign :stop_areas, Array.new(2) { create(:stop_area, stop_area_referential: stop_area_referential) }.paginate } -  let!(:q) { assign :q, Ransack::Search.new(Chouette::StopArea) } - -  before :each do -    allow(view).to receive(:link_with_search).and_return("#") -  end - -  # it "should render a show link for each group" do -  #   render -  #   stop_areas.each do |stop_area| -  #     expect(rendered).to have_selector(".stop_area a[href='#{view.stop_area_referential_stop_area_path(stop_area_referential, stop_area)}']", :text => stop_area.name) -  #   end -  # end -  # -  # it "should render a link to create a new group" do -  #   render -  #   expect(view.content_for(:sidebar)).to have_selector(".actions a[href='#{new_stop_area_referential_stop_area_path(stop_area_referential)}']") -  # end - -end diff --git a/spec/views/stop_areas/index.html.slim_spec.rb b/spec/views/stop_areas/index.html.slim_spec.rb index ecd76fb03..8daa5eb4b 100644 --- a/spec/views/stop_areas/index.html.slim_spec.rb +++ b/spec/views/stop_areas/index.html.slim_spec.rb @@ -21,8 +21,8 @@ describe "/stop_areas/index", :type => :view do    with_permission "stop_areas.create" do      it { should have_link_for_each_item(stop_areas, "show", -> (stop_area){ view.stop_area_referential_stop_area_path(stop_area_referential, stop_area) }) } -    it { should have_link_for_each_item(stop_areas, "create", -> (stop_area){ view.new_stop_area_referential_stop_area_path(stop_area_referential) }) } -    it { should have_the_right_number_of_links(stop_areas, 2) } +    it { should_not have_link_for_each_item(stop_areas, "create", -> (stop_area){ view.new_stop_area_referential_stop_area_path(stop_area_referential) }) } +    it { should have_the_right_number_of_links(stop_areas, 1) }    end    with_permission "stop_areas.update" do | 
