mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 04:03:57 -06:00
Fix failing spec.
This commit is contained in:
parent
21ae49ab92
commit
5f4ff4a8c0
@ -11,10 +11,12 @@ describe SessionController do
|
||||
describe '#become' do
|
||||
let!(:user) { Fabricate(:user) }
|
||||
|
||||
it "does not work when not in development mode" do
|
||||
Rails.env.stubs(:development?).returns(false)
|
||||
it "does not work when in production mode" do
|
||||
Rails.env.stubs(:production?).returns(true)
|
||||
get :become, params: { session_id: user.username }, format: :json
|
||||
expect(response).not_to be_redirect
|
||||
|
||||
expect(response.status).to eq(403)
|
||||
expect(JSON.parse(response.body)["error_type"]).to eq("invalid_access")
|
||||
expect(session[:current_user_id]).to be_blank
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user