Skip to content

Commit b695180

Browse files
committed
Add test for required fields
1 parent ef3bfdd commit b695180

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/serializers/attributes_test.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ def test_attributes_definition
1515

1616
def test_attributes_with_fields_option
1717
assert_equal({name: 'Name 1'},
18-
@profile_serializer.attributes( { fields: [:name] } ) )
18+
@profile_serializer.attributes(fields: [:name]))
19+
end
20+
21+
def test_required_fields
22+
assert_equal({name: 'Name 1', description: 'Description 1'},
23+
@profile_serializer.attributes(fields: [:name, :description], required_fields: [:name]))
24+
1925
end
2026
end
2127
end

0 commit comments

Comments
 (0)