Guest User

Untitled

a guest
Feb 19th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.44 KB | None | 0 0
  1. kilgore:suds tfisher$ git diff
  2. diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
  3. index 3d39185..a582da7 100644
  4. --- a/app/controllers/sessions_controller.rb
  5. +++ b/app/controllers/sessions_controller.rb
  6. @@ -7,12 +7,16 @@ class SessionsController < ApplicationController
  7.     # on an iPhone that has the app installed. If so, boot them to the iPhone app.
  8.    
  9.     include MobileRedirect
  10. -   mobile_redirect :new do |req|
  11. +   mobile_redirect :mobile_login do |req|
  12.        "sermo://home"
  13.     end
  14.    
  15.     before_filter :setup_defaults, :only => [:new, :create]
  16.  
  17. +   def mobile_login
  18. +      redirect_to login_path
  19. +   end
  20. +  
  21.     def new
  22.        if params[:return_to]
  23.           session[:return_to] = params[:return_to]
  24. diff --git a/config/routes.rb b/config/routes.rb
  25. index 41b8bba..0063b4c 100644
  26. --- a/config/routes.rb
  27. +++ b/config/routes.rb
  28. @@ -11,6 +11,8 @@ Suds::Application.routes.draw do
  29.        root :to => "users#my_account"
  30.  
  31.        match '/login', :to => "sessions#new", :as => :login
  32. +      match '/mobile_login', :to => "sessions#mobile_login", :as => :mobile_login
  33. +      
  34.        match '/logout', :to => "sessions#destroy", :as => :logout
  35.  
  36.        match '/picture_frame', :to => "picture_frame#index"
  37. diff --git a/test/functional/sessions_controller_test.rb b/test/functional/sessions_controller_test.rb
  38. index 3200ff3..75e4f5e 100644
  39. --- a/test/functional/sessions_controller_test.rb
  40. +++ b/test/functional/sessions_controller_test.rb
  41. @@ -281,15 +281,23 @@ class SessionsControllerTest < ActionController::TestCase
  42.        assert_redirected_to login_path
  43.     end
  44.    
  45. -   test "a iPhone user agent will get a mobile direct for the login page" do
  46. +   test "a iPhone user agent will get a mobile direct for the mobile login action" do
  47.        @request.user_agent = "iPhone"
  48.        
  49.        skip_tidy do
  50. -         get :new
  51. +         get :mobile_login
  52.        end
  53.        assert_match "sermo://home", @response.body
  54.     end
  55.    
  56. +   test "a non-iPhone user agent will get a send to the login page for the mobile login action" do
  57. +       skip_tidy do
  58. +          get :mobile_login
  59. +       end
  60. +      
  61. +       assert_redirected_to login_path
  62. +    end
  63. +  
  64.     # See campaigns_helper.rb and marketing_campaign_info_helper.rb for details on how this stuff works
  65.     test "during a new login, the session will be loaded with the user's invitation campaign info" do
  66.        user = create_physician
Add Comment
Please, Sign In to add comment