Sha256: 8cd613b44c3dcbb85900fbf3cf0486ae4db9ae4d2a52f83d6c5cf48069115208

Contents?: true

Size: 681 Bytes

Versions: 1

Compression:

Stored size: 681 Bytes

Contents

require 'spec_helper'

describe Gxapi do

  before(:all) do
    Gxapi.config_path = File.expand_path(
      "../../support/config.yml", __FILE__
    )
    Gxapi.env = "test"
  end

  context ".cache" do
    it "should have a cache that gets defined by default" do
      expect(Gxapi.cache).to be_kind_of(ActiveSupport::Cache::Store)
    end

    context "with Rails" do

      it "should use the Rails cache once it is available" do
        expect(Gxapi.cache).to be Rails.cache
      end

      it "should still allow you to override the cache" do
        my_cache = stub()
        Gxapi.cache = my_cache
        expect(Gxapi.cache).to eql(my_cache)
      end

    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gxapi_rails-0.1.0 spec/lib/gxapi_spec.rb