aboutsummaryrefslogtreecommitdiffstats
path: root/spec/views/lines/index.html.erb_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/views/lines/index.html.erb_spec.rb')
-rw-r--r--spec/views/lines/index.html.erb_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/views/lines/index.html.erb_spec.rb b/spec/views/lines/index.html.erb_spec.rb
new file mode 100644
index 000000000..dee3565f4
--- /dev/null
+++ b/spec/views/lines/index.html.erb_spec.rb
@@ -0,0 +1,25 @@
+require 'spec_helper'
+
+describe "/lines/index" do
+
+ let!(:network) { assign( :network, Factory(:network) ) }
+ let!(:lines) { assign( :lines, Array.new(2) { Factory(:line, :network => network) } ) }
+
+ before :each do
+ rendered.stub(:collection).and_return( lines.order_by [[:code, :asc]] )
+ view.stub(:link_to_order).and_return( "#" )
+ end
+
+ it "should render a show link for each group" do
+ render
+ lines.each do |line|
+ rendered.should have_selector(".line a[href='#{view.line_path(line)}']", :text => line.name)
+ end
+ end
+
+ it "should render a link to create a new group" do
+ render
+ view.content_for(:sidebar).should have_selector(".actions a[href='#{new_network_line_path(network)}']")
+ end
+
+end