Basic support for hubspot workflows#102
Basic support for hubspot workflows#102samanthamjohn wants to merge 2 commits intoHubspotCommunity:masterfrom
Conversation
|
@cbisnett Would love a PR review when you get a chance. Thanks so much! |
cbisnett
left a comment
There was a problem hiding this comment.
Thank you for submitting a PR, especially one with tests! I added a few comments for updates but hopefully this won't be too much work. If you don't have time or don't want to make the updates, let me know and I'll get them finished and merged. Thanks again.
| end | ||
|
|
||
| # {https://developers.hubspot.com/docs/methods/workflows/add_contact} | ||
| def enroll_contact(email:) |
There was a problem hiding this comment.
I like the idea of named parameters but since we don’t use those anywhere else I think we should just keep this as a regular parameter.
| cassette 'enroll_contact_in_workflow_success' | ||
| it "returns a 204 response for a success" do | ||
| email = "testingapis@hubspot.com" | ||
| workflow = Hubspot::Workflow.new({'name' => "hello workflow", 'id' => 2582322}) |
There was a problem hiding this comment.
These tests are great but the one problem I think we have here is that all of the ID's are hard coded. At this point the tests share an account with everyone on the internet using the demo API key. So if someone comes along and deletes these workflows or the demo account gets reset and there are no more views, then these tests will fail. We have theses issues occasionally with other tests. This isn't really a fault with your specific test but more an issue we have to work around with the tests.
I think the easiest way to fix this here is to create the workflow that can be used in each of these tests. I realize this means you'll have to add some more functionality to the Workflow class to be able to create workflows but it will mean the tests are more likely to pass consistently.
| end | ||
| end | ||
|
|
||
| describe '.all' do |
There was a problem hiding this comment.
Can you update this to describe '#all' to match the rest of the code base?
Adding functionality to add a contact to a workflow by email.