Sha256: c52ae6c7bad82e5abf07f8945109b571d36679355055e91b2432793a60ea4491

Contents?: true

Size: 1.18 KB

Versions: 11

Compression:

Stored size: 1.18 KB

Contents

require 'test_helper'

module People
  class UsersControllerTest < ActionController::TestCase
    setup do
      @user = users(:one)
    end

    test "should get index" do
      get :index
      assert_response :success
      assert_not_nil assigns(:users)
    end

    test "should get new" do
      get :new
      assert_response :success
    end

    test "should create user" do
      assert_difference('User.count') do
        post :create, user: { email: @user.email, password_digest: @user.password_digest, username: @user.username }
      end

      assert_redirected_to user_path(assigns(:user))
    end

    test "should show user" do
      get :show, id: @user
      assert_response :success
    end

    test "should get edit" do
      get :edit, id: @user
      assert_response :success
    end

    test "should update user" do
      patch :update, id: @user, user: { email: @user.email, password_digest: @user.password_digest, username: @user.username }
      assert_redirected_to user_path(assigns(:user))
    end

    test "should destroy user" do
      assert_difference('User.count', -1) do
        delete :destroy, id: @user
      end

      assert_redirected_to users_path
    end
  end
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
arcadex-1.3.1 test/test_app/engines/people/test/controllers/people/users_controller_test.rb
arcadex-1.3.0 test/test_app/engines/people/test/controllers/people/users_controller_test.rb
people_user_generator-0.0.1 test/controllers/people/users_controller_test.rb
arcadex-1.2.3 test/test_app/engines/people/test/controllers/people/users_controller_test.rb
arcadex-1.2.1 test/test_app/engines/people/test/controllers/people/users_controller_test.rb
arcadex-1.2.0 test/test_app/engines/people/test/controllers/people/users_controller_test.rb
json_voorhees-0.2.3 test/test_app/engines/people/test/controllers/people/users_controller_test.rb
json_voorhees-0.2.2 test/test_app/engines/people/test/controllers/people/users_controller_test.rb
json_voorhees-0.2.1 test/test_app/engines/people/test/controllers/people/users_controller_test.rb
json_voorhees-0.2.0 test/test_app/engines/people/test/controllers/people/users_controller_test.rb
json_voorhees-0.1.0 test/test_app/engines/people/test/controllers/people/users_controller_test.rb