Permalink
Browse files

Added test for select_options custom field

  • Loading branch information...
1 parent c1b85d9 commit 5ac95d5986aa439a3b2682aa4a2e88bb190ecd9a @alexsanford alexsanford committed May 16, 2012
Showing with 22 additions and 6 deletions.
  1. +1 −1 app/presenters/locomotive/content_type_presenter.rb
  2. +21 −5 features/api/entries_custom_fields.feature
@@ -41,7 +41,7 @@ def filter_entries_custom_field_hash(entries_custom_field_hash)
end
def custom_fields_write_methods
- %w(hint inverse_of label localized name order_by position required text_formatting type ui_enabled class_name)
+ %w(hint inverse_of label localized name order_by position required text_formatting type ui_enabled class_name select_options)
end
end
@@ -47,18 +47,34 @@ Feature: Entries Custom Fieldws
{
"label": "Content",
"type": "text"
+ },
+ {
+ "label": "Category",
+ "type": "select",
+ "select_options": [
+ {
+ "name": "category1"
+ },
+ {
+ "name": "category2"
+ }
+ ]
}
]
}
}
"""
When I do an API GET request to content_types/4f832c2cb0d86d3f42fffffe.json
- Then the JSON response at "entries_custom_fields" should have 4 entries
+ Then the JSON response at "entries_custom_fields" should have 5 entries
And the JSON response should have the following:
- | entries_custom_fields/2/label | "Title" |
- | entries_custom_fields/2/type | "string" |
- | entries_custom_fields/3/label | "Content" |
- | entries_custom_fields/3/type | "text" |
+ | entries_custom_fields/2/label | "Title" |
+ | entries_custom_fields/2/type | "string" |
+ | entries_custom_fields/3/label | "Content" |
+ | entries_custom_fields/3/type | "text" |
+ | entries_custom_fields/4/label | "Category" |
+ | entries_custom_fields/4/type | "select" |
+ | entries_custom_fields/4/select_options/0/name | "category1" |
+ | entries_custom_fields/4/select_options/1/name | "category2" |
Scenario: Create new custom field on new content type
When I do an API GET request to content_types.json

0 comments on commit 5ac95d5

Please sign in to comment.