Tests to validate the flow of token already used
This commit is contained in:
@@ -9,5 +9,13 @@ describe Users::ConfirmationsController do
|
||||
it "returns a 404 code with a wrong token" do
|
||||
expect { get :show, params: { token: "non_existent" } }.to raise_error ActiveRecord::RecordNotFound
|
||||
end
|
||||
|
||||
it "redirect to sign_in page with a existent token " do
|
||||
user = create(:user, confirmation_token: "token1")
|
||||
|
||||
get :show, params: { user: user, confirmation_token: "token1" }
|
||||
|
||||
expect(response).to redirect_to(new_user_session_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user