Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- kilgore:suds tfisher$ git diff
- diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
- index 3d39185..a582da7 100644
- --- a/app/controllers/sessions_controller.rb
- +++ b/app/controllers/sessions_controller.rb
- @@ -7,12 +7,16 @@ class SessionsController < ApplicationController
- # on an iPhone that has the app installed. If so, boot them to the iPhone app.
- include MobileRedirect
- - mobile_redirect :new do |req|
- + mobile_redirect :mobile_login do |req|
- "sermo://home"
- end
- before_filter :setup_defaults, :only => [:new, :create]
- + def mobile_login
- + redirect_to login_path
- + end
- +
- def new
- if params[:return_to]
- session[:return_to] = params[:return_to]
- diff --git a/config/routes.rb b/config/routes.rb
- index 41b8bba..0063b4c 100644
- --- a/config/routes.rb
- +++ b/config/routes.rb
- @@ -11,6 +11,8 @@ Suds::Application.routes.draw do
- root :to => "users#my_account"
- match '/login', :to => "sessions#new", :as => :login
- + match '/mobile_login', :to => "sessions#mobile_login", :as => :mobile_login
- +
- match '/logout', :to => "sessions#destroy", :as => :logout
- match '/picture_frame', :to => "picture_frame#index"
- diff --git a/test/functional/sessions_controller_test.rb b/test/functional/sessions_controller_test.rb
- index 3200ff3..75e4f5e 100644
- --- a/test/functional/sessions_controller_test.rb
- +++ b/test/functional/sessions_controller_test.rb
- @@ -281,15 +281,23 @@ class SessionsControllerTest < ActionController::TestCase
- assert_redirected_to login_path
- end
- - test "a iPhone user agent will get a mobile direct for the login page" do
- + test "a iPhone user agent will get a mobile direct for the mobile login action" do
- @request.user_agent = "iPhone"
- skip_tidy do
- - get :new
- + get :mobile_login
- end
- assert_match "sermo://home", @response.body
- end
- + test "a non-iPhone user agent will get a send to the login page for the mobile login action" do
- + skip_tidy do
- + get :mobile_login
- + end
- +
- + assert_redirected_to login_path
- + end
- +
- # See campaigns_helper.rb and marketing_campaign_info_helper.rb for details on how this stuff works
- test "during a new login, the session will be loaded with the user's invitation campaign info" do
- user = create_physician
Add Comment
Please, Sign In to add comment