invoiced 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/invoiced/operations/delete.rb +4 -1
- data/lib/invoiced/version.rb +1 -1
- data/test/invoiced/subscription_test.rb +3 -2
- data/test/test_helper.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa11b34d70bec29ca5779f24577e670d2c353334
|
4
|
+
data.tar.gz: effd3ba53fa846fc0bfeab4d7857ef175556883a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c4fa6e0cd27496ba092cb48d3f0d150d73ebd337d97afbf262af900693aead1489a3aa92f2055bddb110e33918ad33479dfd62c3d5dd68c3ec924125d42470b
|
7
|
+
data.tar.gz: ceab2b357f815ddd111bfb6b8efc31800f0d64c4a606e36390dae60ce9552a8e24653fde7968b72a51e0c4161bf0a705e36740353aeaf44ea676cf17a4bd0561
|
data/Gemfile
CHANGED
@@ -5,5 +5,5 @@ gem 'json', '~> 1.8.3'
|
|
5
5
|
gem 'rest-client', '~> 1.8.0'
|
6
6
|
gem 'activesupport', '~> 4.2.3'
|
7
7
|
gem 'coveralls', :require => false, :group => :test
|
8
|
-
gem 'simplecov', :require => false, :group => :test
|
8
|
+
gem 'simplecov', '~> 0.10.0', :require => false, :group => :test
|
9
9
|
gem 'simplecov-console', :require => false, :group => :test
|
@@ -6,9 +6,12 @@ module Invoiced
|
|
6
6
|
|
7
7
|
if response[:code] == 204
|
8
8
|
refresh_from({:id => @id})
|
9
|
+
elsif response[:code] == 200
|
10
|
+
# update the local values with the response
|
11
|
+
refresh_from(response[:body].dup.merge({:id => self.id}))
|
9
12
|
end
|
10
13
|
|
11
|
-
return response[:code] == 204
|
14
|
+
return response[:code] == 204 || response[:code] == 200
|
12
15
|
end
|
13
16
|
end
|
14
17
|
end
|
data/lib/invoiced/version.rb
CHANGED
@@ -77,14 +77,15 @@ module Invoiced
|
|
77
77
|
|
78
78
|
should "cancel a subscription" do
|
79
79
|
mockResponse = mock('RestClient::Response')
|
80
|
-
mockResponse.stubs(:code).returns(
|
81
|
-
mockResponse.stubs(:body).returns('')
|
80
|
+
mockResponse.stubs(:code).returns(200)
|
81
|
+
mockResponse.stubs(:body).returns('{"id":123,"plan":"pro","status":"canceled"}')
|
82
82
|
mockResponse.stubs(:headers).returns({})
|
83
83
|
|
84
84
|
RestClient::Request.any_instance.expects(:execute).returns(mockResponse)
|
85
85
|
|
86
86
|
subscription = Subscription.new(@client, 123)
|
87
87
|
assert_true(subscription.cancel)
|
88
|
+
assert_equal("canceled", subscription.status)
|
88
89
|
end
|
89
90
|
end
|
90
91
|
end
|
data/test/test_helper.rb
CHANGED
@@ -2,10 +2,10 @@ require 'simplecov'
|
|
2
2
|
require 'simplecov-console'
|
3
3
|
require 'coveralls'
|
4
4
|
|
5
|
-
SimpleCov.
|
5
|
+
SimpleCov.formatters = [
|
6
6
|
SimpleCov::Formatter::Console,
|
7
7
|
Coveralls::SimpleCov::Formatter
|
8
|
-
]
|
8
|
+
]
|
9
9
|
SimpleCov.start do
|
10
10
|
add_filter 'test/'
|
11
11
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: invoiced
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jared King
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|