Added field to track users last login (#2367)

This commit is contained in:
Ahmad Farhat
2020-12-14 18:52:08 -05:00
committed by GitHub
parent 7a2405aa9e
commit 14350c5f5d
5 changed files with 41 additions and 1 deletions

View File

@ -139,6 +139,15 @@ describe UsersController, type: :controller do
expect(flash[:success]).to be_present
expect(response).to redirect_to(root_path)
end
it "correctly sets the last_login field after the user is created" do
params = random_valid_user_params
post :create, params: params
u = User.find_by(name: params[:user][:name], email: params[:user][:email])
expect(u.last_login).to_not be_nil
end
end
context "disallow greenlight accounts" do