aboutsummaryrefslogtreecommitdiffstats
path: root/spec/views
diff options
context:
space:
mode:
authorZog2017-12-15 11:27:14 +0100
committerZog2017-12-19 14:40:38 +0100
commit357563bbf408aa2000097ee200dfbfba1f677121 (patch)
tree295d5a413c3b5e0d592fd1d700f713746134120f /spec/views
parent676f45e8fd85c1422345d4d27ba2385e4bd536fe (diff)
downloadchouette-core-357563bbf408aa2000097ee200dfbfba1f677121.tar.bz2
- Fix specs on connections_links/index
- Fix specs on connections_links/show - Update pundit view specs helper to use the current referential when it has already been defined
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/connection_links/index.html.erb_spec.rb8
-rw-r--r--spec/views/connection_links/show.html.erb_spec.rb23
2 files changed, 15 insertions, 16 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
index c04a4f3f1..afe94fc6c 100644
--- a/spec/views/connection_links/show.html.erb_spec.rb
+++ b/spec/views/connection_links/show.html.erb_spec.rb
@@ -15,21 +15,18 @@ describe "/connection_links/show", :type => :view do
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)}']")
+ with_permission "connection_links.update" do
+ 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
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']")
+ with_permission "connection_links.destroy" do
+ 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
end
-