summaryrefslogtreecommitdiffstats
path: root/test/unit/custom_field_test.rb
diff options
context:
space:
mode:
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!