REFACTOR: admin screened emails controller specs to requests (#5975)
This commit is contained in:
parent
f30c2dacb2
commit
237559c76f
|
@ -5,18 +5,17 @@ describe Admin::ScreenedEmailsController do
|
|||
expect(Admin::ScreenedEmailsController < 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_email)
|
||||
get "/admin/logs/screened_emails.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