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

Remove duplicate test helper #1161

Merged
merged 1 commit into from
Sep 17, 2015

Conversation

bf4
Copy link
Member

@bf4 bf4 commented Sep 16, 2015

No description provided.

@bf4 bf4 force-pushed the remove_duplicate_test_helper branch 2 times, most recently from 5dcf907 to 26277ea Compare September 16, 2015 13:54
@bf4
Copy link
Member Author

bf4 commented Sep 16, 2015

Failures are appveyor only and apply to open issue #1130

  1. Failure:
    ActionController::Serialization::ImplicitSerializerTest#test_cache_expiration_on_update [C:/projects/active-model-serializers/test/action_controller/serialization_test.rb:380]:
    --- expected
    +++ actual
    @@ -1 +1 @@
    -"{"id":1,"title":"ZOMG a New Post","body":"Body","comments":[{"id":1,"body":"ZOMG A COMMENT"}],"blog":{"id":999,"name":"Custom blog"},"author":{"id":1,"name":"Joao Moura."}}"
    +"{"id":1,"title":"New Post","body":"Body","comments":[{"id":1,"body":"ZOMG A COMMENT"}],"blog":{"id":999,"name":"Custom blog"},"author":{"id":1,"name":"Joao Moura."}}"
  1. Failure:
    ActionController::Serialization::ImplicitSerializerTest#test_cache_expiration_on_update [C:/projects/active-model-serializers/test/action_controller/serialization_test.rb:380]:
    --- expected
    +++ actual
    @@ -1 +1 @@
    -"{"id":1,"title":"ZOMG a New Post","body":"Body","comments":[{"id":1,"body":"ZOMG A COMMENT"}],"blog":{"id":999,"name":"Custom blog"},"author":{"id":1,"name":"Joao Moura."}}"
    +"{"id":1,"title":"New Post","body":"Body","comments":[{"id":1,"body":"ZOMG A COMMENT"}],"blog":{"id":999,"name":"Custom blog"},"author":{"id":1,"name":"Joao Moura."}}"

@@ -10,4 +17,13 @@ def with_adapter(adapter)
ensure
ActiveModel::Serializer.config.adapter = old_adapter
end
alias_method :with_configured_adapter, :with_adapter
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand the with_configured_adapter. Could you show me a situation where it makes sense?

Copy link
Member Author

Choose a reason for hiding this comment

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

Does the comment at the top of the method answer that question?

Copy link
Member Author

Choose a reason for hiding this comment

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

Before SerializableResource, the only way to specify an adapter was global, as an option to render, or by building the serializer and adapter yourself.. now we don't need global quite as much

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I got it. I was reading that as "do stuff with the adapter I'm providing, that I have given a specific configuration", instead of "do stuff with this adapter by setting it as the configured adapter".

@NullVoxPopuli
Copy link
Contributor

👍

NullVoxPopuli added a commit that referenced this pull request Sep 17, 2015
@NullVoxPopuli NullVoxPopuli merged commit a60e1ea into rails-api:master Sep 17, 2015
@bf4 bf4 deleted the remove_duplicate_test_helper branch August 31, 2016 06:19
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.

3 participants