pipeline_deals 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,61 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://127.0.0.1:3000/api/v3/deals.json?api_key=n8PJJWRsx0MxgOEwGk7&page=2&per_page=5
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Date:
22
+ - Mon, 22 Apr 2013 21:17:52 GMT
23
+ Status:
24
+ - 200 OK
25
+ Connection:
26
+ - close
27
+ Set-Cookie:
28
+ - _session_id=d591a74b50fb63df9c3bfdedc7f66807; path=/; HttpOnly
29
+ - is_legacy_user=; domain=pipelinedeals.com; path=/; expires=Thu, 01-Jan-1970
30
+ 00:00:00 GMT
31
+ Content-Length:
32
+ - '3573'
33
+ Content-Type:
34
+ - application/json; charset=utf-8
35
+ Cache-Control:
36
+ - private, max-age=0, must-revalidate
37
+ Etag:
38
+ - ! '"07586330fcab734b3878c6cf6de5c7af"'
39
+ X-Runtime:
40
+ - '67'
41
+ body:
42
+ encoding: US-ASCII
43
+ string: ! '{"pagination":{"pages":29,"page":2,"page_var":"page","per_page":5,"total":142},"entries":[{"summary":null,"primary_contact_id":null,"expected_close_date":null,"deal_stage_id":null,"name":"monetize
44
+ strategic ROI","primary_contact":null,"user_id":1,"company_id":null,"source_id":null,"is_example":null,"created_at":"2013/04/16
45
+ 10:09:43 -0400","company":null,"person_ids":[],"collaborators":[],"people":[],"status":1,"custom_fields":{"custom_label_29":null,"custom_label_27":null,"custom_label_26":null,"custom_label_25":null},"probability":39,"is_archived":false,"closed_time":null,"deal_stage":null,"id":6,"user":{"id":1,"last_name":"hoboson","first_name":"hobo"},"value_in_cents":365857,"import_id":null,"updated_at":"2013/04/16
46
+ 10:09:44 -0400","expected_close_date_event_id":null},{"summary":null,"primary_contact_id":null,"expected_close_date":null,"deal_stage_id":null,"name":"architect
47
+ B2C ROI","primary_contact":null,"user_id":1,"company_id":null,"source_id":null,"is_example":null,"created_at":"2013/04/16
48
+ 10:09:44 -0400","company":null,"person_ids":[],"collaborators":[],"people":[],"status":-1,"custom_fields":{"custom_label_29":null,"custom_label_27":null,"custom_label_26":null,"custom_label_25":null},"probability":2,"is_archived":false,"closed_time":null,"deal_stage":null,"id":7,"user":{"id":1,"last_name":"hoboson","first_name":"hobo"},"value_in_cents":7919635,"import_id":null,"updated_at":"2013/04/16
49
+ 10:09:44 -0400","expected_close_date_event_id":null},{"summary":null,"primary_contact_id":null,"expected_close_date":null,"deal_stage_id":null,"name":"cultivate
50
+ back-end models","primary_contact":null,"user_id":1,"company_id":null,"source_id":null,"is_example":null,"created_at":"2013/04/16
51
+ 10:09:44 -0400","company":null,"person_ids":[],"collaborators":[],"people":[],"status":0,"custom_fields":{"custom_label_29":null,"custom_label_27":null,"custom_label_26":null,"custom_label_25":null},"probability":53,"is_archived":false,"closed_time":null,"deal_stage":null,"id":8,"user":{"id":1,"last_name":"hoboson","first_name":"hobo"},"value_in_cents":4737478,"import_id":null,"updated_at":"2013/04/16
52
+ 10:09:44 -0400","expected_close_date_event_id":null},{"summary":null,"primary_contact_id":null,"expected_close_date":null,"deal_stage_id":null,"name":"deliver
53
+ ubiquitous infrastructures","primary_contact":null,"user_id":1,"company_id":null,"source_id":null,"is_example":null,"created_at":"2013/04/16
54
+ 10:09:44 -0400","company":null,"person_ids":[],"collaborators":[],"people":[],"status":-1,"custom_fields":{"custom_label_29":null,"custom_label_27":null,"custom_label_26":null,"custom_label_25":null},"probability":4,"is_archived":false,"closed_time":null,"deal_stage":null,"id":9,"user":{"id":1,"last_name":"hoboson","first_name":"hobo"},"value_in_cents":8211008,"import_id":null,"updated_at":"2013/04/16
55
+ 10:09:44 -0400","expected_close_date_event_id":null},{"summary":null,"primary_contact_id":null,"expected_close_date":null,"deal_stage_id":null,"name":"brand
56
+ leading-edge e-tailers","primary_contact":null,"user_id":1,"company_id":null,"source_id":null,"is_example":null,"created_at":"2013/04/16
57
+ 10:09:45 -0400","company":null,"person_ids":[],"collaborators":[],"people":[],"status":-1,"custom_fields":{"custom_label_29":null,"custom_label_27":null,"custom_label_26":null,"custom_label_25":null},"probability":40,"is_archived":false,"closed_time":null,"deal_stage":null,"id":10,"user":{"id":1,"last_name":"hoboson","first_name":"hobo"},"value_in_cents":6172077,"import_id":null,"updated_at":"2013/04/16
58
+ 10:09:45 -0400","expected_close_date_event_id":null}]}'
59
+ http_version:
60
+ recorded_at: Mon, 22 Apr 2013 21:17:52 GMT
61
+ recorded_with: VCR 2.3.0
@@ -0,0 +1,53 @@
1
+ require 'spec_helper'
2
+ describe PipelineDeals do
3
+
4
+ describe "setting the api key" do
5
+ it "should allow setting the api key" do
6
+ PipelineDeals.should respond_to(:api_key)
7
+ end
8
+
9
+ it "should hold the api key" do
10
+ PipelineDeals.api_key = "n8PJJWRsx0MxgOEwGk7"
11
+ PipelineDeals.api_key.should eql("n8PJJWRsx0MxgOEwGk7")
12
+ end
13
+ end
14
+
15
+ describe "deals" do
16
+ describe "list deals" do
17
+ it "should list deals correctly" do
18
+ VCR.use_cassette(:list_deals) do
19
+ deals = PipelineDeals::Deal.find(:all)
20
+ deals.count.should eql(142)
21
+ deals.first.class.should eql(PipelineDeals::Deal)
22
+ end
23
+ end
24
+ describe "pagination" do
25
+ it "should paginate" do
26
+ VCR.use_cassette(:paginate_deals) do
27
+ deals = PipelineDeals::Deal.where(per_page: 5, page: 2)
28
+ deals.count.should eql(5)
29
+ deals.pagination.should_not be_nil
30
+ deals.pagination['page'].should eql(2)
31
+ deals.pagination['pages'].should eql(29)
32
+ end
33
+ end
34
+ end
35
+
36
+ describe "filtering deals" do
37
+
38
+ end
39
+ end
40
+
41
+ describe "get a single deal" do
42
+ end
43
+
44
+ describe "update a deal" do
45
+
46
+ end
47
+
48
+ describe "delete a deal" do
49
+
50
+ end
51
+ end
52
+ end
53
+
@@ -0,0 +1,14 @@
1
+ require 'rubygems'
2
+ require 'vcr'
3
+ require 'pipeline_deals'
4
+ require 'pry'
5
+
6
+ VCR.configure do |c|
7
+ c.cassette_library_dir = './spec/cassettes'
8
+ c.hook_into :webmock
9
+ c.default_cassette_options = { :record => :new_episodes }
10
+ end
11
+
12
+ RSpec.configure do |c|
13
+ c.extend VCR::RSpec::Macros
14
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pipeline_deals
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Grant Ammons
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-05-17 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: activeresource
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - '='
20
+ - !ruby/object:Gem::Version
21
+ version: 4.0.0.beta1
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - '='
28
+ - !ruby/object:Gem::Version
29
+ version: 4.0.0.beta1
30
+ description: The pipeline_deals gem is a nice ruby wrapper around the PipelineDeals
31
+ API.
32
+ email:
33
+ - gammons@gmail.com
34
+ executables: []
35
+ extensions: []
36
+ extra_rdoc_files: []
37
+ files:
38
+ - .gitignore
39
+ - Gemfile
40
+ - Gemfile.lock
41
+ - LICENSE.txt
42
+ - README.md
43
+ - Rakefile
44
+ - a_spike.rb
45
+ - lib/collection.rb
46
+ - lib/pipeline_deals.rb
47
+ - lib/resource.rb
48
+ - lib/resources/company.rb
49
+ - lib/resources/deal.rb
50
+ - lib/resources/definitions.rb
51
+ - lib/resources/person.rb
52
+ - lib/resources/user.rb
53
+ - lib/version.rb
54
+ - pipeline_deals.gemspec
55
+ - spec/cassettes/list_deals.yml
56
+ - spec/cassettes/paginate_deals.yml
57
+ - spec/pipelinedeals_spec.rb
58
+ - spec/spec_helper.rb
59
+ homepage: https://github.com/PipelineDeals/pipelinedeals_api
60
+ licenses: []
61
+ post_install_message:
62
+ rdoc_options: []
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ! '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubyforge_project:
79
+ rubygems_version: 1.8.23
80
+ signing_key:
81
+ specification_version: 3
82
+ summary: The pipeline_deals gem is a nice ruby wrapper around the PipelineDeals API.
83
+ test_files:
84
+ - spec/cassettes/list_deals.yml
85
+ - spec/cassettes/paginate_deals.yml
86
+ - spec/pipelinedeals_spec.rb
87
+ - spec/spec_helper.rb
88
+ has_rdoc: