Sha256: 5ebf2cdf55194f5c7fbc5565e0951f9e5bb372d0ae38cd2dc2de9a49a09c1631

Contents?: true

Size: 1016 Bytes

Versions: 7

Compression:

Stored size: 1016 Bytes

Contents

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

describe "/<%= name %>/edit.<%= 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 edit form" do
    render "/<%= name.pluralize %>/edit.<%= default_file_extension %>"
    
    response.should have_tag("form[action=#{<%= table_name.singularize %>_path(@<%= file_name %>)}][method=post]") do
<% for attribute in attributes -%><% unless attribute.name =~ /_id/ || [:datetime, :timestamp, :time, :date].index(attribute.type) -%>
      with_tag('<%= attribute.input_type -%>#<%= file_name %>_<%= attribute.name %>[name=?]', "<%= file_name %>[<%= attribute.name %>]")
<% end -%><% 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/edit_haml_spec.rb
jeffkreeftmeijer-awesome_scaffold-0.0.0 lib/templates/edit_haml_spec.rb
jeffkreeftmeijer-awesome_scaffold-0.0.1 lib/templates/edit_haml_spec.rb
dm-haml-scaffold-generator-0.0.4 generators/dm_haml_scaffold/templates/edit_haml_spec.rb
dm-haml-scaffold-generator-0.0.3 generators/dm_haml_scaffold/templates/edit_haml_spec.rb
dm-haml-scaffold-generator-0.0.2 generators/dm_haml_scaffold/templates/edit_haml_spec.rb
dm-haml-scaffold-generator-0.0.1 generators/dm_haml_scaffold/templates/edit_haml_spec.rb