hubspot-ruby 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/hubspot-ruby.gemspec +9 -4
- data/lib/hubspot-ruby.rb +1 -0
- data/lib/hubspot/deal.rb +49 -0
- data/lib/hubspot/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/deal_create.yml +32 -0
- data/spec/fixtures/vcr_cassettes/deal_example.yml +166 -0
- data/spec/fixtures/vcr_cassettes/deal_find.yml +59 -0
- data/spec/fixtures/vcr_cassettes/one_month_blog_posts_filter_state.yml +2716 -0
- data/spec/lib/hubspot/deal_spec.rb +38 -0
- data/spec/live/contacts_integration_spec.rb +3 -3
- metadata +8 -3
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Hubspot::Deal do
|
4
|
+
let(:example_deal_hash) do
|
5
|
+
VCR.use_cassette("deal_example") do
|
6
|
+
HTTParty.get("https://api.hubapi.com/deals/v1/deal/3?hapikey=demo&portalId=62515").parsed_response
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
before{ Hubspot.configure(hapikey: "demo") }
|
11
|
+
|
12
|
+
describe "#initialize" do
|
13
|
+
subject{ Hubspot::Deal.new(example_deal_hash) }
|
14
|
+
it { should be_an_instance_of Hubspot::Deal }
|
15
|
+
its (:portal_id) { should == 62515 }
|
16
|
+
its (:deal_id) { should == 3 }
|
17
|
+
end
|
18
|
+
|
19
|
+
describe ".create!" do
|
20
|
+
cassette "deal_create"
|
21
|
+
subject { Hubspot::Deal.create!(62515, [8954037], [27136], {}) }
|
22
|
+
its(:deal_id) { should_not be_nil }
|
23
|
+
its(:portal_id) { should eql 62515 }
|
24
|
+
its(:company_ids) { should eql [8954037]}
|
25
|
+
its(:vids) { should eql [27136]}
|
26
|
+
end
|
27
|
+
|
28
|
+
describe ".find" do
|
29
|
+
cassette "deal_find"
|
30
|
+
let(:deal) {Hubspot::Deal.create!(62515, [8954037], [27136], {})}
|
31
|
+
|
32
|
+
it 'must find by the deal id' do
|
33
|
+
find_deal = Hubspot::Deal.find(deal.deal_id)
|
34
|
+
find_deal.deal_id.should eql deal.deal_id
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -26,7 +26,7 @@ describe "Contacts API Live test", live: true do
|
|
26
26
|
contact.should_not be_present
|
27
27
|
end
|
28
28
|
|
29
|
-
it "finds a contact by utk" do
|
30
|
-
|
31
|
-
end
|
29
|
+
# it "finds a contact by utk" do
|
30
|
+
# Hubspot::Contact.find_by_utk("f844d2217850188692f2610c717c2e9b").should be_present
|
31
|
+
# end
|
32
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hubspot-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew DiMichele
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -213,6 +213,7 @@ files:
|
|
213
213
|
- lib/hubspot/blog.rb
|
214
214
|
- lib/hubspot/config.rb
|
215
215
|
- lib/hubspot/contact.rb
|
216
|
+
- lib/hubspot/deal.rb
|
216
217
|
- lib/hubspot/exceptions.rb
|
217
218
|
- lib/hubspot/form.rb
|
218
219
|
- lib/hubspot/topic.rb
|
@@ -231,6 +232,9 @@ files:
|
|
231
232
|
- spec/fixtures/vcr_cassettes/contact_find_by_id.yml
|
232
233
|
- spec/fixtures/vcr_cassettes/contact_find_by_utk.yml
|
233
234
|
- spec/fixtures/vcr_cassettes/contact_update.yml
|
235
|
+
- spec/fixtures/vcr_cassettes/deal_create.yml
|
236
|
+
- spec/fixtures/vcr_cassettes/deal_example.yml
|
237
|
+
- spec/fixtures/vcr_cassettes/deal_find.yml
|
234
238
|
- spec/fixtures/vcr_cassettes/form_post.yml
|
235
239
|
- spec/fixtures/vcr_cassettes/one_month_blog_posts_filter_state.yml
|
236
240
|
- spec/fixtures/vcr_cassettes/one_month_blog_posts_list.yml
|
@@ -240,6 +244,7 @@ files:
|
|
240
244
|
- spec/lib/hubspot/blog_spec.rb
|
241
245
|
- spec/lib/hubspot/config_spec.rb
|
242
246
|
- spec/lib/hubspot/contact_spec.rb
|
247
|
+
- spec/lib/hubspot/deal_spec.rb
|
243
248
|
- spec/lib/hubspot/form_spec.rb
|
244
249
|
- spec/lib/hubspot/topic_spec.rb
|
245
250
|
- spec/lib/hubspot/utils_spec.rb
|
@@ -265,7 +270,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
265
270
|
version: '0'
|
266
271
|
requirements: []
|
267
272
|
rubyforge_project:
|
268
|
-
rubygems_version: 2.
|
273
|
+
rubygems_version: 2.4.3
|
269
274
|
signing_key:
|
270
275
|
specification_version: 4
|
271
276
|
summary: hubspot-ruby is a wrapper for the HubSpot REST API
|