Sha256: 7be250fb2cb306156e6ad028138ca2c13c06676b5f45e1cccd407a7792bdfbbd

Contents?: true

Size: 755 Bytes

Versions: 2

Compression:

Stored size: 755 Bytes

Contents

require File.dirname(__FILE__) + '/../test_helper'

class PeopleControllerTest < ActionController::TestCase
  def setup
    @person = accounts :one
  end

  should_be_restful do |resource|
    resource.formats = [:html]
    resource.klass   = Account
    resource.object  = :person
    
    resource.create.redirect = 'person_url(@person)'
    resource.update.redirect = 'person_url(@person)'
    resource.destroy.redirect = 'people_url'
  end
  
  context "scaffolding" do
    
    should "render scaffold new view" do
      get :new
    end
    
  end
  
  context "before create" do
    setup do
      post :create, :person => {}
    end

    should "name account Bob Loblaw" do
      assert_equal "Bob Loblaw", assigns(:person).name
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
resource_controller_views-0.6.6.views2 test/test/functional/people_controller_test.rb
resource_controller_views-0.6.6 test/test/functional/people_controller_test.rb