payola-payments 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,13 +15,13 @@ module Payola
15
15
  end
16
16
 
17
17
  it "should validate lack of email" do
18
- sale = build(:sale, email: nil)
19
- expect(sale.valid?).to be false
18
+ subscription = build(:subscription, email: nil)
19
+ expect(subscription.valid?).to be false
20
20
  end
21
21
 
22
22
  it "should validate stripe_token" do
23
- sale = build(:sale, stripe_token: nil)
24
- expect(sale.valid?).to be false
23
+ subscription = build(:subscription, stripe_token: nil)
24
+ expect(subscription.valid?).to be false
25
25
  end
26
26
 
27
27
  end
@@ -27,6 +27,12 @@ module Payola
27
27
  plan = Stripe::Plan.retrieve(our_plan.stripe_id)
28
28
  expect(plan.interval_count).to be_nil
29
29
  end
30
+
31
+ it "should skip creating a plan if there is already a plan with that stripe id" do
32
+ expect(Stripe::Plan).to_not receive(:create)
33
+
34
+ Payola::CreatePlan.call(@subscription_plan)
35
+ end
30
36
  end
31
37
 
32
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: payola-payments
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pete Keen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-06 00:00:00.000000000 Z
11
+ date: 2015-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -176,6 +176,7 @@ files:
176
176
  - app/assets/javascripts/payola/application.js
177
177
  - app/assets/javascripts/payola/checkout_button.js
178
178
  - app/assets/javascripts/payola/form.js
179
+ - app/assets/javascripts/payola/subscription_checkout_button.js
179
180
  - app/assets/javascripts/payola/subscription_form_onestep.js
180
181
  - app/assets/javascripts/payola/subscription_form_twostep.js
181
182
  - app/assets/stylesheets/payola/application.css
@@ -225,6 +226,7 @@ files:
225
226
  - app/views/payola/receipt_mailer/refund.html.erb
226
227
  - app/views/payola/subscriptions/_cancel.html.erb
227
228
  - app/views/payola/subscriptions/_change_plan.html.erb
229
+ - app/views/payola/subscriptions/_checkout.html.erb
228
230
  - app/views/payola/transactions/_checkout.html.erb
229
231
  - app/views/payola/transactions/_form.html.erb
230
232
  - app/views/payola/transactions/_stripe_header.html.erb