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

Omit probability when serializing opportunity #82

Merged

Conversation

whitecl
Copy link
Contributor

@whitecl whitecl commented Sep 28, 2014

I get the following when attempting to send updates to an Opportunity, even when the CapsuleCRM::Opportunity has no modifications.

CapsuleCRM::Errors::BadRequest:
value not formatted as a number

I've found that omitting the probability key from the update json amends this.

@mattbeedle
Copy link
Owner

Thanks @whitecl! It seems we are missing to_capsule_json specs. Do you think you could add one in spec/lib/capsule_crm/opportunity.rb for this use case?

@mattbeedle
Copy link
Owner

If not, no problem. I can also add it.

@@ -157,6 +157,18 @@
end
end

describe "#to_capsule_json" do
let(:opportunity) { Fabricate.build(:opportunity, value: 23.0, currency: 'USD') }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Line is too long. [85/80]

@whitecl whitecl force-pushed the opportunity-update-serialization branch from 0d3140d to 3bd00bd Compare September 29, 2014 01:17
@whitecl
Copy link
Contributor Author

whitecl commented Sep 29, 2014

Added, let me know if this is what you were looking for.

@mattbeedle
Copy link
Owner

Looks great. Just one little thing; It would be cool if you could also assert should_not have_key for probability and trackId. Then will be good to merge.

@mattbeedle
Copy link
Owner

Great!

mattbeedle added a commit that referenced this pull request Sep 30, 2014
Omit probability when serializing opportunity
@mattbeedle mattbeedle merged commit c111cb1 into mattbeedle:master Sep 30, 2014
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