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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af40753143d0ae4408359497d0bacc28b7975dff
4
- data.tar.gz: f001cb6c98006da1c42ec89f0b5fe85f9fee70a5
3
+ metadata.gz: fee2a678d5b0ebb98c98a6e9d4591648e0848d32
4
+ data.tar.gz: 7c0a3213485440ed488ebf41938004e4d2badadb
5
5
  SHA512:
6
- metadata.gz: 0643bf16d6395998c02a1d7e19410fa11b87cdec49a9107f80d89b568e2195d78d01ed72fedc344fdd017104ff8e6b031800f978e55a48b1f75335351e550951
7
- data.tar.gz: 7cef2125edb8e27ce4a45232222079fd0574000726295b33ea44eb14c30c7cf1ca5bf5b7cf50c4984d120856fddbbb5816ef03199b767f119966aec29f97085b
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
 
@@ -1,3 +1,3 @@
1
1
  module Koudoku
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -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).should be_true
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).should be_true
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).should be_false
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
- lambda {
35
- plan.is_upgrade_from?(cheaper_plan).should be_true
36
- }.should_not raise_error
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.any_instance.stub(:current_customer).and_return(@customer)
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.any_instance.stub(:current_customer).and_return(nil)
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'
@@ -1,5 +1,5 @@
1
1
  require 'spec_helper'
2
- describe Koudoku::ApplicationHelper do
2
+ describe Koudoku::ApplicationHelper, type: :helper do
3
3
  describe "#plan_price" do
4
4
  it "includes the price and defaults to monthly" do
5
5
  plan = Plan.new(price: 12.34)
@@ -1,7 +1,6 @@
1
1
  ENV['RAILS_ENV'] ||= 'test'
2
2
  require File.expand_path("../dummy/config/environment.rb", __FILE__)
3
3
  require 'rspec/rails'
4
- require 'rspec/autorun'
5
4
  require 'factory_girl_rails'
6
5
  require 'pry'
7
6
  Rails.backtrace_cleaner.remove_silencers!
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.0.0
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-03-26 00:00:00.000000000 Z
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: '0'
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: '0'
110
+ version: 3.0.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: capybara
113
113
  requirement: !ruby/object:Gem::Requirement