Sha256: 3e622a3009f91c3ff2bed51a66d616bf976430fc6d11dd404559816099003f1f

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe Fpswax::Response do
  describe "request_id" do
    it "should successfully be parsed from a response" do
      xml = fixture_raw_xml('raw/request_id.xml')
      response = Fpswax::Response.new(xml)
      response.request_id.should == 'b415f09d-5924-4315-b31a-21c977c85c39:0'
      response.should be_valid
    end
  end

  describe "errors" do
    it "should return any errors that were present in the XML response" do
      xml = fixture_raw_xml('raw/errors.xml')
      response = Fpswax::Response.new(xml)

      response.errors.should have_at_least(1).thing
    end
  end

  describe "valid" do
    it "should be true if there are no errors" do
      xml = fixture_raw_xml('raw/request_id.xml')
      response = Fpswax::Response.new(xml)
      response.should be_valid
    end

    it "should be false if there are errors" do
      xml = fixture_raw_xml("raw/errors.xml")
      response = Fpswax::Response.new(xml)
      response.should_not be_valid
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dbalatero-fpswax-0.0.1 spec/fpswax/response_spec.rb