mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-12-27 21:10:54 +00:00
20 lines
509 B
Ruby
Executable file
20 lines
509 B
Ruby
Executable file
require 'rails_helper'
|
|
|
|
describe Api::V1::ServersController do
|
|
before do
|
|
request.accept = "application/json"
|
|
end
|
|
|
|
describe "#index" do
|
|
let!(:server) { create :server, :active }
|
|
let!(:inactive_server) { create :server, :inactive }
|
|
|
|
it "returns a list of servers" do
|
|
get :index
|
|
expect(response).to have_http_status(:success)
|
|
expect(json["servers"].length).to eq(1)
|
|
json_server = json["servers"][0]
|
|
expect(json_server["id"]).to eq(server.id)
|
|
end
|
|
end
|
|
end
|