mirror of
https://github.com/discourse/discourse.git
synced 2025-05-03 14:54:35 +08:00
Fix failing spec.
This commit is contained in:
parent
21ae49ab92
commit
5f4ff4a8c0
@ -11,10 +11,12 @@ describe SessionController do
|
|||||||
describe '#become' do
|
describe '#become' do
|
||||||
let!(:user) { Fabricate(:user) }
|
let!(:user) { Fabricate(:user) }
|
||||||
|
|
||||||
it "does not work when not in development mode" do
|
it "does not work when in production mode" do
|
||||||
Rails.env.stubs(:development?).returns(false)
|
Rails.env.stubs(:production?).returns(true)
|
||||||
get :become, params: { session_id: user.username }, format: :json
|
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
|
expect(session[:current_user_id]).to be_blank
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user