diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 996ead2ff520effbdb362441ab3850f974537f16..bcea6fb769e7995f2b2f17d0f19a074e71eae101 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -18,7 +18,7 @@ class PeopleController < ApplicationController @person = Person.find(params[:id].to_id) @post_type = :all - + @aspect = :none if @person @profile = @person.profile @contact = current_user.contact_for(@person) diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index 3086b66c33fa49d7d2117287c7b435f008d8936c..b12848d06149d86a7dc01ec4b206b3e8be17be04 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/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 3f7911162ad2893d14e4b403def98345961d54c6..e33612dc72c056ffd7edf3b8e012588dd328bfd4 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -24,7 +24,7 @@ class StatusMessagesController < ApplicationController def index @aspect = :profile - @post_type = :status_message + @post_type = :status_messages @person = Person.find(params[:person_id].to_id) diff --git a/app/views/photos/_index.html.haml b/app/views/photos/_index.html.haml index fc53d91f7f093260970df86a4e12b57b71381b9d..7f38bcd2b843ce9016dfcf5c30ae48962ea575fe 100644 --- a/app/views/photos/_index.html.haml +++ b/app/views/photos/_index.html.haml @@ -11,7 +11,7 @@ }); }); -.span-24.last +.span-15.last #thumbnails - for photo in photos .image_thumb diff --git a/app/views/shared/_author_info.html.haml b/app/views/shared/_author_info.html.haml index fa63ede455d3645efac63c556d5bde85567f2c72..10a418741077623258fb1f32fb096b610257192c 100644 --- a/app/views/shared/_author_info.html.haml +++ b/app/views/shared/_author_info.html.haml @@ -16,3 +16,4 @@ = link_to t('.view_profile'), person_path(person) = link_to t('_photos'), person_photos_path(person) = link_to 'status messages', person_status_messages_path(person) + = "viewing: #{@post_type.to_s.titleize}" if defined?(@post_type) diff --git a/spec/controllers/services_controller_spec.rb b/spec/controllers/services_controller_spec.rb index e11869a4bba4a610ffe27fbb5475c4260d64288b..9549a9085c4c5b8a6be591027c4e54208f81a04c 100644 --- a/spec/controllers/services_controller_spec.rb +++ b/spec/controllers/services_controller_spec.rb @@ -22,6 +22,7 @@ describe ServicesController do before do sign_in :user, user + @controller.stub!(:current_user).and_return(user) mock_access_token.stub!(:token).and_return("12345") mock_access_token.stub!(:secret).and_return("56789") end @@ -36,9 +37,22 @@ 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 + user.getting_started = true + request.env['omniauth.auth'] = omniauth_auth + post :create + response.should redirect_to getting_started_path(:step => 3) + end + + it 'should redirect to services url' do + user.getting_started = false + request.env['omniauth.auth'] = omniauth_auth + post :create + response.should redirect_to services_url + end end describe '#destroy' do