Sha256: 2f7bfd42869a5f855806af94b039bdc31faf49b3ed1be0aa349761bd6a691251
Contents?: true
Size: 1.19 KB
Versions: 82
Compression:
Stored size: 1.19 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * controller_class_nesting_depth %>/../../spec_helper') describe "/<%= table_name %>/edit.<%= default_file_extension %>" do include <%= controller_class_name %>Helper before do @<%= file_name %> = mock_model(<%= class_name %>) <% for attribute in attributes -%> @<%= file_name %>.stub!(:<%= attribute.name %>).and_return(<%= attribute.default_value %>) <% end -%> assigns[:<%= file_name %>] = @<%= file_name %> template.should_receive(:object_url).twice.and_return(<%= file_name %>_path(@<%= file_name %>)) template.should_receive(:collection_url).and_return(<%= file_name.pluralize %>_path) end it "should render edit form" do render "/<%= table_name %>/edit.<%= default_file_extension %>" response.should have_tag("form[action=#{<%= file_name %>_path(@<%= file_name %>)}][method=post]") do <% for attribute in attributes -%><% unless attribute.name =~ /_id/ || [:datetime, :timestamp, :time, :date].index(attribute.type) -%> with_tag('<%= attribute.input_type -%>#<%= file_name %>_<%= attribute.name %>[name=?]', "<%= file_name %>[<%= attribute.name %>]") <% end -%><% end -%> end end end
Version data entries
82 entries across 82 versions & 22 rubygems