require File.dirname(__FILE__) + '/../../../spec_helper' require 'rack/test' require 'useless/doc/rack/ui' describe Useless::Doc::Rack::UI do include Rack::Test::Methods def app @app ||= begin base_app = lambda do |env| [200, {'Content-Type' => 'text/plain'}, [env['useless.doc.ui'].name]] end Useless::Doc::Rack::UI.new(base_app) end end it 'should always return `UI::Godel`' do get 'http://some-api.doc.granmal.com/some/resource' last_response.body.should == 'Useless::Doc::UI::Godel' end end