summaryrefslogtreecommitdiffstats
path: root/test/unit/custom_field_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2017-06-19 05:38:48 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2017-06-19 05:38:48 +0000
commit2b24a617e16423966cfdf251af1743342729aa83 (patch)
tree9d421cde5aa58da2015e9d03dbfa4ab045e76686 /test/unit/custom_field_test.rb
parent741fff99565a36a550b1217249c44de5bb69d3f6 (diff)
downloadredmine-2b24a617e16423966cfdf251af1743342729aa83.tar.gz
redmine-2b24a617e16423966cfdf251af1743342729aa83.zip
code layout cleanup test/unit/custom_field_test.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@16678 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/custom_field_test.rb')
-rw-r--r--test/unit/custom_field_test.rb22
1 files changed, 15 insertions, 7 deletions
diff --git a/test/unit/custom_field_test.rb b/test/unit/custom_field_test.rb
index 461af85e4..1db16c2d4 100644
--- a/test/unit/custom_field_test.rb
+++ b/test/unit/custom_field_test.rb
@@ -55,7 +55,9 @@ class CustomFieldTest < ActiveSupport::TestCase
end
def test_default_value_should_not_be_validated_when_blank
- field = CustomField.new(:name => 'Test', :field_format => 'list', :possible_values => ['a', 'b'], :is_required => true, :default_value => '')
+ field = CustomField.new(:name => 'Test', :field_format => 'list',
+ :possible_values => ['a', 'b'], :is_required => true,
+ :default_value => '')
assert field.valid?
end
@@ -248,12 +250,18 @@ class CustomFieldTest < ActiveSupport::TestCase
end
def test_changing_multiple_to_false_should_delete_multiple_values
- field = ProjectCustomField.create!(:name => 'field', :field_format => 'list', :multiple => 'true', :possible_values => ['field1', 'field2'])
- other = ProjectCustomField.create!(:name => 'other', :field_format => 'list', :multiple => 'true', :possible_values => ['other1', 'other2'])
-
- item_with_multiple_values = Project.generate!(:custom_field_values => {field.id => ['field1', 'field2'], other.id => ['other1', 'other2']})
- item_with_single_values = Project.generate!(:custom_field_values => {field.id => ['field1'], other.id => ['other2']})
-
+ field = ProjectCustomField.create!(:name => 'field', :field_format => 'list',
+ :multiple => 'true',
+ :possible_values => ['field1', 'field2'])
+ other = ProjectCustomField.create!(:name => 'other', :field_format => 'list',
+ :multiple => 'true',
+ :possible_values => ['other1', 'other2'])
+ item_with_multiple_values = Project.generate!(:custom_field_values =>
+ {field.id => ['field1', 'field2'],
+ other.id => ['other1', 'other2']})
+ item_with_single_values = Project.generate!(:custom_field_values =>
+ {field.id => ['field1'],
+ other.id => ['other2']})
assert_difference 'CustomValue.count', -1 do
field.multiple = false
field.save!