Sha256: 24444894b85139b829faf168469a924f5f5b7b155c066d69a672e3956b0726e7
Contents?: true
Size: 832 Bytes
Versions: 4
Compression:
Stored size: 832 Bytes
Contents
require File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../../spec_helper' describe "/<%= table_name %>/show.<%= 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 %> 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
4 entries across 4 versions & 2 rubygems