Clean up of RSpec/LetSetup within api/ (#28448)
This commit is contained in:
@@ -10,11 +10,11 @@ describe Api::V1::Accounts::StatusesController do
|
||||
|
||||
before do
|
||||
allow(controller).to receive(:doorkeeper_token) { token }
|
||||
Fabricate(:status, account: user.account)
|
||||
end
|
||||
|
||||
describe 'GET #index' do
|
||||
it 'returns expected headers', :aggregate_failures do
|
||||
Fabricate(:status, account: user.account)
|
||||
get :index, params: { account_id: user.account.id, limit: 1 }
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
@@ -30,7 +30,6 @@ describe Api::V1::Accounts::StatusesController do
|
||||
end
|
||||
|
||||
context 'with exclude replies' do
|
||||
let!(:older_statuses) { user.account.statuses.destroy_all }
|
||||
let!(:status) { Fabricate(:status, account: user.account) }
|
||||
let!(:status_self_reply) { Fabricate(:status, account: user.account, thread: status) }
|
||||
|
||||
|
||||
@@ -15,10 +15,15 @@ RSpec.describe Api::V1::FiltersController do
|
||||
describe 'GET #index' do
|
||||
let(:scopes) { 'read:filters' }
|
||||
let!(:filter) { Fabricate(:custom_filter, account: user.account) }
|
||||
let!(:custom_filter_keyword) { Fabricate(:custom_filter_keyword, custom_filter: filter) }
|
||||
|
||||
it 'returns http success' do
|
||||
get :index
|
||||
expect(response).to have_http_status(200)
|
||||
expect(body_as_json)
|
||||
.to contain_exactly(
|
||||
include(id: custom_filter_keyword.id.to_s)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user