spec/support/rails.rb in rails_locale_detection-2.0.0 vs spec/support/rails.rb in rails_locale_detection-2.1.0
- old
+ new
@@ -1,10 +1,10 @@
class MockApplication
def self.env_config
{}
end
-
+
def self.routes
@routes ||= ActionDispatch::Routing::RouteSet.new
end
end
@@ -13,18 +13,23 @@
end
::Rails.application = MockApplication
ActionController::Base.send :include, RailsLocaleDetection::ControllerMethods
-ActionController::Base.send :include, Rails.application.routes.url_helpers
+ActionController::Base.send :include, Rails.application.routes.url_helpers
class CallbackTestsController < ActionController::Base
def user_locale
:fr
end
-
+
def show
- render :text => current_locale
+ if ::Rails.version.to_s < "4.1"
+ render text: current_locale
+ else
+ render plain: current_locale
+ end
+
end
-
-end
\ No newline at end of file
+
+end