Sha256: dc09ceed69fc67d078d6a3e697a0634b60c13054f2f3832207cbc4d966ca796a
Contents?: true
Size: 1.22 KB
Versions: 1
Compression:
Stored size: 1.22 KB
Contents
# -*- encoding: utf-8 -*- require 'spec_helper' describe KewegoParty::Client::App do before do @client = KewegoParty::Client.new(:token => 'd4c804fd0f42533351aca404313d26eb') end it "should use the default APICache.store as caching_store" do @client.caching_store.should be_kind_of(APICache.store.class) end it "should cache the app_token when access" do VCR.turned_off do stub_request(:get, "http://api.kewego.com/app/getToken/?appKey=#{@client.token}"). to_return(:body => fixture("app_get_token.xml"), :headers => {:content_type => "text/html; charset=utf-8"}) 2.times { @client.app_token } a_request(:get, "http://api.kewego.com/app/getToken/?appKey=#{@client.token}").should have_been_made.once end end it "should execute the request if reset the app_token" do VCR.turned_off do stub_request(:get, "http://api.kewego.com/app/getToken/?appKey=#{@client.token}"). to_return(:body => fixture("app_get_token.xml"), :headers => {:content_type => "text/html; charset=utf-8"}) @client.app_token @client.app_reset_app_token a_request(:get, "http://api.kewego.com/app/getToken/?appKey=#{@client.token}").should have_been_made.twice end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
kewego_party-0.0.1 | spec/kewego_party/client/cache_spec.rb |