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
spree-0.11.1 vendor/plugins/resource_controller/generators/scaffold_resource/templates/rspec/views/edit_spec.rb
rd_resource_controller-1.0.0.rc generators/scaffold_resource/templates/rspec/views/edit_spec.rb
spree-0.11.0 vendor/plugins/resource_controller/generators/scaffold_resource/templates/rspec/views/edit_spec.rb
matid-resource_controller-0.7.2 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
matid-resource_controller-0.7.1 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
matid-resource_controller-0.7.0 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
resource_controller_views-0.6.6.views2 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
spree-0.10.2 vendor/plugins/resource_controller/generators/scaffold_resource/templates/rspec/views/edit_spec.rb
matid-resource_controller-0.6.7 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
resource_controller_views-0.6.6 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
spree-0.10.1 vendor/plugins/resource_controller/generators/scaffold_resource/templates/rspec/views/edit_spec.rb
spree-0.10.0 vendor/plugins/resource_controller/generators/scaffold_resource/templates/rspec/views/edit_spec.rb
spree-0.10.0.beta vendor/plugins/resource_controller/generators/scaffold_resource/templates/rspec/views/edit_spec.rb
spree-enriquez-0.9.4 vendor/plugins/resource_controller/generators/scaffold_resource/templates/rspec/views/edit_spec.rb
resource_controller-0.6.6 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
Pr0d1r2-resource_controller-0.6.6 generators/scaffold_resource/templates/rspec/views/edit_spec.rb
spree-0.9.4 vendor/plugins/resource_controller/generators/scaffold_resource/templates/rspec/views/edit_spec.rb
spree-0.9.3 vendor/plugins/resource_controller/generators/scaffold_resource/templates/rspec/views/edit_spec.rb
spree-0.9.2 vendor/plugins/resource_controller/generators/scaffold_resource/templates/rspec/views/edit_spec.rb
matid-resource_controller-0.6.6 generators/scaffold_resource/templates/rspec/views/edit_spec.rb