diff options
author | azul <azul@riseup.net> | 2013-01-14 11:05:52 -0800 |
---|---|---|
committer | azul <azul@riseup.net> | 2013-01-14 11:05:52 -0800 |
commit | ee2ea4ac8f4c6b0c3b09be6ed49e7a1faec7a9c1 (patch) | |
tree | 45eb6dcddd743de2b9f999d54751d9d4fc0fcbdd /users/test/support/auth_test_helper.rb | |
parent | 4fd47160e0c43695aada330154f41821099bdda0 (diff) | |
parent | 7b323c5dbd7171cf98f69ca159b5aa2174a5d069 (diff) |
Merge pull request #15 from leapcode/feature/test-data-with-faker
Test data with faker, using factory girl
Diffstat (limited to 'users/test/support/auth_test_helper.rb')
-rw-r--r-- | users/test/support/auth_test_helper.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/users/test/support/auth_test_helper.rb b/users/test/support/auth_test_helper.rb index c9f5612..c0fcf3a 100644 --- a/users/test/support/auth_test_helper.rb +++ b/users/test/support/auth_test_helper.rb @@ -10,10 +10,10 @@ module AuthTestHelper end def login(user_or_method_hash = {}) - @current_user = stub_record(User, user_or_method_hash) - unless @current_user.respond_to? :is_admin? - @current_user.stubs(:is_admin?).returns(false) + if user_or_method_hash.respond_to?(:reverse_merge) + user_or_method_hash.reverse_merge! :is_admin? => false end + @current_user = stub_record(:user, user_or_method_hash, true) request.env['warden'] = stub :user => @current_user return @current_user end |