koudoku 1.0.0 → 1.1.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/Rakefile +9 -1
- data/lib/generators/koudoku/templates/app/models/plan.rb +1 -1
- data/lib/generators/koudoku/templates/config/initializers/koudoku.rb +2 -0
- data/lib/koudoku/version.rb +1 -1
- data/spec/concerns/koudoku/plan_spec.rb +6 -6
- data/spec/controllers/koudoku/subscriptions_controller.rb +2 -2
- data/spec/helpers/koudoku/application_helper_spec.rb +1 -1
- data/spec/spec_helper.rb +0 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fee2a678d5b0ebb98c98a6e9d4591648e0848d32
|
4
|
+
data.tar.gz: 7c0a3213485440ed488ebf41938004e4d2badadb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3d52da44d27c1fbec53022ef87655f699ff00f9d161b92deb5db5faf365f41031403f8c0292f7d4463018c33859875de373e8ecb29ce3521dc033de1762f63f
|
7
|
+
data.tar.gz: bd5658ce6acce19cd191f86b10b78aa73a12934fd83dac5def583306f3acec808aed90ffa5bc763ecf6789ca5975e4f8c5245ffc57f1dd89c0d73a4c06b4a708
|
data/Rakefile
CHANGED
@@ -1,2 +1,10 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
|
-
require "bundler/gem_tasks"
|
2
|
+
require "bundler/gem_tasks"
|
3
|
+
|
4
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
5
|
+
#load 'rails/tasks/engine.rake'
|
6
|
+
|
7
|
+
require 'rspec/core/rake_task'
|
8
|
+
RSpec::Core::RakeTask.new(spec: 'app:db:test:prepare')
|
9
|
+
|
10
|
+
task default: :spec
|
@@ -2,5 +2,5 @@ class Plan < ActiveRecord::Base
|
|
2
2
|
has_many :subscriptions
|
3
3
|
|
4
4
|
include Koudoku::Plan
|
5
|
-
attr_accessible :display_order, :features, :highlight, :interval, :name, :price, :stripe_id
|
5
|
+
<%= "attr_accessible :display_order, :features, :highlight, :interval, :name, :price, :stripe_id" if Rails::VERSION::MAJOR == 3 %>
|
6
6
|
end
|
@@ -2,6 +2,8 @@ Koudoku.setup do |config|
|
|
2
2
|
config.subscriptions_owned_by = :<%= subscription_owner_model %>
|
3
3
|
config.stripe_publishable_key = ENV['STRIPE_PUBLISHABLE_KEY']
|
4
4
|
config.stripe_secret_key = ENV['STRIPE_SECRET_KEY']
|
5
|
+
|
6
|
+
Stripe.api_version = '2015-01-11' #Making sure the API version used is compatible.
|
5
7
|
# config.prorate = false # Default is true, set to false to disable prorating subscriptions
|
6
8
|
# config.free_trial_length = 30
|
7
9
|
|
data/lib/koudoku/version.rb
CHANGED
@@ -13,27 +13,27 @@ describe Koudoku::Plan do
|
|
13
13
|
plan.price = 123.23
|
14
14
|
cheaper_plan = FakePlan.new
|
15
15
|
cheaper_plan.price = 61.61
|
16
|
-
plan.is_upgrade_from?(cheaper_plan).
|
16
|
+
expect(plan.is_upgrade_from?(cheaper_plan)).to eq(true)
|
17
17
|
end
|
18
18
|
it 'returns true if the price is the same' do
|
19
19
|
plan = FakePlan.new
|
20
20
|
plan.price = 123.23
|
21
|
-
plan.is_upgrade_from?(plan).
|
21
|
+
expect(plan.is_upgrade_from?(plan)).to eq(true)
|
22
22
|
end
|
23
23
|
it 'returns false if the price is the same or higher' do
|
24
24
|
plan = FakePlan.new
|
25
25
|
plan.price = 61.61
|
26
26
|
more_expensive_plan = FakePlan.new
|
27
27
|
more_expensive_plan.price = 123.23
|
28
|
-
plan.is_upgrade_from?(more_expensive_plan).
|
28
|
+
expect(plan.is_upgrade_from?(more_expensive_plan)).to eq(false)
|
29
29
|
end
|
30
30
|
it 'handles a nil value gracefully' do
|
31
31
|
plan = FakePlan.new
|
32
32
|
plan.price = 123.23
|
33
33
|
cheaper_plan = FakePlan.new
|
34
|
-
|
35
|
-
plan.is_upgrade_from?(cheaper_plan).
|
36
|
-
}.
|
34
|
+
expect {
|
35
|
+
expect(plan.is_upgrade_from?(cheaper_plan)).to eq(true)
|
36
|
+
}.not_to raise_error
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
@@ -4,7 +4,7 @@ describe Koudoku::SubscriptionsController do
|
|
4
4
|
describe 'when customer is signed in' do
|
5
5
|
before do
|
6
6
|
@customer = Customer.create(email: 'andrew.culver@gmail.com')
|
7
|
-
ApplicationController.
|
7
|
+
allow_any_instance_of(ApplicationController).to receive(:current_customer).and_return(@customer)
|
8
8
|
end
|
9
9
|
it 'works' do
|
10
10
|
get :index, use_route: 'koudoku'
|
@@ -12,7 +12,7 @@ describe Koudoku::SubscriptionsController do
|
|
12
12
|
end
|
13
13
|
describe 'when customer is not signed in' do
|
14
14
|
before do
|
15
|
-
ApplicationController.
|
15
|
+
allow_any_instance_of(ApplicationController).to receive(:current_customer).and_return(nil)
|
16
16
|
end
|
17
17
|
it 'works' do
|
18
18
|
get :index, use_route: 'koudoku'
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: koudoku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Culver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 3.0.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version:
|
110
|
+
version: 3.0.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: capybara
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|