Sha256: 7230c6eb83b9539637dcdde3f50bab7db0a4d365127a543726d1edfa9d0a48c8

Contents?: true

Size: 849 Bytes

Versions: 12

Compression:

Stored size: 849 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 < ActionController::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

12 entries across 12 versions & 7 rubygems

Version Path
csmosx-resource_controller-0.6.6 test/test/functional/posts_controller_test.rb
csmosx-resource_controller-0.6.7 test/test/functional/posts_controller_test.rb
dkubb-resource_controller-0.6.5 test/test/functional/posts_controller_test.rb
giraffesoft-resource_controller-0.5.5 test/test/functional/posts_controller_test.rb
giraffesoft-resource_controller-0.5.6 test/test/functional/posts_controller_test.rb
giraffesoft-resource_controller-0.6.0 test/test/functional/posts_controller_test.rb
giraffesoft-resource_controller-0.6.1 test/test/functional/posts_controller_test.rb
giraffesoft-resource_controller-0.6.5 test/test/functional/posts_controller_test.rb
jeffrafter-resource_controller-0.5.5 test/test/functional/posts_controller_test.rb
maser-resource_controller-0.6.6 test/test/functional/posts_controller_test.rb
radar-resource_controller-0.6.6 test/test/functional/posts_controller_test.rb
strikeroff-resource_controller-0.6.6 test/test/functional/posts_controller_test.rb