Skip to content
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

Rewrite test to use SerializableResource. #1092

Closed
wants to merge 1 commit into from

Conversation

beauby
Copy link
Contributor

@beauby beauby commented Aug 28, 2015

No description provided.

hash = ActiveModel::SerializableResource.serialize(@comment).serializable_hash
ActionController::Base.cache_store.clear
assert_equal('comment', hash[:data][:type])
end
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or

def serialize_with_adapter_and_jsonapi_resource_type(resource, adapter, jsonapi_resource_type)
              with_adapter adapter do
             with_jsonapi_resource_type json_api_resource_type do
                hash = ActiveModel::SerializableResource.serialize(resource).serializable_hash
                ActionController::Base.cache_store.clear
              yield hash
              end
end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to keep it in line with a possible global with_adapter method.

@beauby
Copy link
Contributor Author

beauby commented Aug 28, 2015

Closing in favor of #1093.

@beauby beauby closed this Aug 28, 2015
@bf4
Copy link
Member

bf4 commented Aug 28, 2015

Any reason you didn't just re-use this PR and force push to test-serializable-resource? Just curious

@beauby
Copy link
Contributor Author

beauby commented Aug 29, 2015

Hmm good question, I was probably drunk.

@bf4
Copy link
Member

bf4 commented Aug 30, 2015

🍺 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants