Sha256: 4bf7ee683cbbd51d9562b9cefc8ab29faa47709f775a21c4938cab625556ccf9

Contents?: true

Size: 901 Bytes

Versions: 10

Compression:

Stored size: 901 Bytes

Contents

require 'test_helper'

class UsersControllerTest < ActionController::TestCase
  setup do
    @user = create(:user)
  end

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

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

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

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

  test "should create" do
    assert_difference('Admin::User.count') do
      post :create, user: {name: 'Hello'}
    end
    assert_response 302
  end

  test "should update" do
    patch :update, id: @user, user: {name: 'Hello'}
    assert_redirected_to user_path(@user)
  end

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
iord-1.2.2 test/controllers/users_controller_test.rb
iord-1.2.1 test/controllers/users_controller_test.rb
iord-1.2.0 test/controllers/users_controller_test.rb
iord-1.1.3 test/controllers/users_controller_test.rb
iord-1.1.2 test/controllers/users_controller_test.rb
iord-1.1.1 test/controllers/users_controller_test.rb
iord-1.1.0 test/controllers/users_controller_test.rb
iord-1.0.3 test/controllers/users_controller_test.rb
iord-1.0.2 test/controllers/users_controller_test.rb
iord-1.0.1 test/controllers/users_controller_test.rb