Sha256: 4b7244ca07b85b0aa15e897e19f732681089c33a081af6ff81f779a7f2e1c8a4

Contents?: true

Size: 1.24 KB

Versions: 5

Compression:

Stored size: 1.24 KB

Contents

require 'spec_helper'

module Beatport::Catalog
  describe AccountType do
    before :each do
      VCR.insert_cassette 'account_type'
    end

    after :each do
      VCR.eject_cassette
    end

    describe 'structure' do
      subject do
        AccountType.all.first
      end
      
      it { should be_an(AccountType) }
      its (:code) { should == "AMEX" }
      its (:bpid) { should == 1 }
      its (:name) { should == "American Express"}
      its (:cybersource_card_type) { should == "003" }
      its (:issue_number_or_start_date_required) { should == false }
      its (:validation_regex) { should == /^3[47][0-9]{13}$/ }
      its (:'images.small.url') { should == "https://secure-beatport.bpddn.com/images/creditcard/logo_cc_amex_37x23.gif"}
    end
    
    describe '.all' do
      subject do
        AccountType.all
      end
      
      its (:length) { should be > 1 }
    end

    describe '.find' do
      context "by id" do
        pending "Isn't currently supported by beatport"
#        subject { AccountType.find(2) }
#        its (:name) { should == "Visa" }
      end
      
      context "by name" do
        subject do
          AccountType.find('Visa')
        end

        its (:name) { should == "Visa" }
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
beatport-0.1.10 spec/catalog/account_type_spec.rb
beatport-0.1.9 spec/catalog/account_type_spec.rb
beatport-0.1.8 spec/catalog/account_type_spec.rb
beatport-0.1.7 spec/catalog/account_type_spec.rb
beatport-0.1.6 spec/catalog/account_type_spec.rb