Sha256: 90d3c557f21faaf432688bab1d19771a64061d3d317adaefb2f3e5f4b177465e

Contents?: true

Size: 964 Bytes

Versions: 30

Compression:

Stored size: 964 Bytes

Contents

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

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

class ImagesControllerTest < Test::Unit::TestCase
  def setup
    @controller           = ImagesController.new
    @request              = ActionController::TestRequest.new
    @response             = ActionController::TestResponse.new
    @image = images :one
  end

  context "with user as parent" do
    
    context "on post to :create" do
      setup do
        post :create, :user_id => 1, :photo => {}
      end

      should_redirect_to 'user_image_path(@image.user)'
      should_assign_to :image
      should_assign_to :user
      should "scope image to user" do
        assert users(:one), assigns(:image).user
      end
    end
    
  end  
  
  should "not respond to show" do
    assert_raise(ActionController::UnknownAction) do
      get :show
    end
  end
end

Version data entries

30 entries across 30 versions & 8 rubygems

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