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

Fix collection of strings assuming complex objects #52

Merged
merged 2 commits into from
Aug 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
[master]: https://github.com/DripEmail/drip-ruby/compare/v3.1.1...HEAD

- Allow `#create_or_update_subscriber` to work with Drip id. Fixes [#50](https://github.com/DripEmail/drip-ruby/issues/50)
- [#52](https://github.com/DripEmail/drip-ruby/pull/52): Fix `#custom_fields` to accept the API response without error. Fixes [#30](https://github.com/DripEmail/drip-ruby/issues/30)

Choose a reason for hiding this comment

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

Why not just release it as 3.1.2 in this PR?

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 don't like to mix features and releases.

- Your contribution here!

## [3.1.1] - 2018-06-06
Expand Down
2 changes: 1 addition & 1 deletion lib/drip/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def item_class

def parse_items
raw_items.map do |raw_item|
item_class.new(raw_item)
raw_item.is_a?(String) ? raw_item : item_class.new(raw_item)
end
end

Expand Down
10 changes: 9 additions & 1 deletion test/drip/client/custom_fields_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ def setup
context "#custom_fields" do
setup do
@response_status = 200
@response_body = "{}"
@response_body = <<-JSON
{
"custom_field_identifiers":[
"custom_field_1",
"custom_field_2",
"custom_field_3"
]
}
JSON

stub_request(:get, "https://api.getdrip.com/v2/12345/custom_field_identifiers").
to_return(status: @response_status, body: @response_body, headers: {})
Expand Down