aboutsummaryrefslogtreecommitdiffstats
path: root/spec/views/lines/edit.html.erb_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/views/lines/edit.html.erb_spec.rb')
-rw-r--r--spec/views/lines/edit.html.erb_spec.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/views/lines/edit.html.erb_spec.rb b/spec/views/lines/edit.html.erb_spec.rb
new file mode 100644
index 000000000..f889410ee
--- /dev/null
+++ b/spec/views/lines/edit.html.erb_spec.rb
@@ -0,0 +1,33 @@
+require 'spec_helper'
+
+describe "/lines/edit" do
+ let!(:network) { assign(:network, Factory(:network)) }
+ let!(:line) { assign(:line, Factory(:line, :network => network)) }
+ let!(:lines) { Array.new(2) { Factory(:line, :network => network) } }
+
+ describe "test" do
+ it "should render h2 with the group name" do
+ render
+ rendered.should have_selector("h2", :text => Regexp.new(line.name))
+ end
+ end
+
+ describe "form" do
+ it "should render input for name" do
+ render
+ rendered.should have_selector("form") do
+ with_tag "input[type=text][name='line[name]'][value=?]", line.name
+ end
+ end
+
+ it "should render a checkbox for each line" do
+ render
+ lines.each do |line|
+ rendered.should have_selector("form") do
+ with_tag "input[type='checkbox'][value=?]", line.id
+ end
+ end
+
+ end
+ end
+end