summaryrefslogtreecommitdiff
path: root/users/test/unit/email_test.rb
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2013-01-14 11:05:52 -0800
committerazul <azul@riseup.net>2013-01-14 11:05:52 -0800
commitee2ea4ac8f4c6b0c3b09be6ed49e7a1faec7a9c1 (patch)
tree45eb6dcddd743de2b9f999d54751d9d4fc0fcbdd /users/test/unit/email_test.rb
parent4fd47160e0c43695aada330154f41821099bdda0 (diff)
parent7b323c5dbd7171cf98f69ca159b5aa2174a5d069 (diff)
Merge pull request #15 from leapcode/feature/test-data-with-faker
Test data with faker, using factory girl
Diffstat (limited to 'users/test/unit/email_test.rb')
-rw-r--r--users/test/unit/email_test.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/users/test/unit/email_test.rb b/users/test/unit/email_test.rb
index 060ced5..d7ef1f8 100644
--- a/users/test/unit/email_test.rb
+++ b/users/test/unit/email_test.rb
@@ -3,13 +3,8 @@ require 'test_helper'
class EmailTest < ActiveSupport::TestCase
setup do
- # TODO build helper for this ... make_record(User)
- @attribs = User.valid_attributes_hash
- User.find_by_login(@attribs[:login]).try(:destroy)
- @user = User.new(@attribs)
- @attribs.merge!(:login => "other_user")
- User.find_by_login(@attribs[:login]).try(:destroy)
- @other_user = User.create(@attribs)
+ @user = FactoryGirl.build :user
+ @other_user = FactoryGirl.build :user
@email_string = "valid_alias@#{APP_CONFIG[:domain]}"
User.find_by_email_or_alias(@email_string).try(:destroy)
end