mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 12:43:54 -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)
|
expect(Admin::ScreenedUrlsController < Admin::AdminController).to eq(true)
|
||||||
end
|
end
|
||||||
|
|
||||||
let!(:user) { log_in(:admin) }
|
describe '#index' do
|
||||||
|
|
||||||
context '.index' do
|
|
||||||
before do
|
before do
|
||||||
get :index, format: :json
|
sign_in(Fabricate(:admin))
|
||||||
end
|
end
|
||||||
|
|
||||||
subject { response }
|
|
||||||
it { is_expected.to be_successful }
|
|
||||||
|
|
||||||
it 'returns JSON' do
|
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
|
end
|
||||||
end
|
end
|
Loading…
Reference in New Issue
Block a user