Sha256: e929eb047644e6ddb16cdf8e4040f5935c5ef6c0c9069a934ae6f34da501d179

Contents?: true

Size: 793 Bytes

Versions: 2

Compression:

Stored size: 793 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 CAN).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

2 entries across 2 versions & 1 rubygems

Version Path
clearsale-0.1.6 spec/order_response_spec.rb
clearsale-0.1.5 spec/order_response_spec.rb