Sha256: 055ec1366be0babe88d14e81456ac76ea4b6eba8b9804aad59ba2e7f0a084eae

Contents?: true

Size: 837 Bytes

Versions: 3

Compression:

Stored size: 837 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(: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 %>
  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

3 entries across 3 versions & 1 rubygems

Version Path
picolena-0.1.6 rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
picolena-0.1.7 rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
picolena-0.1.8 rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb