Sha256: ee029f1624409582bd2daccd545294b48d30b1ca59a6f791701c00f5b5052d33

Contents?: true

Size: 824 Bytes

Versions: 9

Compression:

Stored size: 824 Bytes

Contents

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

require 'taps/server'

require 'pp'

describe Taps::Server do
  def app
    Taps::Server.new
  end

  before do
    Taps::Config.login = 'taps'
    Taps::Config.password = 'tpass'

    @app = Taps::Server
    @auth_header = "Basic " + ["taps:tpass"].pack("m*")
  end

  it "asks for http basic authentication" do
    get '/'
    last_response.status.should == 401
  end

  it "verifies the client taps version" do
    get('/', { }, { 'HTTP_AUTHORIZATION' => @auth_header, 'HTTP_TAPS_VERSION' => Taps.compatible_version + ".14" })
    last_response.status.should == 200
  end

  it "yells loudly if the client taps version doesn't match" do
    get('/', { }, { 'HTTP_AUTHORIZATION' => @auth_header, 'HTTP_TAPS_VERSION' => '0.0.1' })
    last_response.status.should == 417
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
taps-0.3.21 spec/server_spec.rb
taps-0.3.20 spec/server_spec.rb
taps-0.3.20.pre2 spec/server_spec.rb
taps-0.3.20.pre1 spec/server_spec.rb
taps-0.3.19 spec/server_spec.rb
taps-0.3.19.pre1 spec/server_spec.rb
taps-0.3.18 spec/server_spec.rb
taps-0.3.17 spec/server_spec.rb
taps-0.3.15 spec/server_spec.rb