trying another thing to get the redirect working
This commit is contained in:
parent
52908cec1a
commit
4164ceaf90
2 changed files with 14 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue