Sha256: c84dc64453e9c6da44147a3b6bd4372704b2d8f3db50f568a701f62ab1568ffb
Contents?: true
Size: 1.02 KB
Versions: 82
Compression:
Stored size: 1.02 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * controller_class_nesting_depth %>/../../spec_helper') describe "/<%= table_name %>/show.<%= default_file_extension %>" do include <%= controller_class_name %>Helper before(:each) 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.stub!(:edit_object_url).and_return(edit_<%= file_name %>_path(@<%= file_name %>)) template.stub!(:collection_url).and_return(<%= file_name.pluralize %>_path) end it "should render attributes in <p>" do render "/<%= table_name %>/show.<%= default_file_extension %>" <% for attribute in attributes -%><% unless attribute.name =~ /_id/ || [:datetime, :timestamp, :time, :date].index(attribute.type) -%> response.should have_text(/<%= Regexp.escape(attribute.default_value)[1..-2]%>/) <% end -%><% end -%> end end
Version data entries
82 entries across 82 versions & 22 rubygems