Sha256: d292d1cb5b546717bf48c9539cf36ff7b0223a22665445a7197816dc94aecf8c

Contents?: true

Size: 1.31 KB

Versions: 9

Compression:

Stored size: 1.31 KB

Contents

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

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

class AddressesControllerTest < Test::Unit::TestCase
  fixtures :addresses

  def setup
    @controller = AddressesController.new
    @request    = ActionController::TestRequest.new
    @response   = ActionController::TestResponse.new
  end

  def test_should_get_index
    get :index
    assert_response :success
    assert assigns(:addresses)
  end

  def test_should_get_new
    get :new
    assert_response :success
  end

  def test_should_create_address
    assert_difference('Address.count') do
      post :create, :address => { :country_id => 1, :user_id => 1, :state_id => 1}
    end

    assert_redirected_to address_path(assigns(:address))
  end

  def test_should_show_address
    get :show, :id => 1
    assert_response :success
  end

  def test_should_get_edit
    get :edit, :id => 1
    assert_response :success
  end

  def test_should_update_address
    put :update, :id => 1, :address => { }
    assert_redirected_to address_path(assigns(:address))
  end

  def test_should_destroy_address
    assert_difference('Address.count', -1) do
      delete :destroy, :id => 1
    end

    assert_redirected_to addresses_path
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
johnsbrn-has_many_polymorphs-2.13.1 test/integration/app/test/functional/addresses_controller_test.rb
johnsbrn-has_many_polymorphs-2.13.3 test/integration/app/test/functional/addresses_controller_test.rb
johnsbrn-has_many_polymorphs-2.13 test/integration/app/test/functional/addresses_controller_test.rb
has_many_polymorphs-2.11 test/integration/app/test/functional/addresses_controller_test.rb
has_many_polymorphs-2.13 test/integration/app/test/functional/addresses_controller_test.rb
has_many_polymorphs-2.12 test/integration/app/test/functional/addresses_controller_test.rb
spree-0.6.0 vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/addresses_controller_test.rb
spree-0.7.0 vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/addresses_controller_test.rb
spree-0.7.1 vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/addresses_controller_test.rb