Sha256: 83c26727e6dafef166a482751ce5acc3f0262b350eb1a7e75148a529d1f9461e

Contents?: true

Size: 1.23 KB

Versions: 4

Compression:

Stored size: 1.23 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 :account_type 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
        skip "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

4 entries across 4 versions & 1 rubygems

Version Path
beatport-0.4.0 spec/catalog/account_type_spec.rb
beatport-0.3.0 spec/catalog/account_type_spec.rb
beatport-0.2.3 spec/catalog/account_type_spec.rb
beatport-0.2.2 spec/catalog/account_type_spec.rb