aboutsummaryrefslogtreecommitdiffstats
path: root/spec/views/lines/show.html.erb_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/views/lines/show.html.erb_spec.rb')
-rw-r--r--spec/views/lines/show.html.erb_spec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/views/lines/show.html.erb_spec.rb b/spec/views/lines/show.html.erb_spec.rb
new file mode 100644
index 000000000..14f315333
--- /dev/null
+++ b/spec/views/lines/show.html.erb_spec.rb
@@ -0,0 +1,30 @@
+require 'spec_helper'
+
+describe "/lines/show" do
+
+ let!(:network) { assign(:network, Factory(:network)) }
+ let!(:line) { assign(:line, Factory(:line, :network => network)) }
+ let!(:map) { assign(:map, LineMap.new(line) ) }
+
+ it "should render h2 with the line name" do
+ render
+ rendered.should have_selector("h2", :text => Regexp.new(line.name))
+ end
+
+ it "should display a map with class 'line'" do
+ render
+ rendered.should have_selector("#map", :class => 'line')
+ end
+
+ it "should render a link to edit the line" do
+ render
+ view.content_for(:sidebar).should have_selector(".actions a[href='#{view.edit_line_path(line)}']")
+ end
+
+ it "should render a link to remove the line" do
+ render
+ view.content_for(:sidebar).should have_selector(".actions a[href='#{view.line_path(line)}'][class='remove']")
+ end
+
+end
+