Sha256: 5506afe0f521de1e181222a0aacbbcbdef251f48fe16928cd622efc2f542dfad

Contents?: true

Size: 658 Bytes

Versions: 86

Compression:

Stored size: 658 Bytes

Contents

class PrankSubscriber < ActionSubscriber::Base
  publisher :pikitis

  def pulled
    $messages << env.headers
  end
end

describe "Custom Headers Are Published and Received", :integration => true do
  let(:draw_routes) do
    ::ActionSubscriber.draw_routes do
      default_routes_for PrankSubscriber
    end
  end
  let(:headers) { { "Custom" => "content/header" } }
  
  it "passes custom headers through" do
    ::ActionSubscriber.start_subscribers!
    ::ActivePublisher.publish("pikitis.prank.pulled", "Yo Knope!", "events", :headers => headers)
    verify_expectation_within(2.0) do
      expect($messages).to eq(Set.new([headers]))
    end
  end
end

Version data entries

86 entries across 86 versions & 1 rubygems

Version Path
action_subscriber-5.3.3-java spec/integration/custom_headers_spec.rb
action_subscriber-5.3.3 spec/integration/custom_headers_spec.rb
action_subscriber-5.3.2-java spec/integration/custom_headers_spec.rb
action_subscriber-5.3.2 spec/integration/custom_headers_spec.rb
action_subscriber-5.3.1-java spec/integration/custom_headers_spec.rb
action_subscriber-5.3.1 spec/integration/custom_headers_spec.rb
action_subscriber-5.3.1.pre-java spec/integration/custom_headers_spec.rb
action_subscriber-5.3.1.pre spec/integration/custom_headers_spec.rb
action_subscriber-5.3.0-java spec/integration/custom_headers_spec.rb
action_subscriber-5.3.0 spec/integration/custom_headers_spec.rb
action_subscriber-5.2.4-java spec/integration/custom_headers_spec.rb
action_subscriber-5.2.4 spec/integration/custom_headers_spec.rb
action_subscriber-5.2.3-java spec/integration/custom_headers_spec.rb
action_subscriber-5.2.3 spec/integration/custom_headers_spec.rb
action_subscriber-5.2.2-java spec/integration/custom_headers_spec.rb
action_subscriber-5.2.2 spec/integration/custom_headers_spec.rb
action_subscriber-5.2.1-java spec/integration/custom_headers_spec.rb
action_subscriber-5.2.1 spec/integration/custom_headers_spec.rb
action_subscriber-5.2.0-java spec/integration/custom_headers_spec.rb
action_subscriber-5.2.0 spec/integration/custom_headers_spec.rb