mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 11:20:57 -06:00
REFACTOR: admin screened urls controller specs to requests (#5976)
This commit is contained in:
parent
63b2207065
commit
f30c2dacb2
@ -5,18 +5,17 @@ describe Admin::ScreenedUrlsController do
|
||||
expect(Admin::ScreenedUrlsController < Admin::AdminController).to eq(true)
|
||||
end
|
||||
|
||||
let!(:user) { log_in(:admin) }
|
||||
|
||||
context '.index' do
|
||||
describe '#index' do
|
||||
before do
|
||||
get :index, format: :json
|
||||
sign_in(Fabricate(:admin))
|
||||
end
|
||||
|
||||
subject { response }
|
||||
it { is_expected.to be_successful }
|
||||
|
||||
it 'returns JSON' do
|
||||
expect(::JSON.parse(subject.body)).to be_a(Array)
|
||||
Fabricate(:screened_url)
|
||||
get "/admin/logs/screened_urls.json"
|
||||
expect(response.status).to eq(200)
|
||||
json = JSON.parse(response.body)
|
||||
expect(json.size).to eq(1)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user