mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 23:36:11 +08:00
DEV: Apply syntax_tree formatting to spec/*
This commit is contained in:
@ -38,10 +38,11 @@ RSpec.describe Admin::AdminController do
|
||||
it "permits access with a 200 response" do
|
||||
api_key = Fabricate(:api_key, user: admin)
|
||||
|
||||
get "/admin.json", headers: {
|
||||
HTTP_API_KEY: api_key.key,
|
||||
HTTP_API_USERNAME: admin.username
|
||||
}
|
||||
get "/admin.json",
|
||||
headers: {
|
||||
HTTP_API_KEY: api_key.key,
|
||||
HTTP_API_USERNAME: admin.username,
|
||||
}
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
end
|
||||
@ -51,10 +52,11 @@ RSpec.describe Admin::AdminController do
|
||||
it "denies access with a 403 response" do
|
||||
api_key = Fabricate(:api_key, user: moderator)
|
||||
|
||||
get "/admin.json", headers: {
|
||||
HTTP_API_KEY: api_key.key,
|
||||
HTTP_API_USERNAME: moderator.username
|
||||
}
|
||||
get "/admin.json",
|
||||
headers: {
|
||||
HTTP_API_KEY: api_key.key,
|
||||
HTTP_API_USERNAME: moderator.username,
|
||||
}
|
||||
|
||||
expect(response.status).to eq(403)
|
||||
expect(response.parsed_body["errors"]).to include(I18n.t("invalid_access"))
|
||||
|
Reference in New Issue
Block a user