2018-12-17 10:35:55 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
2023-05-04 04:49:53 +01:00
|
|
|
RSpec.describe Api::V1::Instances::PeersController do
|
2018-12-17 10:35:55 +00:00
|
|
|
describe 'GET #index' do
|
|
|
|
it 'returns 200' do
|
|
|
|
get :index
|
|
|
|
expect(response).to have_http_status(200)
|
|
|
|
end
|
|
|
|
|
2023-05-04 04:49:08 +01:00
|
|
|
context 'with !Setting.peers_api_enabled' do
|
2018-12-17 10:35:55 +00:00
|
|
|
it 'returns 404' do
|
|
|
|
Setting.peers_api_enabled = false
|
|
|
|
|
|
|
|
get :index
|
|
|
|
expect(response).to have_http_status(404)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|