Tahi-project/tahi — pull request #543 by neo-tahi (2014-10-28 22:41:10+00:00)
Title: reset password spec

This is a new test, that shows we get an error when we try to do a password reset.

To run just this spec and see it in action, run `rspec spec/features/user_sign_in_spec.rb`

Columbus, any insight into this error that we are getting?

![image](https://cloud.githubusercontent.com/assets/5796310/4818362/49203e58-5ef2-11e4-84d6-2331252a56f2.png)

To repro manually, log out of tahi. Then from the login screen, click "forgot your password". Enter your email, and hit the "send reset password instructions" button. You'll then see the error above.

We have tried changing `devise.rb` configuration, and also tried changing the calls to `devise.sanitize_for`; these changes did not make the error go away.

— DT + FW + RW + MM

### UPDATE!!

Here is the diff that fixes this:

```diff
diff --git a/app/models/concerns/user_devise.rb b/app/models/concerns/user_devise.rb
index 5880455..0231711 100644
--- a/app/models/concerns/user_devise.rb
+++ b/app/models/concerns/user_devise.rb
@@ -9,7 +9,7 @@ module UserDevise
if login = conditions.delete(:login)
where(conditions).where(["lower(username) = :value OR lower(email) = :value", { value: login.downcase }]).first
else
- where(conditions).first
+ super
end
end
```

### Upcoming
- [ ] Verify that the rest of the story is satisfied
- [ ] ready for review