test/rack/test_builder.rb in jellyfish-1.3.1 vs test/rack/test_builder.rb in jellyfish-1.4.0
- old
+ new
@@ -26,14 +26,14 @@
end
would "supports mapping" do
app = builder_to_app do
map '/' do |outer_env|
- run lambda { |inner_env| [200, {"Content-Type" => "text/plain"}, ['root']] }
+ run lambda { |inner_env| [200, {"content-type" => "text/plain"}, ['root']] }
end
map '/sub' do
- run lambda { |inner_env| [200, {"Content-Type" => "text/plain"}, ['sub']] }
+ run lambda { |inner_env| [200, {"content-type" => "text/plain"}, ['sub']] }
end
end
Rack::MockRequest.new(app).get("/").body.to_s.should.eq 'root'
Rack::MockRequest.new(app).get("/sub").body.to_s.should.eq 'sub'
end
@@ -54,11 +54,11 @@
use Rack::ShowExceptions
use Rack::Auth::Basic do |username, password|
'secret' == password
end
- run lambda { |env| [200, {"Content-Type" => "text/plain"}, ['Hi Boss']] }
+ run lambda { |env| [200, {"content-type" => "text/plain"}, ['Hi Boss']] }
end
response = Rack::MockRequest.new(app).get("/")
response.should.client_error?
response.status.should.eq 401
@@ -82,13 +82,13 @@
end
would "can mix map and run for endpoints" do
app = builder_to_app do
map '/sub' do
- run lambda { |inner_env| [200, {"Content-Type" => "text/plain"}, ['sub']] }
+ run lambda { |inner_env| [200, {"content-type" => "text/plain"}, ['sub']] }
end
- run lambda { |inner_env| [200, {"Content-Type" => "text/plain"}, ['root']] }
+ run lambda { |inner_env| [200, {"content-type" => "text/plain"}, ['root']] }
end
Rack::MockRequest.new(app).get("/").body.to_s.should.eq 'root'
Rack::MockRequest.new(app).get("/sub").body.to_s.should.eq 'sub'
end
@@ -121,10 +121,10 @@
@called = 0
end
def call(env)
raise "bzzzt" if @called > 0
@called += 1
- [200, {'Content-Type' => 'text/plain'}, ['OK']]
+ [200, {'content-type' => 'text/plain'}, ['OK']]
end
end
use Rack::ShowExceptions
run AppClass.new