Sha256: 57947e0128406741363929f5b8361fcd54835d96add40420e115f6ba838b87bc

Contents?: true

Size: 563 Bytes

Versions: 22

Compression:

Stored size: 563 Bytes

Contents

require "spec_helper"

describe PagSeguro::Shipping do
  let(:shipping) { PagSeguro::Shipping.new }
  subject { shipping }

  it { should respond_to(:type_id) }
  it { should respond_to(:cost) }
  it { should respond_to(:address) }

  describe 'presence validations' do
    it { should validate_presence_of(:address) }
  end

  describe 'numericality validations' do
    it { should validate_numericality_of(:cost).is_greater_than(0) }
  end

  describe 'inclusion validations' do
    it { should ensure_inclusion_of(:type_id).in_array( %w( 1 2 3 ) ) }
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
pagseguro-transparente-1.1.0 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-1.0.1 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-1.0.0 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-0.2.5 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-0.2.4 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-0.2.3 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-0.2.2 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-0.2.1 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-0.2.0 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-0.1.3 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-0.1.2 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-0.1.1 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-0.1.0 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-0.0.9 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-0.0.8 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-0.0.7 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-0.0.6 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-0.0.5 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-0.0.4 spec/pagseguro/shipping_spec.rb
pagseguro-transparente-0.0.3 spec/pagseguro/shipping_spec.rb