lib/scrivito/test_request.rb in scrivito_sdk-0.50.1 vs lib/scrivito/test_request.rb in scrivito_sdk-0.60.0.rc1
- old
+ new
@@ -43,7 +43,17 @@
end
def for_cms_object(*args)
raise "The method `for_cms_object' was removed. Please use `for_scrivito_obj' instead"
end
+
+ #
+ # Make a test request to act as it's by a specific Scrivito user
+ #
+ # @api public
+ # @param [Scrivito::User] test_user requested +User+
+ #
+ def for_scrivito_user(test_user)
+ env[EditingContextMiddleware::ENVKEY] = EditingContext.new(editor: -> { test_user })
+ end
end
end