trying another thing to get the redirect working

This commit is contained in:
maxwell 2010-11-08 16:30:46 -08:00
parent 52908cec1a
commit 4164ceaf90
2 changed files with 14 additions and 2 deletions

View file

@ -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

View file

@ -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