Sha256: bc070ddf01219fe3f2e6e1d1446f6595b4c3017d8a4300691c02c27da1210366

Contents?: true

Size: 832 Bytes

Versions: 1

Compression:

Stored size: 832 Bytes

Contents

require 'spec_helper'

describe :response do
  
  after(:all) { ShopifyAPI::Mock.reset }
  
  describe "#new" do
    before { @fixture = ShopifyAPI::Mock::Fixture.find :orders }
    it "should cache the new response" do
      count = ShopifyAPI::Mock::Response.all.count
      ShopifyAPI::Mock::Response.new(:get, "/orders.json", @fixture)
      ShopifyAPI::Mock::Response.all.count.should eq count + 1
    end
  end
  
  describe "#all" do
    subject { ShopifyAPI::Mock::Response.all }
    it { should be_kind_of Array }
  end
  
  describe "#clear" do
    it "should clear the responses" do
      ShopifyAPI::Mock::Response.new(:get, "/orders.json", @fixture)
      ShopifyAPI::Mock::Response.all.count.should > 0
      ShopifyAPI::Mock::Response.clear
      ShopifyAPI::Mock::Response.all.count.should eq 0
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shopify-mock-0.1.1 spec/response_spec.rb