aboutsummaryrefslogtreecommitdiffstats
path: root/spec/views
diff options
context:
space:
mode:
authorZog2018-05-29 10:18:16 +0200
committerJohan Van Ryseghem2018-05-30 16:29:33 +0200
commit3e8d95ac8168205ac9526fb8663459d691d09c30 (patch)
treefd2bc220473f4defe30a35668d6b9eead76f00fa /spec/views
parent971b267958c3bf78abea332e0af4c46a23679b61 (diff)
downloadchouette-core-3e8d95ac8168205ac9526fb8663459d691d09c30.tar.bz2
Refs #6433; Fix specs
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/connection_links/edit.html.erb_spec.rb24
-rw-r--r--spec/views/connection_links/index.html.erb_spec.rb27
-rw-r--r--spec/views/connection_links/new.html.erb_spec.rb17
-rw-r--r--spec/views/connection_links/show.html.slim_spec.rb32
-rw-r--r--spec/views/timebands/edit.html.erb_spec.rb24
-rw-r--r--spec/views/timebands/index.html.erb_spec.rb20
-rw-r--r--spec/views/timebands/new.html.erb_spec.rb18
-rw-r--r--spec/views/timebands/show.html.erb_spec.rb24
8 files changed, 0 insertions, 186 deletions
diff --git a/spec/views/connection_links/edit.html.erb_spec.rb b/spec/views/connection_links/edit.html.erb_spec.rb
deleted file mode 100644
index 963375454..000000000
--- a/spec/views/connection_links/edit.html.erb_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'spec_helper'
-
-describe "/connection_links/edit", :type => :view do
- assign_referential
- let!(:connection_link) { assign(:connection_link, create(:connection_link)) }
- let!(:connection_links) { Array.new(2) { create(:connection_link) } }
-
- describe "test" do
- it "should render h2 with the connection_link name" do
- render
- expect(rendered).to have_selector("h2", :text => Regexp.new(connection_link.name))
- end
- end
-
- describe "form" do
- it "should render input for name" do
- render
- expect(rendered).to have_selector("form") do
- with_tag "input[type=text][name='connection_link[name]'][value=?]", connection_link.name
- end
- end
- end
-
-end
diff --git a/spec/views/connection_links/index.html.erb_spec.rb b/spec/views/connection_links/index.html.erb_spec.rb
deleted file mode 100644
index 1f133e31e..000000000
--- a/spec/views/connection_links/index.html.erb_spec.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require 'spec_helper'
-
-describe "/connection_links/index", :type => :view do
-
- assign_referential
- let!(:connection_links) { assign :connection_links, Array.new(2) { create(:connection_link) }.paginate }
- let!(:search) { assign :q, Ransack::Search.new(Chouette::ConnectionLink) }
-
- before do
- allow(view).to receive_messages(current_organisation: referential.organisation)
- end
-
- it "should render a show link for each group" do
- render
- connection_links.each do |connection_link|
- expect(rendered).to have_selector(".connection_link a[href='#{view.referential_connection_link_path(referential, connection_link)}']", :text => connection_link.name)
- end
- end
-
- 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/new.html.erb_spec.rb b/spec/views/connection_links/new.html.erb_spec.rb
deleted file mode 100644
index 8d17bbe8b..000000000
--- a/spec/views/connection_links/new.html.erb_spec.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require 'spec_helper'
-
-describe "/connection_links/new", :type => :view do
- assign_referential
- let!(:connection_link) { assign(:connection_link, build(:connection_link)) }
-
- describe "form" do
-
- it "should render input for name" do
- render
- expect(rendered).to have_selector("form") do
- with_selector "input[type=text][name=?]", connection_link.name
- end
- end
-
- end
-end
diff --git a/spec/views/connection_links/show.html.slim_spec.rb b/spec/views/connection_links/show.html.slim_spec.rb
deleted file mode 100644
index afe94fc6c..000000000
--- a/spec/views/connection_links/show.html.slim_spec.rb
+++ /dev/null
@@ -1,32 +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
-
- 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
-
- 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
diff --git a/spec/views/timebands/edit.html.erb_spec.rb b/spec/views/timebands/edit.html.erb_spec.rb
deleted file mode 100644
index 5f6051884..000000000
--- a/spec/views/timebands/edit.html.erb_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'spec_helper'
-
-describe "/timebands/edit", :type => :view do
- assign_referential
- let!(:timeband) { assign(:timeband, create(:timeband) ) }
-
- describe "test" do
- it "should render h2 with the group name" do
- render
- expect(rendered).to have_selector("h2", text: Regexp.new(timeband.name))
- end
- end
-
- describe "form" do
- it "should render input for timeband" do
- render
- expect(rendered).to have_field('timeband[name]')
- expect(rendered).to have_field('timeband[start_time(4i)]')
- expect(rendered).to have_field('timeband[start_time(5i)]')
- expect(rendered).to have_selector('button[type=submit]')
- end
-
- end
-end
diff --git a/spec/views/timebands/index.html.erb_spec.rb b/spec/views/timebands/index.html.erb_spec.rb
deleted file mode 100644
index 0ce0c419c..000000000
--- a/spec/views/timebands/index.html.erb_spec.rb
+++ /dev/null
@@ -1,20 +0,0 @@
-require 'spec_helper'
-
-describe "/timebands/index", :type => :view do
-
- assign_referential
- let!(:timebands) { assign :timebands, Array.new(2){ create(:timeband) }.paginate }
-
- it "should render a show link for each timeband" do
- render
- timebands.each do |timeband|
- expect(rendered).to have_selector("a[href='#{view.referential_timeband_path(referential, timeband)}']", :text => timeband.name)
- end
- end
-
- it "should render a link to create a new timeband" do
- render
- expect(view.content_for(:sidebar)).to have_selector(".actions a[href='#{new_referential_timeband_path(referential)}']")
- end
-
-end
diff --git a/spec/views/timebands/new.html.erb_spec.rb b/spec/views/timebands/new.html.erb_spec.rb
deleted file mode 100644
index f5e85f20c..000000000
--- a/spec/views/timebands/new.html.erb_spec.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require 'spec_helper'
-
-describe "/timebands/new", :type => :view do
- assign_referential
- let!(:timeband) { assign(:timeband, build(:timeband)) }
-
- describe "form" do
-
- it "should render inputs" do
- render
- expect(rendered).to have_field('timeband[name]')
- expect(rendered).to have_field('timeband[start_time(4i)]')
- expect(rendered).to have_field('timeband[start_time(5i)]')
- expect(rendered).to have_selector('button[type=submit]')
- end
-
- end
-end
diff --git a/spec/views/timebands/show.html.erb_spec.rb b/spec/views/timebands/show.html.erb_spec.rb
deleted file mode 100644
index d43ba588c..000000000
--- a/spec/views/timebands/show.html.erb_spec.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'spec_helper'
-
-describe "/timebands/show", :type => :view do
-
- assign_referential
- let!(:timeband) { assign(:timeband, create(:timeband)) }
-
- it "should render h2 with the timeband name" do
- render
- expect(rendered).to have_selector("h2", text: Regexp.new(timeband.name))
- end
-
- it "should render a link to edit the timeband" do
- render
- expect(view.content_for(:sidebar)).to have_selector(".actions a[href='#{view.edit_referential_timeband_path(referential, timeband)}']")
- end
-
- it "should render a link to remove the timeband" do
- render
- expect(view.content_for(:sidebar)).to have_selector(".actions a[href='#{view.referential_timeband_path(referential, timeband)}'][class='remove']")
- end
-
-end
-