From 4164ceaf904d345bb037647e4afe71024914236b Mon Sep 17 00:00:00 2001 From: maxwell Date: Mon, 8 Nov 2010 16:30:46 -0800 Subject: [PATCH] trying another thing to get the redirect working --- app/controllers/services_controller.rb | 7 ++++++- spec/controllers/services_controller_spec.rb | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index 3086b66c3..b12848d06 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -11,6 +11,7 @@ class ServicesController < ApplicationController end def create + auth = request.env['omniauth.auth'] provider = auth['provider'] @@ -32,7 +33,11 @@ class ServicesController < ApplicationController end flash[:notice] = I18n.t 'services.create.success' - redirect_to :back + if current_user.getting_started + redirect_to getting_started_path(:step => 3) + else + redirect_to services_url + end end def destroy diff --git a/spec/controllers/services_controller_spec.rb b/spec/controllers/services_controller_spec.rb index e11869a4b..4b504620e 100644 --- a/spec/controllers/services_controller_spec.rb +++ b/spec/controllers/services_controller_spec.rb @@ -36,9 +36,16 @@ describe ServicesController do describe '#create' do it 'creates a new OmniauthService' do request.env['omniauth.auth'] = omniauth_auth - request.env["HTTP_REFERER"] = "" lambda{post :create}.should change(user.services, :count).by(1) end + + it 'should redirect to getting started if the user still getting started' do + + end + + it 'should redirect to services url' do + + end end describe '#destroy' do