1require File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../../spec_helper'
2
3describe "/<%= table_name %>/edit.<%= default_file_extension %>" do
4 include <%= controller_class_name %>Helper
5
6 before do
7 @<%= file_name %> = mock_model(<%= class_name %>)
8<% for attribute in attributes -%>
9 @<%= file_name %>.stub!(:<%= attribute.name %>).and_return(<%= attribute.default_value %>)
10<% end -%>
11 assigns[:<%= file_name %>] = @<%= file_name %>
12 end
13
14 it "should render edit form" do
15 render "/<%= table_name %>/edit.<%= default_file_extension %>"
16
17 response.should have_tag("form[action=#{<%= file_name %>_path(@<%= file_name %>)}][method=post]") do
18<% for attribute in attributes -%><% unless attribute.name =~ /_id/ || [:datetime, :timestamp, :time, :date].index(attribute.type) -%>
19 with_tag('<%= attribute.input_type -%>#<%= file_name %>_<%= attribute.name %>[name=?]', "<%= file_name %>[<%= attribute.name %>]")
20<% end -%><% end -%>
21 end
22 end
23end
24
25