Sha256: 4fa29b06a3ad62ef0c8a029fb143e0098f0b7ec27e90c3fdc15d99fddf8a789b

Contents?: true

Size: 777 Bytes

Versions: 10

Compression:

Stored size: 777 Bytes

Contents

require File.dirname(__FILE__) + '/base'
require 'sinatra'
require 'sinatra/test/bacon'

require File.dirname(__FILE__) + '/../lib/taps/server'

require 'pp'

describe Taps::Server do
	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 '/'
		status.should == 401
	end

	it "verifies the client taps version" do
		get('/', { }, { 'HTTP_AUTHORIZATION' => @auth_header, 'HTTP_TAPS_VERSION' => Taps.version })
		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' })
		status.should == 417
	end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
ricardochimal-taps-0.2.4 spec/server_spec.rb
ricardochimal-taps-0.2.5 spec/server_spec.rb
ricardochimal-taps-0.2.6 spec/server_spec.rb
ricardochimal-taps-0.2.7 spec/server_spec.rb
ricardochimal-taps-0.2.8 spec/server_spec.rb
taps-0.2.8 spec/server_spec.rb
taps-0.2.5 spec/server_spec.rb
taps-0.2.4 spec/server_spec.rb
taps-0.2.7 spec/server_spec.rb
taps-0.2.6 spec/server_spec.rb