edools-api 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/edools-api.gemspec +10 -3
- data/lib/edools/ecommerce.rb +1 -0
- data/lib/edools/ecommerce/coupon.rb +20 -0
- data/spec/edools/ecommerce/coupon_spec.rb +37 -0
- data/spec/fixtures/vcr_cassettes/Edools_Ecommerce_Coupon/create_the_coupon.yml +65 -0
- data/spec/fixtures/vcr_cassettes/Edools_Ecommerce_Coupon/destroy_the_coupon.yml +114 -0
- data/spec/fixtures/vcr_cassettes/Edools_Ecommerce_Coupon/finds_all_coupons.yml +62 -0
- data/spec/fixtures/vcr_cassettes/Edools_Ecommerce_Coupon/finds_the_coupon.yml +62 -0
- data/spec/fixtures/vcr_cassettes/Edools_Ecommerce_Coupon/update_the_coupon.yml +119 -0
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c1efe25fce203d782cc91ea2cfc9e9ae126ccb8
|
4
|
+
data.tar.gz: b68464fbbc59264fabbbbfadbce6d958b824f056
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5023271f057c6119eb9e6c09d51cc9672231c870924b30d4c615ab82f2554beed8dceafdcbffa0a90d51113a7b61759bf6c828d0676c1a7e3046c5f96fb6a39
|
7
|
+
data.tar.gz: 653277d723446c31589df67feee50c18c2d0dee42dc8bee789351696a7ce699d5a69cfc826520bcb2a5acf03946be8746f099fadf24f761e2fce2fbea8c3c513
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.9.0
|
data/edools-api.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: edools-api 0.
|
5
|
+
# stub: edools-api 0.9.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "edools-api"
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.9.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Vinicius Kastrup"]
|
14
|
-
s.date = "2015-07-
|
14
|
+
s.date = "2015-07-16"
|
15
15
|
s.description = "\n With this gem you'll be able to access and manipulate all the data of your School or Organization\n hosted at Edools.\n "
|
16
16
|
s.email = "viniciusmkm@gmail.com"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -52,6 +52,7 @@ Gem::Specification.new do |s|
|
|
52
52
|
"lib/edools/core/student.rb",
|
53
53
|
"lib/edools/ecommerce.rb",
|
54
54
|
"lib/edools/ecommerce/base.rb",
|
55
|
+
"lib/edools/ecommerce/coupon.rb",
|
55
56
|
"lib/edools/ecommerce/product.rb",
|
56
57
|
"lib/edools/initialization.rb",
|
57
58
|
"lib/edools/paginated_collection.rb",
|
@@ -74,6 +75,7 @@ Gem::Specification.new do |s|
|
|
74
75
|
"spec/edools/core/session_spec.rb",
|
75
76
|
"spec/edools/core/student_spec.rb",
|
76
77
|
"spec/edools/ecommerce/base_spec.rb",
|
78
|
+
"spec/edools/ecommerce/coupon_spec.rb",
|
77
79
|
"spec/edools/ecommerce/product_spec.rb",
|
78
80
|
"spec/fixtures/vcr_cassettes/Edools_Core_Address/create_the_address.yml",
|
79
81
|
"spec/fixtures/vcr_cassettes/Edools_Core_Address/destroy_the_address.yml",
|
@@ -140,6 +142,11 @@ Gem::Specification.new do |s|
|
|
140
142
|
"spec/fixtures/vcr_cassettes/Edools_Core_Student/finds_all_student.yml",
|
141
143
|
"spec/fixtures/vcr_cassettes/Edools_Core_Student/finds_the_student.yml",
|
142
144
|
"spec/fixtures/vcr_cassettes/Edools_Core_Student/update_the_student.yml",
|
145
|
+
"spec/fixtures/vcr_cassettes/Edools_Ecommerce_Coupon/create_the_coupon.yml",
|
146
|
+
"spec/fixtures/vcr_cassettes/Edools_Ecommerce_Coupon/destroy_the_coupon.yml",
|
147
|
+
"spec/fixtures/vcr_cassettes/Edools_Ecommerce_Coupon/finds_all_coupons.yml",
|
148
|
+
"spec/fixtures/vcr_cassettes/Edools_Ecommerce_Coupon/finds_the_coupon.yml",
|
149
|
+
"spec/fixtures/vcr_cassettes/Edools_Ecommerce_Coupon/update_the_coupon.yml",
|
143
150
|
"spec/fixtures/vcr_cassettes/Edools_Ecommerce_Product/create_the_product.yml",
|
144
151
|
"spec/fixtures/vcr_cassettes/Edools_Ecommerce_Product/destroy_the_product.yml",
|
145
152
|
"spec/fixtures/vcr_cassettes/Edools_Ecommerce_Product/finds_all_product.yml",
|
data/lib/edools/ecommerce.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'edools/ecommerce/base'
|
2
|
+
require 'edools/paginated_collection'
|
3
|
+
|
4
|
+
module Edools
|
5
|
+
module Ecommerce
|
6
|
+
class Coupon < Edools::Ecommerce::Base
|
7
|
+
self.collection_parser = Edools::PaginatedCollection
|
8
|
+
|
9
|
+
def self.collection_path(prefix_options = {}, query_options = nil)
|
10
|
+
super
|
11
|
+
product_guid = prefix_options[:product_guid] || query_options.try(:[], :product_guid)
|
12
|
+
if product_guid
|
13
|
+
"/products/#{product_guid}/#{collection_name}.#{format.extension}#{query_string(query_options)}"
|
14
|
+
else
|
15
|
+
"/#{collection_name}.#{format.extension}#{query_string(query_options)}"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
|
3
|
+
describe Edools::Ecommerce::Coupon, :vcr do
|
4
|
+
it 'finds all coupons' do
|
5
|
+
coupons = Edools::Ecommerce::Coupon.all(params: { product_guid: 2519 })
|
6
|
+
|
7
|
+
expect(coupons.count).to eq 1
|
8
|
+
expect(coupons.per_page). to eq 10
|
9
|
+
expect(coupons.current_page). to eq 1
|
10
|
+
expect(coupons.total_count). to eq 1
|
11
|
+
expect(coupons.total_pages). to eq 1
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'finds the coupon' do
|
15
|
+
coupon = Edools::Ecommerce::Coupon.find(2626)
|
16
|
+
|
17
|
+
expect(coupon.id).to eq 2626
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'update the coupon' do
|
21
|
+
coupon = Edools::Ecommerce::Coupon.find(2626)
|
22
|
+
coupon.name = "Edools API Test UPDATED"
|
23
|
+
|
24
|
+
expect(coupon.save).to eq true
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'create the coupon' do
|
28
|
+
coupon = Edools::Ecommerce::Coupon.new(name: 'Edools API Test', token_type: 'autogenerated', quantity: 50, value: 50, percentual: true)
|
29
|
+
|
30
|
+
expect(coupon.save).to eq true
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'destroy the coupon' do
|
34
|
+
coupon = Edools::Ecommerce::Coupon.find(3118)
|
35
|
+
expect(coupon.destroy.code).to eq '204'
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://ecommerce.edools.com/coupons.json
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"coupon":{"name":"Edools API Test","token_type":"autogenerated","quantity":50,"value":50,"percentual":true}}'
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/json
|
12
|
+
Authorization:
|
13
|
+
- Token token=84cc0400cd52f62f2e12309b502889ab:2fee1e06d56ab6394ab9acd4c6a8c62f
|
14
|
+
Accept:
|
15
|
+
- application/+json
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
User-Agent:
|
19
|
+
- Ruby
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 201
|
23
|
+
message: Created
|
24
|
+
headers:
|
25
|
+
Cache-Control:
|
26
|
+
- max-age=0, private, must-revalidate
|
27
|
+
Content-Security-Policy-Report-Only:
|
28
|
+
- default-src https://* 'self'; connect-src https://* 'self'; font-src https://*
|
29
|
+
'self'; frame-src https://* 'self'; img-src https://* 'self' data:; media-src
|
30
|
+
https://* 'self'; object-src https://* 'self'; script-src https://* 'self';
|
31
|
+
style-src https://* 'self'; report-uri https://core.edools.com/uri-directive;
|
32
|
+
Content-Type:
|
33
|
+
- application/vnd.edools.ecommerce.v1+json; charset=utf-8
|
34
|
+
Date:
|
35
|
+
- Thu, 16 Jul 2015 19:12:42 GMT
|
36
|
+
Etag:
|
37
|
+
- '"9280d6c754c03dfa6b610fad08838d6a"'
|
38
|
+
Location:
|
39
|
+
- https://ecommerce.edools.com/coupons/3118
|
40
|
+
Server:
|
41
|
+
- nginx/1.4.7
|
42
|
+
Status:
|
43
|
+
- 201 Created
|
44
|
+
Strict-Transport-Security:
|
45
|
+
- max-age=631152000; includeSubdomains
|
46
|
+
X-Content-Type-Options:
|
47
|
+
- nosniff
|
48
|
+
X-Frame-Options:
|
49
|
+
- DENY
|
50
|
+
X-Request-Id:
|
51
|
+
- 2227035f-6d33-4ced-9be5-ffa995e47bbc
|
52
|
+
X-Runtime:
|
53
|
+
- '0.425766'
|
54
|
+
X-Xss-Protection:
|
55
|
+
- 1; mode=block
|
56
|
+
Transfer-Encoding:
|
57
|
+
- chunked
|
58
|
+
Connection:
|
59
|
+
- keep-alive
|
60
|
+
body:
|
61
|
+
encoding: UTF-8
|
62
|
+
string: '{"id":3118,"name":"Edools API Test","token_type":"autogenerated","quantity":50,"available_until":null,"created_at":"2015-07-16T19:12:42.646Z","updated_at":"2015-07-16T19:12:42.646Z","percentual":true,"value":50,"school_id":1}'
|
63
|
+
http_version:
|
64
|
+
recorded_at: Thu, 16 Jul 2015 19:12:43 GMT
|
65
|
+
recorded_with: VCR 2.9.2
|
@@ -0,0 +1,114 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://ecommerce.edools.com/coupons/3118.json
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/+json
|
12
|
+
Authorization:
|
13
|
+
- Token token=84cc0400cd52f62f2e12309b502889ab:2fee1e06d56ab6394ab9acd4c6a8c62f
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
User-Agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Cache-Control:
|
24
|
+
- max-age=0, private, must-revalidate
|
25
|
+
Content-Security-Policy-Report-Only:
|
26
|
+
- default-src https://* 'self'; connect-src https://* 'self'; font-src https://*
|
27
|
+
'self'; frame-src https://* 'self'; img-src https://* 'self' data:; media-src
|
28
|
+
https://* 'self'; object-src https://* 'self'; script-src https://* 'self';
|
29
|
+
style-src https://* 'self'; report-uri https://core.edools.com/uri-directive;
|
30
|
+
Content-Type:
|
31
|
+
- application/vnd.edools.ecommerce.v1+json; charset=utf-8
|
32
|
+
Date:
|
33
|
+
- Thu, 16 Jul 2015 19:14:25 GMT
|
34
|
+
Etag:
|
35
|
+
- '"978d7d05f249061c26effa9d4b18d554"'
|
36
|
+
Server:
|
37
|
+
- nginx/1.4.7
|
38
|
+
Status:
|
39
|
+
- 200 OK
|
40
|
+
Strict-Transport-Security:
|
41
|
+
- max-age=631152000; includeSubdomains
|
42
|
+
X-Content-Type-Options:
|
43
|
+
- nosniff
|
44
|
+
X-Frame-Options:
|
45
|
+
- DENY
|
46
|
+
X-Request-Id:
|
47
|
+
- 2abcf4f1-56c7-4a76-b9de-5bc30b3fd663
|
48
|
+
X-Runtime:
|
49
|
+
- '2.953223'
|
50
|
+
X-Xss-Protection:
|
51
|
+
- 1; mode=block
|
52
|
+
Content-Length:
|
53
|
+
- '324'
|
54
|
+
Connection:
|
55
|
+
- keep-alive
|
56
|
+
body:
|
57
|
+
encoding: UTF-8
|
58
|
+
string: '{"id":3118,"name":"Edools API Test","token_type":"autogenerated","quantity":50,"available_until":null,"created_at":"2015-07-16
|
59
|
+
19:12:42 UTC","updated_at":"2015-07-16 19:12:42 UTC","percentual":true,"value":50,"school_id":1,"used_quantity":0,"customer_ids":[],"customer_guids":[],"plan_ids":[],"product_ids":[],"global":true}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Thu, 16 Jul 2015 19:14:25 GMT
|
62
|
+
- request:
|
63
|
+
method: delete
|
64
|
+
uri: https://ecommerce.edools.com/coupons/3118.json
|
65
|
+
body:
|
66
|
+
encoding: US-ASCII
|
67
|
+
string: ''
|
68
|
+
headers:
|
69
|
+
Accept:
|
70
|
+
- application/+json
|
71
|
+
Authorization:
|
72
|
+
- Token token=84cc0400cd52f62f2e12309b502889ab:2fee1e06d56ab6394ab9acd4c6a8c62f
|
73
|
+
Accept-Encoding:
|
74
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
75
|
+
User-Agent:
|
76
|
+
- Ruby
|
77
|
+
response:
|
78
|
+
status:
|
79
|
+
code: 204
|
80
|
+
message: No Content
|
81
|
+
headers:
|
82
|
+
Cache-Control:
|
83
|
+
- no-cache
|
84
|
+
Content-Security-Policy-Report-Only:
|
85
|
+
- default-src https://* 'self'; connect-src https://* 'self'; font-src https://*
|
86
|
+
'self'; frame-src https://* 'self'; img-src https://* 'self' data:; media-src
|
87
|
+
https://* 'self'; object-src https://* 'self'; script-src https://* 'self';
|
88
|
+
style-src https://* 'self'; report-uri https://core.edools.com/uri-directive;
|
89
|
+
Date:
|
90
|
+
- Thu, 16 Jul 2015 19:14:26 GMT
|
91
|
+
Server:
|
92
|
+
- nginx/1.4.7
|
93
|
+
Status:
|
94
|
+
- 204 No Content
|
95
|
+
Strict-Transport-Security:
|
96
|
+
- max-age=631152000; includeSubdomains
|
97
|
+
X-Content-Type-Options:
|
98
|
+
- nosniff
|
99
|
+
X-Frame-Options:
|
100
|
+
- DENY
|
101
|
+
X-Request-Id:
|
102
|
+
- d8f68b6b-8966-42b1-afaa-7830cc5eaf75
|
103
|
+
X-Runtime:
|
104
|
+
- '0.303610'
|
105
|
+
X-Xss-Protection:
|
106
|
+
- 1; mode=block
|
107
|
+
Connection:
|
108
|
+
- keep-alive
|
109
|
+
body:
|
110
|
+
encoding: UTF-8
|
111
|
+
string: ''
|
112
|
+
http_version:
|
113
|
+
recorded_at: Thu, 16 Jul 2015 19:14:26 GMT
|
114
|
+
recorded_with: VCR 2.9.2
|
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://ecommerce.edools.com/products/2519/coupons.json?product_guid=2519
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/+json
|
12
|
+
Authorization:
|
13
|
+
- Token token=84cc0400cd52f62f2e12309b502889ab:2fee1e06d56ab6394ab9acd4c6a8c62f
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
User-Agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Cache-Control:
|
24
|
+
- max-age=0, private, must-revalidate
|
25
|
+
Content-Security-Policy-Report-Only:
|
26
|
+
- default-src https://* 'self'; connect-src https://* 'self'; font-src https://*
|
27
|
+
'self'; frame-src https://* 'self'; img-src https://* 'self' data:; media-src
|
28
|
+
https://* 'self'; object-src https://* 'self'; script-src https://* 'self';
|
29
|
+
style-src https://* 'self'; report-uri https://core.edools.com/uri-directive;
|
30
|
+
Content-Type:
|
31
|
+
- application/vnd.edools.ecommerce.v1+json; charset=utf-8
|
32
|
+
Date:
|
33
|
+
- Thu, 16 Jul 2015 19:02:03 GMT
|
34
|
+
Etag:
|
35
|
+
- '"52cc284eee6d2687acca185017b35ff0"'
|
36
|
+
Server:
|
37
|
+
- nginx/1.4.7
|
38
|
+
Status:
|
39
|
+
- 200 OK
|
40
|
+
Strict-Transport-Security:
|
41
|
+
- max-age=631152000; includeSubdomains
|
42
|
+
X-Content-Type-Options:
|
43
|
+
- nosniff
|
44
|
+
X-Frame-Options:
|
45
|
+
- DENY
|
46
|
+
X-Request-Id:
|
47
|
+
- d2b18869-1afe-49a6-9010-00b095952917
|
48
|
+
X-Runtime:
|
49
|
+
- '0.216226'
|
50
|
+
X-Xss-Protection:
|
51
|
+
- 1; mode=block
|
52
|
+
Content-Length:
|
53
|
+
- '412'
|
54
|
+
Connection:
|
55
|
+
- keep-alive
|
56
|
+
body:
|
57
|
+
encoding: UTF-8
|
58
|
+
string: '{"coupons":[{"id":2626,"name":"teste 20/05","token_type":"manual","quantity":10,"available_until":null,"created_at":"2015-05-20
|
59
|
+
16:25:27 UTC","updated_at":"2015-05-20 16:25:39 UTC","percentual":false,"value":10000,"school_id":1,"used_quantity":0,"customer_ids":[42],"customer_guids":["2380"],"plan_ids":[],"product_ids":[2449,2466],"global":false}],"current_page":1,"per_page":10,"total_pages":1,"total_count":1}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Thu, 16 Jul 2015 19:02:03 GMT
|
62
|
+
recorded_with: VCR 2.9.2
|
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://ecommerce.edools.com/coupons/2626.json
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/+json
|
12
|
+
Authorization:
|
13
|
+
- Token token=84cc0400cd52f62f2e12309b502889ab:2fee1e06d56ab6394ab9acd4c6a8c62f
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
User-Agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Cache-Control:
|
24
|
+
- max-age=0, private, must-revalidate
|
25
|
+
Content-Security-Policy-Report-Only:
|
26
|
+
- default-src https://* 'self'; connect-src https://* 'self'; font-src https://*
|
27
|
+
'self'; frame-src https://* 'self'; img-src https://* 'self' data:; media-src
|
28
|
+
https://* 'self'; object-src https://* 'self'; script-src https://* 'self';
|
29
|
+
style-src https://* 'self'; report-uri https://core.edools.com/uri-directive;
|
30
|
+
Content-Type:
|
31
|
+
- application/vnd.edools.ecommerce.v1+json; charset=utf-8
|
32
|
+
Date:
|
33
|
+
- Thu, 16 Jul 2015 19:04:38 GMT
|
34
|
+
Etag:
|
35
|
+
- '"e1000d23fcb2015f751b009f9ca0b709"'
|
36
|
+
Server:
|
37
|
+
- nginx/1.4.7
|
38
|
+
Status:
|
39
|
+
- 200 OK
|
40
|
+
Strict-Transport-Security:
|
41
|
+
- max-age=631152000; includeSubdomains
|
42
|
+
X-Content-Type-Options:
|
43
|
+
- nosniff
|
44
|
+
X-Frame-Options:
|
45
|
+
- DENY
|
46
|
+
X-Request-Id:
|
47
|
+
- c98c1481-6124-4558-b333-8ca52693e322
|
48
|
+
X-Runtime:
|
49
|
+
- '0.159915'
|
50
|
+
X-Xss-Protection:
|
51
|
+
- 1; mode=block
|
52
|
+
Content-Length:
|
53
|
+
- '335'
|
54
|
+
Connection:
|
55
|
+
- keep-alive
|
56
|
+
body:
|
57
|
+
encoding: UTF-8
|
58
|
+
string: '{"id":2626,"name":"teste 20/05","token_type":"manual","quantity":10,"available_until":null,"created_at":"2015-05-20
|
59
|
+
16:25:27 UTC","updated_at":"2015-05-20 16:25:39 UTC","percentual":false,"value":10000,"school_id":1,"used_quantity":0,"customer_ids":[42],"customer_guids":["2380"],"plan_ids":[],"product_ids":[2449,2466],"global":false}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Thu, 16 Jul 2015 19:04:38 GMT
|
62
|
+
recorded_with: VCR 2.9.2
|
@@ -0,0 +1,119 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://ecommerce.edools.com/coupons/2626.json
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/+json
|
12
|
+
Authorization:
|
13
|
+
- Token token=84cc0400cd52f62f2e12309b502889ab:2fee1e06d56ab6394ab9acd4c6a8c62f
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
User-Agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Cache-Control:
|
24
|
+
- max-age=0, private, must-revalidate
|
25
|
+
Content-Security-Policy-Report-Only:
|
26
|
+
- default-src https://* 'self'; connect-src https://* 'self'; font-src https://*
|
27
|
+
'self'; frame-src https://* 'self'; img-src https://* 'self' data:; media-src
|
28
|
+
https://* 'self'; object-src https://* 'self'; script-src https://* 'self';
|
29
|
+
style-src https://* 'self'; report-uri https://core.edools.com/uri-directive;
|
30
|
+
Content-Type:
|
31
|
+
- application/vnd.edools.ecommerce.v1+json; charset=utf-8
|
32
|
+
Date:
|
33
|
+
- Thu, 16 Jul 2015 19:07:13 GMT
|
34
|
+
Etag:
|
35
|
+
- '"e1000d23fcb2015f751b009f9ca0b709"'
|
36
|
+
Server:
|
37
|
+
- nginx/1.4.7
|
38
|
+
Status:
|
39
|
+
- 200 OK
|
40
|
+
Strict-Transport-Security:
|
41
|
+
- max-age=631152000; includeSubdomains
|
42
|
+
X-Content-Type-Options:
|
43
|
+
- nosniff
|
44
|
+
X-Frame-Options:
|
45
|
+
- DENY
|
46
|
+
X-Request-Id:
|
47
|
+
- 65de7645-32b6-4829-aa14-6ba290a7018b
|
48
|
+
X-Runtime:
|
49
|
+
- '0.076279'
|
50
|
+
X-Xss-Protection:
|
51
|
+
- 1; mode=block
|
52
|
+
Content-Length:
|
53
|
+
- '335'
|
54
|
+
Connection:
|
55
|
+
- keep-alive
|
56
|
+
body:
|
57
|
+
encoding: UTF-8
|
58
|
+
string: '{"id":2626,"name":"teste 20/05","token_type":"manual","quantity":10,"available_until":null,"created_at":"2015-05-20
|
59
|
+
16:25:27 UTC","updated_at":"2015-05-20 16:25:39 UTC","percentual":false,"value":10000,"school_id":1,"used_quantity":0,"customer_ids":[42],"customer_guids":["2380"],"plan_ids":[],"product_ids":[2449,2466],"global":false}'
|
60
|
+
http_version:
|
61
|
+
recorded_at: Thu, 16 Jul 2015 19:07:13 GMT
|
62
|
+
- request:
|
63
|
+
method: put
|
64
|
+
uri: https://ecommerce.edools.com/coupons/2626.json
|
65
|
+
body:
|
66
|
+
encoding: UTF-8
|
67
|
+
string: '{"coupon":{"id":2626,"name":"Edools API Test UPDATED","token_type":"manual","quantity":10,"available_until":null,"created_at":"2015-05-20
|
68
|
+
16:25:27 UTC","updated_at":"2015-05-20 16:25:39 UTC","percentual":false,"value":10000,"school_id":1,"used_quantity":0,"customer_ids":[42],"customer_guids":["2380"],"plan_ids":[],"product_ids":[2449,2466],"global":false}}'
|
69
|
+
headers:
|
70
|
+
Content-Type:
|
71
|
+
- application/json
|
72
|
+
Authorization:
|
73
|
+
- Token token=84cc0400cd52f62f2e12309b502889ab:2fee1e06d56ab6394ab9acd4c6a8c62f
|
74
|
+
Accept:
|
75
|
+
- application/+json
|
76
|
+
Accept-Encoding:
|
77
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
78
|
+
User-Agent:
|
79
|
+
- Ruby
|
80
|
+
response:
|
81
|
+
status:
|
82
|
+
code: 204
|
83
|
+
message: No Content
|
84
|
+
headers:
|
85
|
+
Cache-Control:
|
86
|
+
- no-cache
|
87
|
+
Content-Security-Policy-Report-Only:
|
88
|
+
- default-src https://* 'self'; connect-src https://* 'self'; font-src https://*
|
89
|
+
'self'; frame-src https://* 'self'; img-src https://* 'self' data:; media-src
|
90
|
+
https://* 'self'; object-src https://* 'self'; script-src https://* 'self';
|
91
|
+
style-src https://* 'self'; report-uri https://core.edools.com/uri-directive;
|
92
|
+
Date:
|
93
|
+
- Thu, 16 Jul 2015 19:07:14 GMT
|
94
|
+
Location:
|
95
|
+
- https://ecommerce.edools.com/coupons/2626
|
96
|
+
Server:
|
97
|
+
- nginx/1.4.7
|
98
|
+
Status:
|
99
|
+
- 204 No Content
|
100
|
+
Strict-Transport-Security:
|
101
|
+
- max-age=631152000; includeSubdomains
|
102
|
+
X-Content-Type-Options:
|
103
|
+
- nosniff
|
104
|
+
X-Frame-Options:
|
105
|
+
- DENY
|
106
|
+
X-Request-Id:
|
107
|
+
- 82d4f5e0-945a-4321-877b-af2fbf3ba4d2
|
108
|
+
X-Runtime:
|
109
|
+
- '0.138055'
|
110
|
+
X-Xss-Protection:
|
111
|
+
- 1; mode=block
|
112
|
+
Connection:
|
113
|
+
- keep-alive
|
114
|
+
body:
|
115
|
+
encoding: UTF-8
|
116
|
+
string: ''
|
117
|
+
http_version:
|
118
|
+
recorded_at: Thu, 16 Jul 2015 19:07:14 GMT
|
119
|
+
recorded_with: VCR 2.9.2
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: edools-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vinicius Kastrup
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeresource
|
@@ -192,6 +192,7 @@ files:
|
|
192
192
|
- lib/edools/core/student.rb
|
193
193
|
- lib/edools/ecommerce.rb
|
194
194
|
- lib/edools/ecommerce/base.rb
|
195
|
+
- lib/edools/ecommerce/coupon.rb
|
195
196
|
- lib/edools/ecommerce/product.rb
|
196
197
|
- lib/edools/initialization.rb
|
197
198
|
- lib/edools/paginated_collection.rb
|
@@ -214,6 +215,7 @@ files:
|
|
214
215
|
- spec/edools/core/session_spec.rb
|
215
216
|
- spec/edools/core/student_spec.rb
|
216
217
|
- spec/edools/ecommerce/base_spec.rb
|
218
|
+
- spec/edools/ecommerce/coupon_spec.rb
|
217
219
|
- spec/edools/ecommerce/product_spec.rb
|
218
220
|
- spec/fixtures/vcr_cassettes/Edools_Core_Address/create_the_address.yml
|
219
221
|
- spec/fixtures/vcr_cassettes/Edools_Core_Address/destroy_the_address.yml
|
@@ -280,6 +282,11 @@ files:
|
|
280
282
|
- spec/fixtures/vcr_cassettes/Edools_Core_Student/finds_all_student.yml
|
281
283
|
- spec/fixtures/vcr_cassettes/Edools_Core_Student/finds_the_student.yml
|
282
284
|
- spec/fixtures/vcr_cassettes/Edools_Core_Student/update_the_student.yml
|
285
|
+
- spec/fixtures/vcr_cassettes/Edools_Ecommerce_Coupon/create_the_coupon.yml
|
286
|
+
- spec/fixtures/vcr_cassettes/Edools_Ecommerce_Coupon/destroy_the_coupon.yml
|
287
|
+
- spec/fixtures/vcr_cassettes/Edools_Ecommerce_Coupon/finds_all_coupons.yml
|
288
|
+
- spec/fixtures/vcr_cassettes/Edools_Ecommerce_Coupon/finds_the_coupon.yml
|
289
|
+
- spec/fixtures/vcr_cassettes/Edools_Ecommerce_Coupon/update_the_coupon.yml
|
283
290
|
- spec/fixtures/vcr_cassettes/Edools_Ecommerce_Product/create_the_product.yml
|
284
291
|
- spec/fixtures/vcr_cassettes/Edools_Ecommerce_Product/destroy_the_product.yml
|
285
292
|
- spec/fixtures/vcr_cassettes/Edools_Ecommerce_Product/finds_all_product.yml
|