Sha256: 02ca61fb5f9510bf2c9702213958d2bb38fe974de80b2e0021b83610a785012d

Contents?: true

Size: 1.2 KB

Versions: 14

Compression:

Stored size: 1.2 KB

Contents

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

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

class UsersControllerTest < ActiveSupport::TestCase
  fixtures :users

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

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

  def test_should_get_new
    get :new
    assert_response :success
  end

  def test_should_create_user
    assert_difference('User.count') do
      post :create, :user => { }
    end

    assert_redirected_to user_path(assigns(:user))
  end

  def test_should_show_user
    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_user
    put :update, :id => 1, :user => { }
    assert_redirected_to user_path(assigns(:user))
  end

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

    assert_redirected_to users_path
  end
end

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
radiant-tags-extension-1.6.10 vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/users_controller_test.rb
johnsbrn-has_many_polymorphs-2.13.4 test/integration/app/test/functional/users_controller_test.rb
radiant-tags-extension-1.6.9 vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/users_controller_test.rb
radiant-tags-extension-1.6.8 vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/users_controller_test.rb
radiant-tags-extension-1.6.7 vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/users_controller_test.rb
radiant-tags-extension-1.6.6 vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/users_controller_test.rb
radiant-tags-extension-1.6.5 vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/users_controller_test.rb
radiant-tags-extension-1.6.4 vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/users_controller_test.rb
radiant-tags-extension-1.6.3 vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/users_controller_test.rb
radiant-tags-extension-1.6.2 vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/users_controller_test.rb
radiant-tags-extension-1.6.1 vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/users_controller_test.rb
radiant-tags-extension-1.6.0 vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/users_controller_test.rb
radiant-tags-extension-1.5.1 vendor/plugins/has_many_polymorphs/test/integration/app/test/functional/users_controller_test.rb
has_many_polymorphs-2.2 test/integration/app/test/functional/users_controller_test.rb