Sha256: d21d631964794da5ed8a743c021455b586c9517530aff22a3e6bf634b38c247a

Contents?: true

Size: 843 Bytes

Versions: 33

Compression:

Stored size: 843 Bytes

Contents

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

# Re-raise errors caught by the controller.
class PostsController; def rescue_action(e) raise e end; end

class PostsControllerTest < Test::Unit::TestCase
  def setup
    @controller = PostsController.new
    @request    = ActionController::TestRequest.new
    @response   = ActionController::TestResponse.new
    @post       = Post.find 1
  end
  
  should_be_restful do |resource|
    resource.formats = [:html]

    resource.actions = :all
  end
  
  context "on post to :create" do
    setup do
      post :create, :post => {}
    end

    should "name the post 'a great post'" do
      assert_equal 'a great post', assigns(:post).title
    end
    
    should "give the post a body of '...'" do
      assert_equal '...', assigns(:post).body
    end
  end
end

Version data entries

33 entries across 33 versions & 9 rubygems

Version Path
akitaonrails-resource_controller-0.5.2 test/test/functional/posts_controller_test.rb
akitaonrails-resource_controller-0.5.3 test/test/functional/posts_controller_test.rb
giraffesoft-resource_controller-0.4.10 test/test/functional/posts_controller_test.rb
giraffesoft-resource_controller-0.4.12 test/test/functional/posts_controller_test.rb
giraffesoft-resource_controller-0.4.9 test/test/functional/posts_controller_test.rb
giraffesoft-resource_controller-0.5.2 test/test/functional/posts_controller_test.rb
giraffesoft-resource_controller-0.5.3 test/test/functional/posts_controller_test.rb
kdmny-spree-0.0.1 vendor/plugins/resource_controller/test/test/functional/posts_controller_test.rb
korin-resource_controller-0.5.3 test/test/functional/posts_controller_test.rb
nileshtrivedi-lp_resource_builder-0.5.1 test/test/functional/posts_controller_test.rb
nileshtrivedi-lp_resource_builder-0.5.3 test/test/functional/posts_controller_test.rb
nileshtrivedi-safe_resource-0.5.3 test/test/functional/posts_controller_test.rb
pager-resource_controller-1.0.20080513 test/test/functional/posts_controller_test.rb
spree-0.11.4 vendor/plugins/resource_controller/test/test/functional/posts_controller_test.rb
spree-0.11.3 vendor/plugins/resource_controller/test/test/functional/posts_controller_test.rb
spree-0.8.4 vendor/plugins/resource_controller/test/test/functional/posts_controller_test.rb
spree-0.8.5 vendor/plugins/resource_controller/test/test/functional/posts_controller_test.rb
resource_controller-0.4.9 test/test/functional/posts_controller_test.rb
resource_controller-0.5.1 test/test/functional/posts_controller_test.rb
resource_controller-0.5.0 test/test/functional/posts_controller_test.rb