From 584748fe0a9b20f7af5f9c6ebf127ec15b1350ad Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Thu, 2 Feb 2017 13:09:39 +0000 Subject: [PATCH] User factory for uniqueness tests --- test/models/user_test.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/models/user_test.rb b/test/models/user_test.rb index 90499e1b1..3f66c5827 100644 --- a/test/models/user_test.rb +++ b/test/models/user_test.rb @@ -20,8 +20,9 @@ class UserTest < ActiveSupport::TestCase end def test_unique_email + existing_user = create(:user) new_user = User.new( - :email => users(:normal_user).email, + :email => existing_user.email, :status => "active", :pass_crypt => Digest::MD5.hexdigest("test"), :display_name => "new user", @@ -33,11 +34,12 @@ class UserTest < ActiveSupport::TestCase end def test_unique_display_name + existing_user = create(:user) new_user = User.new( :email => "tester@openstreetmap.org", :status => "pending", :pass_crypt => Digest::MD5.hexdigest("test"), - :display_name => users(:normal_user).display_name, + :display_name => existing_user.display_name, :data_public => 1, :description => "desc" ) -- 2.39.5