mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
Tests for #22754.
git-svn-id: http://svn.redmine.org/redmine/trunk@15443 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
f20f49a76b
commit
681740d5be
@ -40,6 +40,26 @@ class Redmine::ApiTest::CustomFieldsAttributeTest < Redmine::ApiTest::Base
|
|||||||
assert_equal "52", group.custom_field_value(field)
|
assert_equal "52", group.custom_field_value(field)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_boolean_custom_fields_should_accept_strings
|
||||||
|
field = GroupCustomField.generate!(:field_format => 'bool')
|
||||||
|
|
||||||
|
post '/groups.json', %({"group":{"name":"Foo","custom_field_values":{"#{field.id}": "1"}}}),
|
||||||
|
{'CONTENT_TYPE' => 'application/json'}.merge(credentials('admin'))
|
||||||
|
assert_response :created
|
||||||
|
group = Group.order('id DESC').first
|
||||||
|
assert_equal "1", group.custom_field_value(field)
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_boolean_custom_fields_should_accept_integers
|
||||||
|
field = GroupCustomField.generate!(:field_format => 'bool')
|
||||||
|
|
||||||
|
post '/groups.json', %({"group":{"name":"Foo","custom_field_values":{"#{field.id}": 1}}}),
|
||||||
|
{'CONTENT_TYPE' => 'application/json'}.merge(credentials('admin'))
|
||||||
|
assert_response :created
|
||||||
|
group = Group.order('id DESC').first
|
||||||
|
assert_equal "1", group.custom_field_value(field)
|
||||||
|
end
|
||||||
|
|
||||||
def test_multivalued_custom_fields_should_accept_an_array
|
def test_multivalued_custom_fields_should_accept_an_array
|
||||||
field = GroupCustomField.generate!(
|
field = GroupCustomField.generate!(
|
||||||
:field_format => 'list',
|
:field_format => 'list',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user