Created
July 15, 2009 21:17
-
-
Save joshuaclayton/148003 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserTest < ActiveSupport::TestCase | |
should_belong_to :customer | |
context "Clearance tests" do | |
setup do | |
User.any_instance.stubs(:generate_random_password) | |
end | |
include Clearance::Test::Unit::UserTest | |
end | |
context "A user instance" do | |
setup { @user = Factory(:email_confirmed_user) } | |
should "correctly generate a random password" do | |
ActiveSupport::SecureRandom.expects(:hex).with(6).returns("random password") | |
@user.expects(:password=).with("random password") | |
@user.expects(:password_confirmation=).with("random password") | |
@user.generate_random_password | |
end | |
# etc. | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment