From f8e53bfba5e3c295acb912e327990b045ef95b72 Mon Sep 17 00:00:00 2001 From: Raphael Sofaer Date: Tue, 9 Aug 2011 16:20:27 -0700 Subject: [PATCH] Fix a user's atom feed route from a cell phone. --- app/controllers/users_controller.rb | 2 +- spec/controllers/users_controller_spec.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index ac0c983e2..f1d5f20bb 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -85,7 +85,7 @@ class UsersController < ApplicationController render :xml => director.build(ostatus_builder), :content_type => 'application/atom+xml' end - format.html { redirect_to person_path(user.person.id) } + format.any { redirect_to person_path(user.person.id) } end else redirect_to root_url, :error => I18n.t('users.public.does_not_exist', :username => params[:username]) diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 9c4090967..66a445a3a 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -38,6 +38,11 @@ describe UsersController do get :public, :username => @user.username response.should be_redirect end + it 'redirects to a profile page if mobile is requested' do + Diaspora::OstatusBuilder.should_not_receive(:new) + get :public, :username => @user.username, :format => :mobile + response.should be_redirect + end end describe '#update' do