ffmike (owner)

Revisions

gist: 153513 Download_button fork
public
Public Clone URL: git://gist.github.com/153513.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'test_helper'
 
class NotifierTest < ActionMailer::TestCase
  
  should "send password reset instructions" do
    user = User.generate!
    Notifier.deliver_password_reset_instructions(user)
    assert_sent_email do |email|
      email.subject = "Password Reset Instructions"
      email.from.include?('Lark Group <noreply@larkfarm.com>')
      email.to.include?(user.email)
      email.body =~ Regexp.new(user.perishable_token)
    end
  end
  
  should "testing time warp" do
    pretend_now_is(Time.utc(2008, "jul", 13, 20)) do
      assert_equal 13, Time.now.day
    end
  end
  
end