Sha256: 91ecfdb77bb602408a526e1db620e0a2b7642d8da3ade8a9d5ab46d173122acf

Contents?: true

Size: 839 Bytes

Versions: 25

Compression:

Stored size: 839 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

25 entries across 25 versions & 4 rubygems

Version Path
picolena-0.0.99 app_generators/picolena/templates/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
picolena-0.1.0 rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
picolena-0.1.1 rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
picolena-0.1.4 rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
picolena-0.1.3 rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
picolena-0.1.2 rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
picolena-0.1.5 rails_plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
radiant-0.6.5.1 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
radiant-0.6.5 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
radiant-0.6.6 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
radiant-0.6.7 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
radiant-0.6.8 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
radiant-0.6.9 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
spree-0.0.9 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
spree-0.0.8 starter-app/vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
spree-0.2.0 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
typo-5.0.2 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
typo-5.0.1 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
typo-5.0.3.98.1 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb
typo-5.0.3.98 vendor/plugins/rspec_on_rails/generators/rspec_scaffold/templates/show_erb_spec.rb