Sha256: 754675e70e69a2505421dbe4c53b6b508f6494d48a62965ce35ebf2828b454b1

Contents?: true

Size: 1.22 KB

Versions: 15

Compression:

Stored size: 1.22 KB

Contents

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

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

class StatesControllerTest < Test::Unit::TestCase
  fixtures :states

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

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

  def test_should_get_new
    get :new
    assert_response :success
  end

  def test_should_create_state
    assert_difference('State.count') do
      post :create, :state => { }
    end

    assert_redirected_to state_path(assigns(:state))
  end

  def test_should_show_state
    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_state
    put :update, :id => 1, :state => { }
    assert_redirected_to state_path(assigns(:state))
  end

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

    assert_redirected_to states_path
  end
end

Version data entries

15 entries across 15 versions & 4 rubygems

Version Path
johnsbrn-has_many_polymorphs-2.13.1 test/integration/app/test/functional/states_controller_test.rb
johnsbrn-has_many_polymorphs-2.13.3 test/integration/app/test/functional/states_controller_test.rb
johnsbrn-has_many_polymorphs-2.13 test/integration/app/test/functional/states_controller_test.rb
has_many_polymorphs-2.13 test/integration/app/test/functional/states_controller_test.rb
has_many_polymorphs-2.12 test/integration/app/test/functional/states_controller_test.rb
has_many_polymorphs-2.11 test/integration/app/test/functional/states_controller_test.rb
spree-0.6.0 vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/states_controller_test.rb
spree-0.7.1 vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/states_controller_test.rb
spree-0.7.0 vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/states_controller_test.rb
ultrasphinx-1.6.7 test/integration/app/test/functional/states_controller_test.rb
ultrasphinx-1.5.3 test/integration/app/test/functional/states_controller_test.rb
ultrasphinx-1.7 test/integration/app/test/functional/states_controller_test.rb
ultrasphinx-1.8 test/integration/app/test/functional/states_controller_test.rb
ultrasphinx-1.9 test/integration/app/test/functional/states_controller_test.rb
ultrasphinx-1.6 test/integration/app/test/functional/states_controller_test.rb