mirror of
https://github.com/funamitech/mastodon
synced 2024-11-24 07:06:34 +09:00
Move api/v1/trends/*
to request specs (#28949)
This commit is contained in:
parent
0b0ca6f3b8
commit
7adcc0aae3
@ -2,15 +2,13 @@
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Api::V1::Trends::LinksController do
|
||||
render_views
|
||||
|
||||
describe 'GET #index' do
|
||||
RSpec.describe 'API V1 Trends Links' do
|
||||
describe 'GET /api/v1/trends/links' do
|
||||
context 'when trends are disabled' do
|
||||
before { Setting.trends = false }
|
||||
|
||||
it 'returns http success' do
|
||||
get :index
|
||||
get '/api/v1/trends/links'
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
@ -22,7 +20,7 @@ RSpec.describe Api::V1::Trends::LinksController do
|
||||
it 'returns http success' do
|
||||
prepare_trends
|
||||
stub_const('Api::V1::Trends::LinksController::DEFAULT_LINKS_LIMIT', 2)
|
||||
get :index
|
||||
get '/api/v1/trends/links'
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.headers).to include('Link')
|
@ -2,15 +2,13 @@
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Api::V1::Trends::StatusesController do
|
||||
render_views
|
||||
|
||||
describe 'GET #index' do
|
||||
RSpec.describe 'API V1 Trends Statuses' do
|
||||
describe 'GET /api/v1/trends/statuses' do
|
||||
context 'when trends are disabled' do
|
||||
before { Setting.trends = false }
|
||||
|
||||
it 'returns http success' do
|
||||
get :index
|
||||
get '/api/v1/trends/statuses'
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
end
|
||||
@ -22,7 +20,7 @@ RSpec.describe Api::V1::Trends::StatusesController do
|
||||
it 'returns http success' do
|
||||
prepare_trends
|
||||
stub_const('Api::BaseController::DEFAULT_STATUSES_LIMIT', 2)
|
||||
get :index
|
||||
get '/api/v1/trends/statuses'
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.headers).to include('Link')
|
@ -2,15 +2,13 @@
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Api::V1::Trends::TagsController do
|
||||
render_views
|
||||
|
||||
describe 'GET #index' do
|
||||
RSpec.describe 'API V1 Trends Tags' do
|
||||
describe 'GET /api/v1/trends/tags' do
|
||||
context 'when trends are disabled' do
|
||||
before { Setting.trends = false }
|
||||
|
||||
it 'returns http success' do
|
||||
get :index
|
||||
get '/api/v1/trends/tags'
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.headers).to_not include('Link')
|
||||
@ -23,7 +21,7 @@ RSpec.describe Api::V1::Trends::TagsController do
|
||||
it 'returns http success' do
|
||||
prepare_trends
|
||||
stub_const('Api::V1::Trends::TagsController::DEFAULT_TAGS_LIMIT', 2)
|
||||
get :index
|
||||
get '/api/v1/trends/tags'
|
||||
|
||||
expect(response).to have_http_status(200)
|
||||
expect(response.headers).to include('Link')
|
Loading…
Reference in New Issue
Block a user