Skip to content
Extraits de code Groupes Projets
reset_password_spec.rb 451 octets
Newer Older
  • Learn to ignore specific revisions
  • Jonne Haß's avatar
    Jonne Haß a validé
    describe Workers::ResetPassword do
    
      describe "#perform" do
        it "given a user id it sends the reset password instructions for that user" do
    
    Jonne Haß's avatar
    Jonne Haß a validé
          user = FactoryGirl.create :user
    
    Jonne Haß's avatar
    Jonne Haß a validé
            mail = Workers::ResetPassword.new.perform(user.id)
    
            mail.to.should == [user.email]
            mail.body.should include("change your password")
          }.to change(Devise.mailer.deliveries, :length).by(1)
        end
      end
    
    Jonne Haß's avatar
    Jonne Haß a validé
    end