Sha256: 57e12002faa9d18835de3f2f52d9c64e16461922669eba171fe21ebbc93655b1

Contents?: true

Size: 1.03 KB

Versions: 5

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'
require 'timecop'
require 'time'

describe Tiktalik::Object do
  before do
    Timecop.freeze(Time.parse("Wed, 29 May 2013 10:21:20 GMT" ))
  end

  after do
    Timecop.return
  end

  context ".request" do
    it "should have valid content type header set" do
      $faraday_stubs.get("/api/v1/test", { "content-type" => 'application/x-www-form-urlencoded' }) { [200, {}, '']}
      Tiktalik::Object.send(:request, :get, "/test")
      $faraday_stubs.verify_stubbed_calls
    end

    it "should have valid date header set" do
      $faraday_stubs.get("/api/v1/test", { "date" => "Wed, 29 May 2013 10:21:20 GMT"  }) { [200, {}, '']}
      Tiktalik::Object.send(:request, :get, "/test")
      $faraday_stubs.verify_stubbed_calls
    end

    it "should have valid authorization header set" do
      $faraday_stubs.get("/api/v1/test", { "Authorization" => "TKAuth API_KEY:is1EXmnDaRYNouQSHu5Wu36ZYg8="  }) { [200, {}, '']}
      Tiktalik::Object.send(:request, :get, "/test")
      $faraday_stubs.verify_stubbed_calls
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
tiktalik-1.0.5 spec/object_spec.rb
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/tiktalik-1.0.4/spec/object_spec.rb
tiktalik-1.0.4 spec/object_spec.rb
tiktalik-1.0.3 spec/object_spec.rb
tiktalik-1.0.1 spec/object_spec.rb