Page MenuHomePhabricator

as_user(:b) doesn't actually change to the user b when using the user factory
Closed, ResolvedPublic

Description

Having this method in a test

as_user(:b) do
  api.create_page(
  "test_page_123",
  message
)

The api actually sends this request from user and not user_b.

Event Timeline

Mooeypoo raised the priority of this task from to Needs Triage.
Mooeypoo updated the task description. (Show Details)
Mooeypoo subscribed.
dduvall triaged this task as High priority.
dduvall set Security to None.
dduvall renamed this task from as_user(:b) doesn't actually change to the user b to as_user(:b) doesn't actually change to the user b when using the user factory.Sep 29 2015, 12:19 AM

This appears to be a bug in UserFactoryHelper, affecting as_user block scope when the user factory is enabled.

Change 242030 had a related patch set uploaded (by Dduvall):
Consider explicit configuration in UserFactoryHelper

https://gerrit.wikimedia.org/r/242030

Change 242030 merged by jenkins-bot:
Consider explicit configuration in UserFactoryHelper

https://gerrit.wikimedia.org/r/242030