Sha256: d29e8c63a64687f1810312522fed7d22ffe73ef40fdc70e19107ee329153d55a

Contents?: true

Size: 949 Bytes

Versions: 7

Compression:

Stored size: 949 Bytes

Contents

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

describe "/<%= name.pluralize %>/index.<%= default_file_extension %>" do
  include <%= controller_class_name %>Helper
  
  before do
<% [98,99].each do |id| -%>
    <%= file_name %>_<%= id %> = mock_model(<%= singular_name.capitalize %>)
<% for attribute in attributes -%>
    <%= file_name %>_<%= id %>.should_receive(:<%= attribute.name %>).and_return(<%= attribute.default_value %>)
<% end -%><% end %>
    assigns[:<%= file_name.pluralize %>] = [<%= file_name %>_98, <%= file_name %>_99]
  end

  it "should render list of <%= table_name %>" do
    render "/<%= name.pluralize %>/index.<%= default_file_extension %>"
<% for attribute in attributes -%><% unless attribute.name =~ /_id/ || [:datetime, :timestamp, :time, :date].index(attribute.type) -%>
    response.should have_tag("tr>td", <%= attribute.default_value %>, 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/index_haml_spec.rb
jeffkreeftmeijer-awesome_scaffold-0.0.0 lib/templates/index_haml_spec.rb
jeffkreeftmeijer-awesome_scaffold-0.0.1 lib/templates/index_haml_spec.rb
dm-haml-scaffold-generator-0.0.4 generators/dm_haml_scaffold/templates/index_haml_spec.rb
dm-haml-scaffold-generator-0.0.3 generators/dm_haml_scaffold/templates/index_haml_spec.rb
dm-haml-scaffold-generator-0.0.2 generators/dm_haml_scaffold/templates/index_haml_spec.rb
dm-haml-scaffold-generator-0.0.1 generators/dm_haml_scaffold/templates/index_haml_spec.rb