diff --git a/spec/controllers/api/v1/trends/links_controller_spec.rb b/spec/requests/api/v1/trends/links_spec.rb similarity index 84% rename from spec/controllers/api/v1/trends/links_controller_spec.rb rename to spec/requests/api/v1/trends/links_spec.rb index bcaf066f16..012d035907 100644 --- a/spec/controllers/api/v1/trends/links_controller_spec.rb +++ b/spec/requests/api/v1/trends/links_spec.rb @@ -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') diff --git a/spec/controllers/api/v1/trends/statuses_controller_spec.rb b/spec/requests/api/v1/trends/statuses_spec.rb similarity index 83% rename from spec/controllers/api/v1/trends/statuses_controller_spec.rb rename to spec/requests/api/v1/trends/statuses_spec.rb index 25ab5f228a..3b906e8f82 100644 --- a/spec/controllers/api/v1/trends/statuses_controller_spec.rb +++ b/spec/requests/api/v1/trends/statuses_spec.rb @@ -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') diff --git a/spec/controllers/api/v1/trends/tags_controller_spec.rb b/spec/requests/api/v1/trends/tags_spec.rb similarity index 85% rename from spec/controllers/api/v1/trends/tags_controller_spec.rb rename to spec/requests/api/v1/trends/tags_spec.rb index c889f1c5b9..598f4e7752 100644 --- a/spec/controllers/api/v1/trends/tags_controller_spec.rb +++ b/spec/requests/api/v1/trends/tags_spec.rb @@ -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')