Better testing
authorBlake Mizerany <blake@blake.local>
Tue, 15 Jan 2008 23:00:40 +0000 (15 15:00 -0800)
committerBlake Mizerany <blake@blake.local>
Tue, 15 Jan 2008 23:00:40 +0000 (15 15:00 -0800)
test/application_test.rb

index a2ab27a..02ccd90 100644 (file)
@@ -136,24 +136,17 @@ context "Events in an app" do
       request.env['HTTP_USER_AGENT']
     end
     
-    Rack::MockRequest::DEFAULT_ENV.merge!('HTTP_USER_AGENT' => 'Windows')
-    
     request = Rack::MockRequest.new(@app)
-    result = request.get('/')
+    result = request.get('/', :agent => 'Windows')
     result.should.be.ok
     result.body.should.equal 'Windows'
 
-    Rack::MockRequest::DEFAULT_ENV.merge!('HTTP_USER_AGENT' => 'Mac')
-
     request = Rack::MockRequest.new(@app)
-    result = request.get('/')
+    result = request.get('/', :agent => 'Mac')
     result.should.not.be.ok
 
-    Rack::MockRequest::DEFAULT_ENV.delete('HTTP_USER_AGENT')
-        
   end
   
-    
 end