##// END OF EJS Templates
Speeds up rendering of the project list for users who belong to hundreds of projects....
Speeds up rendering of the project list for users who belong to hundreds of projects. git-svn-id: http://svn.redmine.org/redmine/trunk@16123 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r14856:cda9c63d9c21
r15741:f8df935dcada
Show More
custom_value_test.rb
49 lines | 1.8 KiB | text/x-ruby | RubyLexer
/ test / unit / custom_value_test.rb
Toshi MARUYAMA
remove trailing white-spaces from test/unit/custom_value_test.rb....
r6604 # Redmine - project management software
Jean-Philippe Lang
Updates copyright for 2016....
r14856 # Copyright (C) 2006-2016 Jean-Philippe Lang
Jean-Philippe Lang
Added "Float" as a custom field format....
r857 #
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
Toshi MARUYAMA
remove trailing white-spaces from test/unit/custom_value_test.rb....
r6604 #
Jean-Philippe Lang
Added "Float" as a custom field format....
r857 # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
Toshi MARUYAMA
remove trailing white-spaces from test/unit/custom_value_test.rb....
r6604 #
Jean-Philippe Lang
Added "Float" as a custom field format....
r857 # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Jean-Baptiste Barth
Use absolute paths in test/**/* requires for Ruby 1.9.2 compatibility. #4050...
r4395 require File.expand_path('../../test_helper', __FILE__)
Jean-Philippe Lang
Added "Float" as a custom field format....
r857
Eric Davis
Upgraded to Rails 2.3.4 (#3597)...
r2773 class CustomValueTest < ActiveSupport::TestCase
Jean-Philippe Lang
Fixes User/CustomValue association broken by r2869 (#3978)....
r2791 fixtures :custom_fields, :custom_values, :users
Jean-Philippe Lang
Added "Float" as a custom field format....
r857
Jean-Philippe Lang
New custom fields of existing issues are not initialized with their default value (#21074)....
r14391 def test_new_without_value_should_set_default_value
field = CustomField.generate!(:default_value => 'Default string')
Toshi MARUYAMA
remove trailing white-spaces from test/unit/custom_value_test.rb....
r6604
Jean-Philippe Lang
Added default value for custom fields. Fixed javascript on custom field form for project and user custom fields....
r1076 v = CustomValue.new(:custom_field => field)
assert_equal 'Default string', v.value
Jean-Philippe Lang
New custom fields of existing issues are not initialized with their default value (#21074)....
r14391 end
def test_new_with_value_should_not_set_default_value
field = CustomField.generate!(:default_value => 'Default string')
v = CustomValue.new(:custom_field => field, :value => 'String')
assert_equal 'String', v.value
end
def test_new_with_nil_value_should_not_set_default_value
field = CustomField.generate!(:default_value => 'Default string')
Jean-Philippe Lang
Added default value for custom fields. Fixed javascript on custom field form for project and user custom fields....
r1076
Jean-Philippe Lang
New custom fields of existing issues are not initialized with their default value (#21074)....
r14391 v = CustomValue.new(:custom_field => field, :value => nil)
assert_nil v.value
Jean-Philippe Lang
Added default value for custom fields. Fixed javascript on custom field form for project and user custom fields....
r1076 end
Toshi MARUYAMA
remove trailing white-spaces from test/unit/custom_value_test.rb....
r6604
Jean-Philippe Lang
Fixes User/CustomValue association broken by r2869 (#3978)....
r2791 def test_sti_polymorphic_association
# Rails uses top level sti class for polymorphic association. See #3978.
assert !User.find(4).custom_values.empty?
assert !CustomValue.find(2).customized.nil?
end
Jean-Philippe Lang
Added "Float" as a custom field format....
r857 end