aboutsummaryrefslogtreecommitdiff
path: root/spec/flows/reset_password_spec.cr
blob: b28af34ad1e0ae5ed63425d7f015a582b48254b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require "../spec_helper"

describe "Reset password flow", tags: "flow" do
  it "works" do
    user = UserFactory.create
    flow = ResetPasswordFlow.new(user)

    flow.request_password_reset
    flow.should_have_sent_reset_email
    flow.reset_password "new-password"
    flow.should_be_signed_in
    flow.sign_out
    flow.sign_in "wrong-password"
    flow.should_have_password_error
    flow.sign_in "new-password"
    flow.should_be_signed_in
  end
end