Sha256: 5471435e7d2ab1e2371ca64756f3a0a36e22b908db7fba277a2ac2cc98c75fc0

Contents?: true

Size: 640 Bytes

Versions: 7

Compression:

Stored size: 640 Bytes

Contents

require 'spec_helper'

describe Spree::Bank do
  it { should validate_presence_of :name }
  it { should validate_presence_of :account_no }
  it { should validate_uniqueness_of(:account_no).scoped_to(:name) }

  describe ".active" do
    before(:each) do
      @active_bank1 = Spree::Bank.create! :name => 'bank1', :account_no => '98765'
      @active_bank2 = Spree::Bank.create! :name => 'bank2', :account_no => '98765'
      @bank3 = Spree::Bank.create! :name => 'bank3', :account_no => '98765', :active => false
    end

    it "returns active banks" do
      Spree::Bank.active.should =~([@active_bank1, @active_bank2])
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
spree-bank-transfer-2.3.0 spec/models/spree/bank_spec.rb
spree-bank-transfer-2.2.5 spec/models/spree/bank_spec.rb
spree-bank-transfer-2.2.4 spec/models/spree/bank_spec.rb
spree-bank-transfer-2.2.2 spec/models/spree/bank_spec.rb
spree-bank-transfer-2.2.1 spec/models/spree/bank_spec.rb
spree-bank-transfer-2.2.0 spec/models/spree/bank_spec.rb
spree-bank-transfer-2.1.0 spec/models/spree/bank_spec.rb