meducation_sdk 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/meducation_sdk/resource.rb +1 -0
- data/lib/meducation_sdk/resources/contribution.rb +22 -0
- data/lib/meducation_sdk/version.rb +1 -1
- data/test/resources/contribution_test.rb +17 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60aa1b12d04a90102dd4ea718c9202f64c1d2f7b
|
4
|
+
data.tar.gz: 9d4260c4f4cdcd4fb6acd8ef3ea0341df8456322
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 037fa70797656a9bd5cb57a24516cc01eec72583cfe17c38418e070d69eacff4e50587e8e9549955d9e9c1ebda4ca97ae455a0db65d4dca9a7cd279324848433
|
7
|
+
data.tar.gz: 9db02f2fff960e427bee085a96a71b04df75c95c95788b9d05804d08bdfa0ac6bcc667004c001a56a8b92408a0cb006d125535fba6c2c2a26ad0834f06eefb89
|
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
module MeducationSDK
|
2
|
+
class Contribution < Resource
|
3
|
+
self.path = "/contributions"
|
4
|
+
self.spi_type = "Item::Contribution"
|
5
|
+
|
6
|
+
def item
|
7
|
+
@item ||= sdk_class_for(item_type).find(item_id)
|
8
|
+
end
|
9
|
+
|
10
|
+
end
|
11
|
+
|
12
|
+
class ContributionMock < Contribution
|
13
|
+
extend Loquor::ResourceMock
|
14
|
+
|
15
|
+
self.attributes = {
|
16
|
+
id: 1,
|
17
|
+
item_id: 5,
|
18
|
+
item_type: "MediaFile"
|
19
|
+
}
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require_relative '../test_helper'
|
2
|
+
require_relative '../resource_test'
|
3
|
+
|
4
|
+
module MeducationSDK
|
5
|
+
class ContributionTest < ResourceTest
|
6
|
+
test_resource(Contribution, '/contributions')
|
7
|
+
|
8
|
+
def test_item_calls_sdk
|
9
|
+
contribution = Contribution.new(item_id: 2, item_type: "MediaFile")
|
10
|
+
MeducationSDK::MediaFile.expects(:find).with(2)
|
11
|
+
contribution.item
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meducation_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Walker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -153,6 +153,7 @@ files:
|
|
153
153
|
- lib/meducation_sdk/resources/comment.rb
|
154
154
|
- lib/meducation_sdk/resources/community.rb
|
155
155
|
- lib/meducation_sdk/resources/community_membership.rb
|
156
|
+
- lib/meducation_sdk/resources/contribution.rb
|
156
157
|
- lib/meducation_sdk/resources/dashboard_item.rb
|
157
158
|
- lib/meducation_sdk/resources/ecommerce_subscription.rb
|
158
159
|
- lib/meducation_sdk/resources/external_resource.rb
|
@@ -212,6 +213,7 @@ files:
|
|
212
213
|
- test/resources/comment_test.rb
|
213
214
|
- test/resources/community_membership_test.rb
|
214
215
|
- test/resources/community_test.rb
|
216
|
+
- test/resources/contribution_test.rb
|
215
217
|
- test/resources/dashboard_item_test.rb
|
216
218
|
- test/resources/ecommerce_subscription_test.rb
|
217
219
|
- test/resources/external_resource_test.rb
|
@@ -295,6 +297,7 @@ test_files:
|
|
295
297
|
- test/resources/comment_test.rb
|
296
298
|
- test/resources/community_membership_test.rb
|
297
299
|
- test/resources/community_test.rb
|
300
|
+
- test/resources/contribution_test.rb
|
298
301
|
- test/resources/dashboard_item_test.rb
|
299
302
|
- test/resources/ecommerce_subscription_test.rb
|
300
303
|
- test/resources/external_resource_test.rb
|