Sha256: 57d2e3437fd136f71f56ed1a8c7608dfdc9b623d8e130e2e9d22385bd6e14aa7
Contents?: true
Size: 882 Bytes
Versions: 18
Compression:
Stored size: 882 Bytes
Contents
require "spec_helper" describe PagSeguro::Item do let(:item) { PagSeguro::Item.new(id: 'id', description: 'my item', amount: 10) } subject { item } it { should respond_to(:id) } it { should respond_to(:description) } it { should respond_to(:amount) } it { should respond_to(:quantity) } describe 'presence validations' do it { should validate_presence_of(:id) } it { should validate_presence_of(:description) } it { should validate_presence_of(:amount) } it { should validate_presence_of(:quantity) } end describe 'numericality validations' do it { should validate_numericality_of(:amount).is_greater_than(0) } it { should validate_numericality_of(:quantity).is_greater_than(0) } it { should validate_numericality_of(:quantity).only_integer } end describe 'set default country' do its(:quantity) { should eq(1) } end end
Version data entries
18 entries across 18 versions & 1 rubygems