mirror of
https://github.com/diaspora/diaspora.git
synced 2026-01-10 07:38:10 -05:00
fix redirects around getting_started and aspect/index
This commit is contained in:
@@ -122,6 +122,6 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
|
||||
def after_sign_in_path_for(resource)
|
||||
stored_location_for(:user) || aspects_path
|
||||
stored_location_for(:user) || (current_user.getting_started? ? getting_started_path : aspects_path)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -22,12 +22,6 @@ class AspectsController < ApplicationController
|
||||
|
||||
aspect_ids = @aspects.map{|a| a.id}
|
||||
|
||||
# redirect to signup
|
||||
if current_user.getting_started == true && !request.format.mobile? && !request.format.js?
|
||||
redirect_to getting_started_path
|
||||
return
|
||||
end
|
||||
|
||||
# redirect to aspects creation
|
||||
if @aspects.blank?
|
||||
redirect_to new_aspect_path
|
||||
|
||||
@@ -37,7 +37,7 @@ class ProfilesController < ApplicationController
|
||||
if current_user.update_profile params[:profile]
|
||||
flash[:notice] = I18n.t 'profiles.update.updated'
|
||||
if current_user.getting_started?
|
||||
redirect_to getting_started_path(:step => params[:getting_started].to_i+1)
|
||||
redirect_to getting_started_path
|
||||
else
|
||||
redirect_to edit_profile_path
|
||||
end
|
||||
|
||||
@@ -17,7 +17,7 @@ module GettingStartedHelper
|
||||
|
||||
# @return [Boolean] The user has connected at least one service
|
||||
def has_connected_services?
|
||||
AppConfig[:connected_services].blank? || current_user.services.size > 0
|
||||
AppConfig[:configured_services].blank? || current_user.services.size > 0
|
||||
end
|
||||
|
||||
# @return [Boolean] The user has at least 3 contacts
|
||||
|
||||
@@ -135,11 +135,11 @@
|
||||
%p
|
||||
= link_to "#diaspora", tag_path('diaspora')
|
||||
%br
|
||||
= link_to "#kittens", tag_path('kittens')
|
||||
= link_to "#art", tag_path('art')
|
||||
%br
|
||||
= link_to "#puppies", tag_path('puppies')
|
||||
= link_to "#gif", tag_path('gif')
|
||||
%br
|
||||
= link_to "#maddog", tag_path('maddog')
|
||||
= link_to "#french", tag_path('french')
|
||||
.clearfix
|
||||
%br
|
||||
%br
|
||||
@@ -161,7 +161,7 @@
|
||||
|
||||
%li{:style => 'text-align:center;'}
|
||||
%p
|
||||
= link_to t('.skip'), getting_started_completed_path
|
||||
= link_to t('.finished'), getting_started_completed_path, :class => "button"
|
||||
|
||||
/.span-5.rightBar.last
|
||||
/ = render 'selected_contacts', :people => @selected_people.sample(20), :count => @contact_count
|
||||
|
||||
@@ -780,7 +780,7 @@ en:
|
||||
welcome: "Welcome!"
|
||||
welcome_with_name: "Welcome, %{name}!"
|
||||
|
||||
skip: "Skip getting started"
|
||||
finished: "Finished"
|
||||
|
||||
fill_out_your_profile: "Fill out your profile"
|
||||
profile_description: "Make it easier for people to find you by filling out your profile information."
|
||||
|
||||
@@ -21,7 +21,7 @@ Feature: invitation acceptance
|
||||
| profile_gender | diasporian |
|
||||
And I press "Update Profile"
|
||||
And I should see "Welcome"
|
||||
When I follow "Skip getting started"
|
||||
When I follow "Finished"
|
||||
Then I should be on the aspects page
|
||||
|
||||
Scenario: accept invitation from user
|
||||
@@ -45,6 +45,6 @@ Feature: invitation acceptance
|
||||
| profile_gender | diasporian |
|
||||
And I press "Update Profile"
|
||||
And I should see "Welcome"
|
||||
When I follow "Skip getting started"
|
||||
When I follow "Finished"
|
||||
Then I should be on the aspects page
|
||||
|
||||
|
||||
@@ -25,16 +25,11 @@ Feature: new user registration
|
||||
And I wait for the ajax to finish
|
||||
Then I should see "Profile updated"
|
||||
And I should see "Welcome"
|
||||
And I follow "Skip getting started"
|
||||
And I follow "Finished"
|
||||
|
||||
Then I should be on the aspects page
|
||||
And I should not see "Skip getting started"
|
||||
And I should not see "Finished"
|
||||
|
||||
Scenario: new user skips the setup wizard and returns to the setup wizard
|
||||
When I follow "Skip getting started"
|
||||
And I go to the getting started page
|
||||
Then I should not see "skip getting started"
|
||||
|
||||
Scenario: new user skips the setup wizard
|
||||
When I follow "Skip getting started"
|
||||
When I follow "Finished"
|
||||
Then I should be on the aspects page
|
||||
|
||||
@@ -77,14 +77,12 @@ describe AspectsController do
|
||||
alice.getting_started = true
|
||||
alice.save
|
||||
end
|
||||
it 'redirects to getting_started' do
|
||||
get :index
|
||||
response.should redirect_to getting_started_path
|
||||
end
|
||||
|
||||
it 'does not redirect mobile users to getting_started' do
|
||||
get :index, :format => :mobile
|
||||
response.should_not be_redirect
|
||||
end
|
||||
|
||||
it 'does not redirect ajax to getting_started' do
|
||||
get :index, :format => :js
|
||||
response.should_not be_redirect
|
||||
|
||||
@@ -30,7 +30,7 @@ describe GettingStartedHelper do
|
||||
|
||||
describe "#has_connected_services?" do
|
||||
before do
|
||||
AppConfig[:connected_services] = ['fake_service']
|
||||
AppConfig[:configured_services] = ['fake_service']
|
||||
end
|
||||
|
||||
it 'returns true if the current user has connected at least one service' do
|
||||
@@ -38,8 +38,8 @@ describe GettingStartedHelper do
|
||||
has_connected_services?.should be_true
|
||||
end
|
||||
|
||||
it 'returns true if the current user has zero connected services and the server has no services to connect' do
|
||||
AppConfig[:connected_services] = []
|
||||
it 'returns true if the current user has zero connected services and the server has no services configured' do
|
||||
AppConfig[:configured_services] = []
|
||||
@current_user.services.delete_all
|
||||
has_connected_services?.should be_true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user