diff --git a/Gemfile b/Gemfile index d17024072..d97c3bf57 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'http://rubygems.org' -gem 'rails', '3.0.1' +gem 'rails', '3.0.3' gem 'bundler', '>= 1.0.0' gem "chef", :require => false diff --git a/Gemfile.lock b/Gemfile.lock index 6abcd0f75..10a37ef62 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -83,35 +83,34 @@ GEM specs: SystemTimer (1.2.1) abstract (1.0.0) - actionmailer (3.0.1) - actionpack (= 3.0.1) - mail (~> 2.2.5) - actionpack (3.0.1) - activemodel (= 3.0.1) - activesupport (= 3.0.1) + actionmailer (3.0.3) + actionpack (= 3.0.3) + mail (~> 2.2.9) + actionpack (3.0.3) + activemodel (= 3.0.3) + activesupport (= 3.0.3) builder (~> 2.1.2) erubis (~> 2.6.6) - i18n (~> 0.4.1) + i18n (~> 0.4) rack (~> 1.2.1) - rack-mount (~> 0.6.12) - rack-test (~> 0.5.4) + rack-mount (~> 0.6.13) + rack-test (~> 0.5.6) tzinfo (~> 0.3.23) - activemodel (3.0.1) - activesupport (= 3.0.1) + activemodel (3.0.3) + activesupport (= 3.0.3) builder (~> 2.1.2) - i18n (~> 0.4.1) - activerecord (3.0.1) - activemodel (= 3.0.1) - activesupport (= 3.0.1) - arel (~> 1.0.0) + i18n (~> 0.4) + activerecord (3.0.3) + activemodel (= 3.0.3) + activesupport (= 3.0.3) + arel (~> 2.0.2) tzinfo (~> 0.3.23) - activeresource (3.0.1) - activemodel (= 3.0.1) - activesupport (= 3.0.1) - activesupport (3.0.1) + activeresource (3.0.3) + activemodel (= 3.0.3) + activesupport (= 3.0.3) + activesupport (3.0.3) addressable (2.2.2) - arel (1.0.1) - activesupport (~> 3.0.0) + arel (2.0.6) aws (2.3.32) activesupport http_connection @@ -195,7 +194,7 @@ GEM hashie (0.4.0) highline (1.6.1) http_connection (1.4.0) - i18n (0.4.2) + i18n (0.5.0) jammit (0.5.4) closure-compiler (>= 0.1.0) yui-compressor (>= 0.9.1) @@ -288,19 +287,19 @@ GEM ruby-openid (>= 2.1.8) rack-test (0.5.6) rack (>= 1.0) - rails (3.0.1) - actionmailer (= 3.0.1) - actionpack (= 3.0.1) - activerecord (= 3.0.1) - activeresource (= 3.0.1) - activesupport (= 3.0.1) - bundler (~> 1.0.0) - railties (= 3.0.1) - railties (3.0.1) - actionpack (= 3.0.1) - activesupport (= 3.0.1) - rake (>= 0.8.4) - thor (~> 0.14.0) + rails (3.0.3) + actionmailer (= 3.0.3) + actionpack (= 3.0.3) + activerecord (= 3.0.3) + activeresource (= 3.0.3) + activesupport (= 3.0.3) + bundler (~> 1.0) + railties (= 3.0.3) + railties (3.0.3) + actionpack (= 3.0.3) + activesupport (= 3.0.3) + rake (>= 0.8.7) + thor (~> 0.14.4) rake (0.8.7) redis (2.1.1) redis-namespace (0.8.0) @@ -408,7 +407,7 @@ DEPENDENCIES nokogiri (= 1.4.3.1) omniauth (= 0.1.6) pubsubhubbub - rails (= 3.0.1) + rails (= 3.0.3) resque rest-client roxml! diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 265a2a5f6..85038f197 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -76,7 +76,7 @@ class PeopleController < ApplicationController def destroy current_user.disconnect(current_user.visible_person_by_id(params[:id])) - respond_with :location => root_url + redirect_to root_url end def edit diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 890cb8bc1..f86a40376 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -65,20 +65,20 @@ class PhotosController < ApplicationController format.json{ render(:layout => false , :json => {"success" => true, "data" => @photo}.to_json )} end else - respond_with :location => photos_path, :error => message + respond_with @photo, :location => photos_path, :error => message end rescue TypeError message = I18n.t 'photos.create.type_error' - respond_with :location => photos_path, :error => message + respond_with @photo, :location => photos_path, :error => message rescue CarrierWave::IntegrityError message = I18n.t 'photos.create.integrity_error' - respond_with :location => photos_path, :error => message + respond_with @photo, :location => photos_path, :error => message rescue RuntimeError => e message = I18n.t 'photos.create.runtime_error' - respond_with :location => photos_path, :error => message + respond_with @photo, :location => photos_path, :error => message raise e end end @@ -118,12 +118,12 @@ class PhotosController < ApplicationController if photo.status_message_id - respond_with :location => photo.status_message + respond_with photo, :location => photo.status_message else - respond_with :location => person_photos_path(current_user.person) + respond_with photo, :location => person_photos_path(current_user.person) end else - respond_with :location => person_photos_path(current_user.person) + respond_with photo, :location => person_photos_path(current_user.person) end end diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb index 843f67c85..46d8bce18 100644 --- a/app/controllers/requests_controller.rb +++ b/app/controllers/requests_controller.rb @@ -15,10 +15,10 @@ class RequestsController < ApplicationController if params[:aspect_id] @contact = current_user.accept_and_respond( params[:id], params[:aspect_id]) flash[:notice] = I18n.t 'requests.destroy.success' - respond_with :location => current_user.aspect_by_id(params[:aspect_id]) + respond_with @contact, :location => current_user.aspect_by_id(params[:aspect_id]) else flash[:error] = I18n.t 'requests.destroy.error' - respond_with :location => requests_url + respond_with @contact, :location => requests_url end else current_user.ignore_contact_request params[:id] diff --git a/app/controllers/sockets_controller.rb b/app/controllers/sockets_controller.rb index 95f327fed..5411d1801 100644 --- a/app/controllers/sockets_controller.rb +++ b/app/controllers/sockets_controller.rb @@ -15,5 +15,4 @@ class SocketsController < ApplicationController @_request = ActionDispatch::Request.new({}) Diaspora::WebSocket.queue_to_user(uid, action_hash(uid, object, opts)) end - end diff --git a/spec/controllers/photos_controller_spec.rb b/spec/controllers/photos_controller_spec.rb index bc118984b..8894cf537 100644 --- a/spec/controllers/photos_controller_spec.rb +++ b/spec/controllers/photos_controller_spec.rb @@ -21,6 +21,7 @@ describe PhotosController do before do connect_users(user1, aspect1, user2, aspect2) + @controller.stub!(:current_user).and_return(user1) sign_in :user, user1 end diff --git a/spec/controllers/requests_controller_spec.rb b/spec/controllers/requests_controller_spec.rb index d909f4b7f..bf52f7685 100644 --- a/spec/controllers/requests_controller_spec.rb +++ b/spec/controllers/requests_controller_spec.rb @@ -8,7 +8,7 @@ describe RequestsController do render_views before do @user = make_user - + @controller.stub!(:current_user).and_return(@user) sign_in :user, @user request.env["HTTP_REFERER"] = "http://test.host"