From b614eeeaef451335f006dece0945045e965c7cea Mon Sep 17 00:00:00 2001 From: Benjamin ter Kuile Date: Tue, 13 Jan 2015 11:59:12 +0100 Subject: [PATCH] Render user app in test env --- app/controllers/users/application_controller.rb | 3 ++- config/version | 2 +- spec/support/route_helpers.rb | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/users/application_controller.rb b/app/controllers/users/application_controller.rb index 7ddd4d31..dfd64bf5 100644 --- a/app/controllers/users/application_controller.rb +++ b/app/controllers/users/application_controller.rb @@ -1,7 +1,7 @@ module Users class ApplicationController < ::ApplicationController before_action :allow_all_origins - before_action :user_authentication, :unless => ->(c){ %w(obtain_token).include?(c.action_name) } # , except: [:obtain_token, :index] + before_action :user_authentication, unless: ->(c){ %w(obtain_token).include?(c.action_name) } # , except: [:obtain_token, :index] private @@ -11,6 +11,7 @@ module Users sign_in user if user sign_out current_user if current_user && !user # Other token attempt of logged in user else + return if Rails.env.test? and action_name == 'index' authenticate_user! end diff --git a/config/version b/config/version index 380550b4..2d72c8d3 100644 --- a/config/version +++ b/config/version @@ -1 +1 @@ -0.9.47 +0.9.48 diff --git a/spec/support/route_helpers.rb b/spec/support/route_helpers.rb index f9e14b55..99559b65 100644 --- a/spec/support/route_helpers.rb +++ b/spec/support/route_helpers.rb @@ -29,7 +29,7 @@ module SpecRouteHelpers # currentRouteName does not include model information: /list/123 => currentRouteName == 'list' # page.evaluate_script %|App.__container__.lookup('controller:application').get('currentRouteName')| # page.evaluate_script %|App.__container__.lookup('router:main').location.lastSetURL| # not working for direct path supplier#/settings - route = page.evaluate_script %{App.__container__ && (window.location.hash || "#/").substr(1)} + route = page.evaluate_script(%{App.__container__ && (window.location.hash || "#/").substr(1)}) unless omit_should_raise def route.should(*) raise "Cannot call should on ember route. Use ember_route_should_be instead"