spreedly 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.txt +2 -2
- data/lib/spreedly/mock.rb +4 -0
- data/lib/spreedly/version.rb +1 -1
- data/lib/spreedly.rb +9 -0
- data/test/spreedly_gem_test.rb +10 -0
- data/test/test_site.yml +1 -1
- metadata +3 -3
data/README.txt
CHANGED
data/lib/spreedly/mock.rb
CHANGED
data/lib/spreedly/version.rb
CHANGED
data/lib/spreedly.rb
CHANGED
@@ -67,6 +67,10 @@ module Spreedly
|
|
67
67
|
@data = data
|
68
68
|
end
|
69
69
|
|
70
|
+
def id
|
71
|
+
@data["id"]
|
72
|
+
end
|
73
|
+
|
70
74
|
def method_missing(method, *args, &block)
|
71
75
|
if method.to_s =~ /\?$/
|
72
76
|
send(method.to_s[0..-2])
|
@@ -150,5 +154,10 @@ module Spreedly
|
|
150
154
|
def self.all
|
151
155
|
Spreedly.get('/subscription_plans.xml')['subscription_plans'].collect{|data| new(data)}
|
152
156
|
end
|
157
|
+
|
158
|
+
# Returns the subscription plan with the given id.
|
159
|
+
def self.find(id)
|
160
|
+
all.detect{|e| e.id.to_s == id.to_s}
|
161
|
+
end
|
153
162
|
end
|
154
163
|
end
|
data/test/spreedly_gem_test.rb
CHANGED
@@ -134,6 +134,16 @@ class SpreedlyGemTest < Test::Unit::TestCase
|
|
134
134
|
assert_not_nil Spreedly::SubscriptionPlan.all.first.name
|
135
135
|
end
|
136
136
|
|
137
|
+
should "return the subscription plan id" do
|
138
|
+
plan = Spreedly::SubscriptionPlan.all.first
|
139
|
+
assert_not_equal plan.id, plan.object_id
|
140
|
+
end
|
141
|
+
|
142
|
+
should "be able to find an individual subscription plan" do
|
143
|
+
plan = Spreedly::SubscriptionPlan.all.first
|
144
|
+
assert_equal plan.name, Spreedly::SubscriptionPlan.find(plan.id).name
|
145
|
+
end
|
146
|
+
|
137
147
|
only_real do
|
138
148
|
should "throw an error if comp is wrong type" do
|
139
149
|
sub = create_subscriber
|
data/test/test_site.yml
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
name: terralien-test
|
2
|
-
token:
|
2
|
+
token: 781651cf01c65b7f0c8f6565723ea60436e87a56
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spreedly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathaniel Talbott
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-03-
|
12
|
+
date: 2009-03-19 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -111,7 +111,7 @@ files:
|
|
111
111
|
- vendor/httparty/website/css/common.css
|
112
112
|
- vendor/httparty/website/index.html
|
113
113
|
has_rdoc: true
|
114
|
-
homepage: http://terralien.com/static/projects/spreedly-gem/
|
114
|
+
homepage: Docs[http://terralien.com/static/projects/spreedly-gem/]
|
115
115
|
post_install_message:
|
116
116
|
rdoc_options:
|
117
117
|
- --main
|