Skip to content
Extraits de code Groupes Projets
Valider d02e9b72 rédigé par Jonne Haß's avatar Jonne Haß
Parcourir les fichiers

Merge pull request #4037 from marpo60/avoid_redirect

Avoid redirect
parents bc0a9c8f 88e76448
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -65,7 +65,7 @@ class ApplicationController < ActionController::Base ...@@ -65,7 +65,7 @@ class ApplicationController < ActionController::Base
def set_diaspora_header def set_diaspora_header
headers['X-Diaspora-Version'] = AppConfig.version_string headers['X-Diaspora-Version'] = AppConfig.version_string
if AppConfig.git_available? if AppConfig.git_available?
headers['X-Git-Update'] = AppConfig.git_update if AppConfig.git_update.present? headers['X-Git-Update'] = AppConfig.git_update if AppConfig.git_update.present?
headers['X-Git-Revision'] = AppConfig.git_revision if AppConfig.git_revision.present? headers['X-Git-Revision'] = AppConfig.git_revision if AppConfig.git_revision.present?
...@@ -132,6 +132,6 @@ class ApplicationController < ActionController::Base ...@@ -132,6 +132,6 @@ class ApplicationController < ActionController::Base
end end
def current_user_redirect_path def current_user_redirect_path
current_user.getting_started? ? getting_started_path : root_path current_user.getting_started? ? getting_started_path : stream_path
end end
end end
...@@ -79,7 +79,7 @@ describe RegistrationsController do ...@@ -79,7 +79,7 @@ describe RegistrationsController do
it "redirects to the home path" do it "redirects to the home path" do
get :create, @valid_params get :create, @valid_params
response.should be_redirect response.should be_redirect
response.location.should match /^#{root_url}\??$/ response.location.should match /^#{stream_url}\??$/
end end
end end
......
...@@ -18,17 +18,17 @@ describe SessionsController do ...@@ -18,17 +18,17 @@ describe SessionsController do
end end
describe "#create" do describe "#create" do
it "redirects to root_path for a non-mobile user" do it "redirects to /stream for a non-mobile user" do
post :create, {"user" => {"remember_me" => "0", "username" => @user.username, "password" => "evankorth"}} post :create, {"user" => {"remember_me" => "0", "username" => @user.username, "password" => "evankorth"}}
response.should be_redirect response.should be_redirect
response.location.should match /^#{root_url}\??$/ response.location.should match /^#{stream_url}\??$/
end end
it "redirects to /stream for a mobile user" do it "redirects to /stream for a mobile user" do
@request.env['HTTP_USER_AGENT'] = 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B117 Safari/6531.22.7' @request.env['HTTP_USER_AGENT'] = 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_1 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8B117 Safari/6531.22.7'
post :create, {"user" => {"remember_me" => "0", "username" => @user.username, "password" => "evankorth"}} post :create, {"user" => {"remember_me" => "0", "username" => @user.username, "password" => "evankorth"}}
response.should be_redirect response.should be_redirect
response.location.should match /^#{root_url}\??$/ response.location.should match /^#{stream_url}\??$/
end end
end end
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter