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