Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/merb-core/lib/merb-core/test/helpers/request_helper.rb b/merb-core/lib/merb-core/test/helpers/request_helper.rb
- index 7ab15f5..8d00ce3 100644
- --- a/merb-core/lib/merb-core/test/helpers/request_helper.rb
- +++ b/merb-core/lib/merb-core/test/helpers/request_helper.rb
- @@ -37,7 +37,7 @@ module Merb
- env["HTTP_COOKIE"] = @__cookie_jar__.for(jar, uri)
- end
- - app = Merb::Rack::Application.new
- + app = Merb::Config[:app]
- rack = app.call(::Rack::MockRequest.env_for(uri.to_s, env))
- rack = Struct.new(:status, :headers, :body, :url, :original_env).
- diff --git a/merb-core/spec/public/webrat/test_app/config/rack.rb b/merb-core/spec/public/webrat/test_app/config/rack.rb
- index 494c687..c7e69fc 100644
- --- a/merb-core/spec/public/webrat/test_app/config/rack.rb
- +++ b/merb-core/spec/public/webrat/test_app/config/rack.rb
- @@ -1,3 +1,20 @@
- +# Add an addition Rack middleware for testing whether the Webrat steps go through this.
- +module Merb
- + module Rack
- +
- + class DummyWare < Merb::Rack::Middleware
- +
- + def call(env)
- + if env["PATH_INFO"] =~ /^\/dummy/
- + [200, "", "This is a dummy content"]
- + else
- + @app.call(env)
- + end
- + end
- + end
- + end
- +end
- +
- # use PathPrefix Middleware if :path_prefix is set in Merb::Config
- if prefix = ::Merb::Config[:path_prefix]
- use Merb::Rack::PathPrefix, prefix
- @@ -6,6 +23,7 @@ end
- # comment this out if you are running merb behind a load balancer
- # that serves static files
- use Merb::Rack::Static, Merb.dir_for(:public)
- +use Merb::Rack::DummyWare
- # this is our main merb application
- run Merb::Rack::Application.new
- \ No newline at end of file
- diff --git a/merb-core/spec/public/webrat/webrat_spec.rb b/merb-core/spec/public/webrat/webrat_spec.rb
- index 35e0620..52e4bae 100644
- --- a/merb-core/spec/public/webrat/webrat_spec.rb
- +++ b/merb-core/spec/public/webrat/webrat_spec.rb
- @@ -71,5 +71,12 @@ describe "an app tested using the webrat proxies" do
- resp.should have_xpath("//p[contains(., 'truez: 1')]")
- end
- end
- -
- +
- + describe "runs through defined Rack middle ware" do
- + it "returns the response in the rack middleware" do
- + resp = visit "/dummy"
- + resp.body.should == "This is a dummy content"
- + end
- + end
- +
- end
- \ No newline at end of file
Add Comment
Please, Sign In to add comment