]> source.dussan.org Git - redmine.git/commitdiff
Don't rely on users fixtures.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 26 Oct 2014 14:43:14 +0000 (14:43 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 26 Oct 2014 14:43:14 +0000 (14:43 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@13512 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/custom_field_test.rb

index 56cdbcb72d091d11bac559869325f2c0392a4d65..61ed2223bfd9aadfc4a8ca549cc457f3a4a60fab 100644 (file)
@@ -263,6 +263,7 @@ class CustomFieldTest < ActiveSupport::TestCase
   end
 
   def test_visibile_scope_with_admin_should_return_all_custom_fields
+    admin = User.generate! {|user| user.admin = true}
     CustomField.delete_all
     fields = [
       CustomField.generate!(:visible => true),
@@ -271,7 +272,7 @@ class CustomFieldTest < ActiveSupport::TestCase
       CustomField.generate!(:visible => false, :role_ids => [1, 2]),
     ]
 
-    assert_equal 4, CustomField.visible(User.find(1)).count
+    assert_equal 4, CustomField.visible(admin).count
   end
 
   def test_visibile_scope_with_non_admin_user_should_return_visible_custom_fields