From e2ad0cbb811827bc942dbca8f15e8e2bf8d9c6df Mon Sep 17 00:00:00 2001 From: Marcelo Dominguez Date: Sun, 3 Mar 2013 23:10:31 -0200 Subject: [PATCH 1/2] Remove whitespaces --- app/controllers/application_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a772803bb..27ede5e5b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -65,7 +65,7 @@ class ApplicationController < ActionController::Base def set_diaspora_header headers['X-Diaspora-Version'] = AppConfig.version_string - + if AppConfig.git_available? headers['X-Git-Update'] = AppConfig.git_update if AppConfig.git_update.present? headers['X-Git-Revision'] = AppConfig.git_revision if AppConfig.git_revision.present? From 88e76448b6b61ad75c145de0af2acf6af9c2fe4e Mon Sep 17 00:00:00 2001 From: Marcelo Dominguez Date: Sun, 3 Mar 2013 23:10:53 -0200 Subject: [PATCH 2/2] Avoid unnecessarily redirect --- app/controllers/application_controller.rb | 2 +- spec/controllers/registrations_controller_spec.rb | 2 +- spec/controllers/sessions_controller_spec.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 27ede5e5b..e38b7ed3a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -132,6 +132,6 @@ class ApplicationController < ActionController::Base end 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 diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index 9d52c4d64..31d060c3c 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -79,7 +79,7 @@ describe RegistrationsController do it "redirects to the home path" do get :create, @valid_params response.should be_redirect - response.location.should match /^#{root_url}\??$/ + response.location.should match /^#{stream_url}\??$/ end end diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb index e36d5a735..3efcb616b 100644 --- a/spec/controllers/sessions_controller_spec.rb +++ b/spec/controllers/sessions_controller_spec.rb @@ -18,17 +18,17 @@ describe SessionsController do end 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"}} response.should be_redirect - response.location.should match /^#{root_url}\??$/ + response.location.should match /^#{stream_url}\??$/ end 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' post :create, {"user" => {"remember_me" => "0", "username" => @user.username, "password" => "evankorth"}} response.should be_redirect - response.location.should match /^#{root_url}\??$/ + response.location.should match /^#{stream_url}\??$/ end end