File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ group :test do
1111 gem "rspec" , '~> 3.0.0'
1212 gem "rspec-its"
1313 gem "rack"
14+ gem "rack-test"
1415end
1516
1617group :webservers do
Original file line number Diff line number Diff line change 22require 'webmachine/adapters/rack'
33require 'spec_helper'
44require 'webmachine/spec/adapter_lint'
5+ require 'rack/test'
56
67describe Webmachine ::Adapters ::Rack do
78 it_should_behave_like :adapter_lint do
3435 end
3536 end
3637end
38+
39+ describe Webmachine ::Adapters ::Rack do
40+ let ( :app ) do
41+ Webmachine ::Application . new . tap do |app |
42+ app . add_route ( [ "test" ] , Test ::Resource )
43+ app . configure do | config |
44+ config . adapter = :Rack
45+ end
46+ end . adapter
47+ end
48+
49+ context "using Rack::Test" do
50+ include Rack ::Test ::Methods
51+
52+ it "provides the full request URI" do
53+ rack_response = get "test" , nil , { "HTTP_ACCEPT" => "test/response.request_uri" }
54+ expect ( rack_response . body ) . to eq "http://example.org/test"
55+ end
56+ end
57+ end
You can’t perform that action at this time.
0 commit comments