-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added testcases for serializable_resource and fixed a documentation error regarding adapter key constant #1501
Conversation
@@ -64,7 +64,7 @@ Details: | |||
1. **ActionController::Serialization** | |||
1. `serializable_resource = ActiveModel::SerializableResource.new(resource, options)` | |||
1. `options` are partitioned into `adapter_opts` and everything else (`serializer_opts`). | |||
The adapter options keys for the are defined by `ADAPTER_OPTIONS`. | |||
The adapter_opt keys are defined in `ActiveModel::SerializableResource::ADAPTER_OPTION_KEYS`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adapter_opts
@bf4 done, removed the additional testcase. |
Alright, squash commits, add yourself to the top of the fixes changelog and looks good to merge |
42d329b
to
f1de1bf
Compare
@bf4 done. |
@domitian Thanks. Commit message is a little long, but is ok. For a laugh at an egregious offender, see http://stopwritingramblingcommitmessages.com/ :) |
@@ -23,5 +23,13 @@ def test_serializable_resource_delegates_as_json_to_the_adapter | |||
options = nil | |||
assert_equal @adapter.as_json(options), @serializable_resource.as_json(options) | |||
end | |||
|
|||
def test_use_adapter_with_adapter_option | |||
assert_equal ActiveModel::SerializableResource.new(@resource, { adapter: 'json' }).use_adapter?, true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, missed the expectation here. it's assert_equal(expected, actual)
. But in this case, since it's boolean, it should just be assert
and in the next test refute
f1de1bf
to
b8016da
Compare
@bf4 Made the changes suggested(reduced the commit message length, using refute and assert in boolean cases. |
for SerializableResource::use_adapter?
b8016da
to
68f09e5
Compare
I think this is done and ready to be merged. |
Added testcases for serializable_resource and fixed a documentation error regarding adapter key constant
Yay! |
Fixed a documentation error regarding adapter key constant, added a new test cases for use_adapter? method in serializable resource object and fixed a documentation typo.