stripe_local 0.0.2 → 0.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/README.md +49 -3
- data/app/models/stripe_local/customer.rb +5 -2
- data/app/models/stripe_local/plan.rb +3 -0
- data/app/services/stripe_local/job_queue.rb +7 -0
- data/db/migrate/20131122063517_load_stripe_tables.rb +2 -0
- data/lib/stripe_local/version.rb +1 -1
- data/spec/dummy/db/schema.rb +3 -2
- data/spec/dummy/log/development.log +96 -0
- data/spec/dummy/log/test.log +3899 -0
- data/spec/models/stripe_local/balance_spec.rb +15 -15
- data/spec/models/stripe_local/customer_spec.rb +4 -0
- data/spec/spec_helper.rb +1 -0
- metadata +3 -18
- data/spec/dummy/db/migrate/20131122104223_add_stripe_customer_id_to_clients.rb +0 -5
| @@ -19,21 +19,21 @@ describe StripeLocal::Balance do | |
| 19 19 |  | 
| 20 20 | 
             
            	its( :previous_pending ) { should be 29900 }
         | 
| 21 21 |  | 
| 22 | 
            -
               | 
| 23 | 
            -
             | 
| 24 | 
            -
             | 
| 25 | 
            -
             | 
| 26 | 
            -
             | 
| 27 | 
            -
             | 
| 28 | 
            -
             | 
| 29 | 
            -
             | 
| 30 | 
            -
             | 
| 31 | 
            -
             | 
| 32 | 
            -
             | 
| 33 | 
            -
             | 
| 34 | 
            -
             | 
| 35 | 
            -
             | 
| 36 | 
            -
               | 
| 22 | 
            +
              describe "redundant `StripeLocal::balance.available` webhook is received" do
         | 
| 23 | 
            +
                before do
         | 
| 24 | 
            +
                  @count = StripeLocal::Balance.count
         | 
| 25 | 
            +
                  @updated = StripeLocal::Balance.last.updated_at.to_i
         | 
| 26 | 
            +
                end
         | 
| 27 | 
            +
                before { Timecop.travel 1.day.from_now }
         | 
| 28 | 
            +
                after  { Timecop.return }
         | 
| 29 | 
            +
             | 
| 30 | 
            +
                it "keeps StripeLocal::Balance updated, but doesn't create redundant records" do
         | 
| 31 | 
            +
                  StripeLocal::Balance.event({ pending: 19900, available: 19900 })
         | 
| 32 | 
            +
             | 
| 33 | 
            +
                  StripeLocal::Balance.count.should eq @count
         | 
| 34 | 
            +
                  StripeLocal::Balance.last.updated_at.to_i.should > @updated
         | 
| 35 | 
            +
                end
         | 
| 36 | 
            +
              end
         | 
| 37 37 |  | 
| 38 38 | 
             
            	describe "`balance.available` webhook signifies a changed balance" do
         | 
| 39 39 | 
             
            		before { @count = StripeLocal::Balance.count }
         | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: stripe_local
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0 | 
| 4 | 
            +
              version: 0.1.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Andy Cohen
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2013-11- | 
| 11 | 
            +
            date: 2013-11-29 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rails
         | 
| @@ -94,20 +94,6 @@ dependencies: | |
| 94 94 | 
             
                - - '>='
         | 
| 95 95 | 
             
                  - !ruby/object:Gem::Version
         | 
| 96 96 | 
             
                    version: '0'
         | 
| 97 | 
            -
            - !ruby/object:Gem::Dependency
         | 
| 98 | 
            -
              name: timecop
         | 
| 99 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 100 | 
            -
                requirements:
         | 
| 101 | 
            -
                - - '>='
         | 
| 102 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 103 | 
            -
                    version: '0'
         | 
| 104 | 
            -
              type: :development
         | 
| 105 | 
            -
              prerelease: false
         | 
| 106 | 
            -
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 107 | 
            -
                requirements:
         | 
| 108 | 
            -
                - - '>='
         | 
| 109 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 110 | 
            -
                    version: '0'
         | 
| 111 97 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 112 98 | 
             
              name: coffee-rails
         | 
| 113 99 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -214,6 +200,7 @@ files: | |
| 214 200 | 
             
            - app/models/stripe_local/subscription.rb
         | 
| 215 201 | 
             
            - app/models/stripe_local/transaction.rb
         | 
| 216 202 | 
             
            - app/models/stripe_local/transfer.rb
         | 
| 203 | 
            +
            - app/services/stripe_local/job_queue.rb
         | 
| 217 204 | 
             
            - app/validators/email_pattern_validator.rb
         | 
| 218 205 | 
             
            - app/validators/full_name_pattern_validator.rb
         | 
| 219 206 | 
             
            - app/validators/legal_name_pattern_validator.rb
         | 
| @@ -264,7 +251,6 @@ files: | |
| 264 251 | 
             
            - spec/dummy/config/routes.rb
         | 
| 265 252 | 
             
            - spec/dummy/config.ru
         | 
| 266 253 | 
             
            - spec/dummy/db/migrate/20131102200937_create_clients.rb
         | 
| 267 | 
            -
            - spec/dummy/db/migrate/20131122104223_add_stripe_customer_id_to_clients.rb
         | 
| 268 254 | 
             
            - spec/dummy/db/schema.rb
         | 
| 269 255 | 
             
            - spec/dummy/log/development.log
         | 
| 270 256 | 
             
            - spec/dummy/log/test.log
         | 
| @@ -359,7 +345,6 @@ test_files: | |
| 359 345 | 
             
            - spec/dummy/config/routes.rb
         | 
| 360 346 | 
             
            - spec/dummy/config.ru
         | 
| 361 347 | 
             
            - spec/dummy/db/migrate/20131102200937_create_clients.rb
         | 
| 362 | 
            -
            - spec/dummy/db/migrate/20131122104223_add_stripe_customer_id_to_clients.rb
         | 
| 363 348 | 
             
            - spec/dummy/db/schema.rb
         | 
| 364 349 | 
             
            - spec/dummy/log/development.log
         | 
| 365 350 | 
             
            - spec/dummy/log/test.log
         |