Sha256: c536ca1f9473a6a4662d8ccd7f96c6cd4f69c49b92983e2b5b44a1747966bbda

Contents?: true

Size: 440 Bytes

Versions: 1

Compression:

Stored size: 440 Bytes

Contents

require 'spec_helper'

module Opay
  describe Payable do
    subject { Order.new }

    it { should have_one(:payment) }
    it { should respond_to(:finished?) }

    it 'has unique session_id' do
      # unsaved record raises exception
      expect { subject.payment_session_id }.to raise_error RuntimeError

      subject.save!
      subject.payment_session_id.should eq Digest::MD5.hexdigest('Order' + subject.id.to_s)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
opay-1.0.0.beta spec/lib/opay/payable_spec.rb