Sha256: f8c7a53cf2fdbcf42c370353c4f7f04a8df30ee3e2fa1b4e52e24a66f6ef52b5

Contents?: true

Size: 827 Bytes

Versions: 9

Compression:

Stored size: 827 Bytes

Contents

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

describe "/<%= table_name %>/new.<%= default_file_extension %>" do
  include <%= controller_class_name %>Helper
  
  before(:each) do
    @<%= file_name %> = Factory(:<%= file_name %>)
    @<%= file_name %>.stub!(:new_record?).and_return(true)
    assigns[:<%= file_name %>] = @<%= file_name %>


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

  it "should render new form" do
    render "/<%= table_name %>/new.<%= default_file_extension %>"
    
    response.should have_tag("form[action=?][method=post]", <%= table_name %>_path) do
      # Test attributes here
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
Objective3-objective_spec-0.0.2 generators/objective_resource/templates/rspec/views/new_spec.rb
Objective3-objective_spec-0.0.3 generators/objective_resource/templates/rspec/views/new_spec.rb
Objective3-objective_spec-0.0.4 generators/objective_resource/templates/rspec/views/new_spec.rb
Objective3-objective_spec-0.1.2 generators/objective_resource/templates/rspec/views/new_spec.rb
Objective3-objective_spec-0.1.3 generators/objective_resource/templates/rspec/views/new_spec.rb
Objective3-objective_spec-0.1.4 generators/objective_resource/templates/rspec/views/new_spec.rb
objective_spec-0.3.1 generators/objective_resource/templates/rspec/views/new_spec.rb
objective_spec-0.3.0 generators/objective_resource/templates/rspec/views/new_spec.rb
objective_spec-0.2.0 generators/objective_resource/templates/rspec/views/new_spec.rb