You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by as...@apache.org on 2008/05/10 02:43:13 UTC

svn commit: r654994 - in /ode/sandbox/singleshot: config/boot.rb script/dbconsole spec/controllers/authentication_spec.rb vendor/plugins/rspec_on_rails/lib/spec/rails/example/controller_example_group.rb

Author: assaf
Date: Fri May  9 17:43:12 2008
New Revision: 654994

URL: http://svn.apache.org/viewvc?rev=654994&view=rev
Log:
Upgraded to new version of Rails edge, fixed stuff broken in RSpec.

Added:
    ode/sandbox/singleshot/script/dbconsole   (with props)
Modified:
    ode/sandbox/singleshot/config/boot.rb
    ode/sandbox/singleshot/spec/controllers/authentication_spec.rb
    ode/sandbox/singleshot/vendor/plugins/rspec_on_rails/lib/spec/rails/example/controller_example_group.rb

Modified: ode/sandbox/singleshot/config/boot.rb
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/config/boot.rb?rev=654994&r1=654993&r2=654994&view=diff
==============================================================================
--- ode/sandbox/singleshot/config/boot.rb (original)
+++ ode/sandbox/singleshot/config/boot.rb Fri May  9 17:43:12 2008
@@ -24,9 +24,8 @@
       File.exist?("#{RAILS_ROOT}/vendor/rails")
     end
 
-    # FIXME : Ruby 1.9
     def preinitialize
-      load(preinitializer_path) if File.exists?(preinitializer_path)
+      load(preinitializer_path) if File.exist?(preinitializer_path)
     end
 
     def preinitializer_path
@@ -44,6 +43,7 @@
   class VendorBoot < Boot
     def load_initializer
       require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
+      Rails::Initializer.run(:install_gem_spec_stubs)
     end
   end
 

Added: ode/sandbox/singleshot/script/dbconsole
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/script/dbconsole?rev=654994&view=auto
==============================================================================
--- ode/sandbox/singleshot/script/dbconsole (added)
+++ ode/sandbox/singleshot/script/dbconsole Fri May  9 17:43:12 2008
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.dirname(__FILE__) + '/../config/boot'
+require 'commands/dbconsole'

Propchange: ode/sandbox/singleshot/script/dbconsole
------------------------------------------------------------------------------
    svn:executable = *

Modified: ode/sandbox/singleshot/spec/controllers/authentication_spec.rb
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/spec/controllers/authentication_spec.rb?rev=654994&r1=654993&r2=654994&view=diff
==============================================================================
--- ode/sandbox/singleshot/spec/controllers/authentication_spec.rb (original)
+++ ode/sandbox/singleshot/spec/controllers/authentication_spec.rb Fri May  9 17:43:12 2008
@@ -105,26 +105,26 @@
   it_should_behave_like 'AuthenticationTest'
 
   it 'should return 401 if not authenticated' do
-    request.headers['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials('lucy', 'wrong')
+    request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials('lucy', 'wrong')
     get 'index'
     response.should be(:unauthorized)
   end
 
   it 'should return response if authenticated' do
-    request.headers['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials('lucy', 'secret')
+    request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials('lucy', 'secret')
     get 'index'
     response.should be(:ok)
   end
 
   it 'should assign authenticated user in controller' do
-    request.headers['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials('lucy', 'secret')
+    request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials('lucy', 'secret')
     get 'index'
     assigns[:authenticated].should == @person
   end
 
   it 'should not fail on password-less account' do
     Person.create(:email=>'mary@test.host')
-    request.headers['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials('mary', 'wrong')
+    request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials('mary', 'wrong')
     get 'index'
     response.should be(:unauthorized)
   end

Modified: ode/sandbox/singleshot/vendor/plugins/rspec_on_rails/lib/spec/rails/example/controller_example_group.rb
URL: http://svn.apache.org/viewvc/ode/sandbox/singleshot/vendor/plugins/rspec_on_rails/lib/spec/rails/example/controller_example_group.rb?rev=654994&r1=654993&r2=654994&view=diff
==============================================================================
--- ode/sandbox/singleshot/vendor/plugins/rspec_on_rails/lib/spec/rails/example/controller_example_group.rb (original)
+++ ode/sandbox/singleshot/vendor/plugins/rspec_on_rails/lib/spec/rails/example/controller_example_group.rb Fri May  9 17:43:12 2008
@@ -186,7 +186,7 @@
               @performed_render = true
             else
               unless matching_stub_exists(options)
-                super(options, deprecated_status, &block)
+                super(options, deprecated_status || {}, &block)
               end
             end
           end