Skip to content

Commit

Permalink
reset password token was not getting generated
Browse files Browse the repository at this point in the history
[Fixes spree#687]
  • Loading branch information
cmar authored and schof committed Oct 5, 2011
1 parent 97548b6 commit df71c24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion auth/app/models/user.rb
Expand Up @@ -39,7 +39,7 @@ def anonymous?
end

def send_reset_password_instructions
reset_perishable_token!
generate_reset_password_token!
UserMailer.reset_password_instructions(self).deliver
end

Expand Down
7 changes: 7 additions & 0 deletions auth/spec/models/user_spec.rb
Expand Up @@ -3,6 +3,13 @@
describe User do
before(:all) { Role.create :name => "admin" }

it "should generate the reset password token" do
user = Factory.build(:user)
UserMailer.should_receive(:reset_password_instructions).with(user).and_return(double(:deliver => true))
user.send_reset_password_instructions
user.reset_password_token.should_not be_nil
end

context "#create" do
let(:user) { Factory.build(:user) }

Expand Down

0 comments on commit df71c24

Please sign in to comment.