Sha256: 5387e998cf76ceee98942ca270f8f3a0e1f007c7f9bc36803b81f06af8d79c8f

Contents?: true

Size: 716 Bytes

Versions: 9

Compression:

Stored size: 716 Bytes

Contents

require 'spec_helper'

describe Invoker::Power::Balancer do
  before do
    @http_connection = mock("connection")
    @balancer = Invoker::Power::Balancer.new(@http_connection, "http")
  end

  context "when Host field is missing in the request" do
    it "should return 400 as response when Host is missing" do
      headers = {}
      @http_connection.expects(:send_data).with() { |value| value =~ /400 Bad Request/i }
      @balancer.headers_received(headers)
    end

    it "should return 400 as response when Host is empty" do
      headers = { 'Host' => '' }
      @http_connection.expects(:send_data).with() { |value| value =~ /400 Bad Request/i }
      @balancer.headers_received(headers)
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
invoker-1.5.7 spec/invoker/power/balancer_spec.rb
invoker-1.5.6 spec/invoker/power/balancer_spec.rb
invoker-1.5.5 spec/invoker/power/balancer_spec.rb
invoker-1.5.4 spec/invoker/power/balancer_spec.rb
invoker-1.5.3 spec/invoker/power/balancer_spec.rb
meepo-1.5.2 spec/invoker/power/balancer_spec.rb
invoker-1.5.1 spec/invoker/power/balancer_spec.rb
invoker-1.4.1 spec/invoker/power/balancer_spec.rb
invoker-1.4.0 spec/invoker/power/balancer_spec.rb