Easy Password Timeout Test
Using the Timecop gem, you can easily test your password timeouts for your users. I use the following snippet in my spec test:
u = FactoryGirl.create(:user)
Timecop.travel 30.days.from_now
u.current_password?.should be_false
Timecop.return
Written by Sean Todd
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#