summaryrefslogtreecommitdiffstats
path: root/test/unit/custom_field_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-10-26 14:43:14 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-10-26 14:43:14 +0000
commit0b6a1596228ef4a46be77604858486bbed815d5a (patch)
tree75e772e60ab2ee165acb8201d913bea6c7d1b95a /test/unit/custom_field_test.rb
parentb6c0e80d37bd2e9d5228942d5f5f84f559f864a6 (diff)
downloadredmine-0b6a1596228ef4a46be77604858486bbed815d5a.tar.gz
redmine-0b6a1596228ef4a46be77604858486bbed815d5a.zip
Don't rely on users fixtures.
git-svn-id: http://svn.redmine.org/redmine/trunk@13512 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/custom_field_test.rb')
-rw-r--r--test/unit/custom_field_test.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/unit/custom_field_test.rb b/test/unit/custom_field_test.rb
index 56cdbcb72..61ed2223b 100644
--- a/test/unit/custom_field_test.rb
+++ b/test/unit/custom_field_test.rb
@@ -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