Sha256: 2f7bfd42869a5f855806af94b039bdc31faf49b3ed1be0aa349761bd6a691251

Contents?: true

Size: 1.19 KB

Versions: 82

Compression:

Stored size: 1.19 KB

Contents

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

describe "/<%= table_name %>/edit.<%= default_file_extension %>" do
  include <%= controller_class_name %>Helper
  
  before 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 %>

    template.should_receive(:object_url).twice.and_return(<%= file_name %>_path(@<%= file_name %>)) 
    template.should_receive(:collection_url).and_return(<%= file_name.pluralize %>_path) 
  end

  it "should render edit form" do
    render "/<%= table_name %>/edit.<%= default_file_extension %>"
    
    response.should have_tag("form[action=#{<%= file_name %>_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

82 entries across 82 versions & 22 rubygems

Version Path
akitaonrails-resource_controller-0.5.2 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
akitaonrails-resource_controller-0.5.3 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
csmosx-resource_controller-0.6.6 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
csmosx-resource_controller-0.6.7 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
dkubb-resource_controller-0.6.5 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
giraffesoft-resource_controller-0.4.10 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
giraffesoft-resource_controller-0.4.12 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
giraffesoft-resource_controller-0.4.9 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
giraffesoft-resource_controller-0.5.2 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
giraffesoft-resource_controller-0.5.3 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
giraffesoft-resource_controller-0.5.5 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
giraffesoft-resource_controller-0.5.6 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
giraffesoft-resource_controller-0.6.0 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
giraffesoft-resource_controller-0.6.1 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
giraffesoft-resource_controller-0.6.5 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
jeffrafter-resource_controller-0.5.5 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
kdmny-spree-0.0.1 vendor/plugins/resource_controller/generators/scaffold_resource/templates/rspec/views/edit_spec.rb
korin-resource_controller-0.5.3 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
maser-resource_controller-0.6.6 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
nileshtrivedi-lp_resource_builder-0.5.1 generators/scaffold_resource/templates/rspec/views/edit_spec.rb