Sha256: e3eca59d4daad8878f672cf3ada06d45bc1b0b483b5f418c30eb920bc0b3a8f5

Contents?: true

Size: 854 Bytes

Versions: 7

Compression:

Stored size: 854 Bytes

Contents

require File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../../spec_helper'

describe "/<%= name.pluralize %>/show.<%= default_file_extension %>" do
  include <%= controller_class_name %>Helper
  
  before do
    @<%= file_name %> = mock_model(<%= singular_name.capitalize %>)
<% 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 "/<%= name.pluralize %>/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

7 entries across 7 versions & 3 rubygems

Version Path
chendo-rspec-haml-scaffold-generator-1.0.1 generators/rspec_haml_scaffold/templates/show_haml_spec.rb
jeffkreeftmeijer-awesome_scaffold-0.0.0 lib/templates/show_haml_spec.rb
jeffkreeftmeijer-awesome_scaffold-0.0.1 lib/templates/show_haml_spec.rb
dm-haml-scaffold-generator-0.0.4 generators/dm_haml_scaffold/templates/show_haml_spec.rb
dm-haml-scaffold-generator-0.0.3 generators/dm_haml_scaffold/templates/show_haml_spec.rb
dm-haml-scaffold-generator-0.0.2 generators/dm_haml_scaffold/templates/show_haml_spec.rb
dm-haml-scaffold-generator-0.0.1 generators/dm_haml_scaffold/templates/show_haml_spec.rb