require "test_helper"

class Admin::HomeControllerTest < ActionDispatch::IntegrationTest
  test "should redirect when not login" do
    get admin_root_path
    assert_response :redirect
  end

  test "should view admin home index when login" do
    post login_path, params: {user: {
      email: users(:user_one).email,
      password: "12345678"
    }}

    get admin_root_path
    assert_response :success
  end
end
