aboutsummaryrefslogtreecommitdiff
path: root/spec/flows/reset_password_spec.cr
diff options
context:
space:
mode:
Diffstat (limited to 'spec/flows/reset_password_spec.cr')
-rw-r--r--spec/flows/reset_password_spec.cr18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/flows/reset_password_spec.cr b/spec/flows/reset_password_spec.cr
new file mode 100644
index 0000000..b28af34
--- /dev/null
+++ b/spec/flows/reset_password_spec.cr
@@ -0,0 +1,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