Sha256: f2ac7407cd503d30250f2358dfaed3a1317530b2df4ecb9fb0e491a830fc71f4

Contents?: true

Size: 909 Bytes

Versions: 34

Compression:

Stored size: 909 Bytes

Contents

require 'spec_helper'

describe Lumberjack::Rack::UnitOfWork do
 
  it "should create a unit of work in a middleware stack" do
    app = lambda{|env| [200, {"Content-Type" => env["Content-Type"], "Unit-Of-Work" => Lumberjack.unit_of_work_id.to_s}, ["OK"]]}
    handler = Lumberjack::Rack::UnitOfWork.new(app)
    
    response = handler.call("Content-Type" => "text/plain")
    response[0].should == 200
    response[1]["Content-Type"].should == "text/plain"
    unit_of_work_1 = response[1]["Unit-Of-Work"]
    response[2].should == ["OK"]
    
    response = handler.call("Content-Type" => "text/html")
    response[0].should == 200
    response[1]["Content-Type"].should == "text/html"
    unit_of_work_2 = response[1]["Unit-Of-Work"]
    response[2].should == ["OK"]
    
    unit_of_work_1.should_not == nil
    unit_of_work_2.should_not == nil
    unit_of_work_1.should_not == unit_of_work_2
  end

end

Version data entries

34 entries across 32 versions & 10 rubygems

Version Path
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/lumberjack-1.0.13/spec/rack/unit_of_work_spec.rb
alimentos-alu0100945645-0.1.0 vendor/bundle/ruby/2.3.0/gems/lumberjack-1.0.13/spec/rack/unit_of_work_spec.rb
alimentos-alu0100945645-1.0.0 vendor/bundle/ruby/2.3.0/gems/lumberjack-1.0.13/spec/rack/unit_of_work_spec.rb
lumberjack-1.0.13 spec/rack/unit_of_work_spec.rb
comiditaULL-0.1.1 vendor/bundle/ruby/2.3.0/gems/lumberjack-1.0.12/spec/rack/unit_of_work_spec.rb
comidita_ull-0.1.1 vendor/bundle/ruby/2.3.0/gems/lumberjack-1.0.12/spec/rack/unit_of_work_spec.rb
comidita_ull-0.1.0 vendor/bundle/ruby/2.3.0/gems/lumberjack-1.0.12/spec/rack/unit_of_work_spec.rb
lumberjack-1.0.12 spec/rack/unit_of_work_spec.rb
lumberjack-1.0.11 spec/rack/unit_of_work_spec.rb
gameboard-3.1.0 vendor/bundle/ruby/2.3.0/gems/lumberjack-1.0.10/spec/rack/unit_of_work_spec.rb
gameboard-3.0.0 vendor/bundle/ruby/2.3.0/gems/lumberjack-1.0.10/spec/rack/unit_of_work_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/lumberjack-1.0.9/spec/rack/unit_of_work_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/lumberjack-1.0.9/spec/rack/unit_of_work_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/lumberjack-1.0.9/spec/rack/unit_of_work_spec.rb
lumberjack-1.0.10 spec/rack/unit_of_work_spec.rb
mastermind_adeybee-0.1.4 vendor/bundle/ruby/2.2.0/gems/lumberjack-1.0.9/spec/rack/unit_of_work_spec.rb
mastermind_adeybee-0.1.3 vendor/bundle/ruby/2.2.0/gems/lumberjack-1.0.9/spec/rack/unit_of_work_spec.rb
mastermind_adeybee-0.1.2 vendor/bundle/ruby/2.2.0/gems/lumberjack-1.0.9/spec/rack/unit_of_work_spec.rb
mastermind_adeybee-0.1.1 vendor/bundle/ruby/2.2.0/gems/lumberjack-1.0.9/spec/rack/unit_of_work_spec.rb
geminfo-0.1.0 path/gems/lumberjack-1.0.9/spec/rack/unit_of_work_spec.rb