Sha256: 515b053146352df6dc6ae44f30f047571311ee7e3e687ce7061f10a0b8ad9b86

Contents?: true

Size: 789 Bytes

Versions: 5

Compression:

Stored size: 789 Bytes

Contents

require 'spec_helper'

module Clearsale
  describe OrderResponse do
    describe "#approved?" do
      let(:response) { {:orders=>{:order=>{:id=>"TS1234", :score=>"21.1100"}}} }

      %w(APA APM).each do |status|
        it "should return true if status return is: #{status}" do
          response[:orders][:order][:status] = status
          OrderResponse.new(response).should be_approved
        end
      end
    end

    describe "#rejected?" do
      let(:response) { {:orders=>{:order=>{:id=>"TS1234", :score=>"21.1100"}}} }

      %w(RPM FRD SUS).each do |status|
        it "should return true if status return is: #{status}" do
          response[:orders][:order][:status] = status
          OrderResponse.new(response).should be_rejected
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
clearsale-0.1.4 spec/order_response_spec.rb
clearsale-0.1.3 spec/order_response_spec.rb
clearsale-0.1.2 spec/order_response_spec.rb
clearsale-0.1.1 spec/order_response_spec.rb
clearsale-0.1.0 spec/order_response_spec.rb