Sha256: 644d752e5f1b8f27e4af62366da1ca03810cf5ab9d43160d00f0eeae3952b690
Contents?: true
Size: 1.33 KB
Versions: 58
Compression:
Stored size: 1.33 KB
Contents
# encoding: utf-8 require "spec_helper" require "sinatra" require "logstash/api/modules/plugins" require "logstash/json" describe LogStash::Api::Modules::Plugins do include_context "api setup" include_examples "not found" before(:each) do get "/" end let(:payload) { LogStash::Json.load(last_response.body) } it "respond to plugins resource" do expect(last_response).to be_ok end it "return valid json content type" do expect(last_response.content_type).to eq("application/json"), "Did not get json, got #{last_response.content_type} / #{last_response.body}" end context "#schema" do it "return the expected schema" do expect(payload.keys).to include("plugins", "total") payload["plugins"].each do |plugin| expect(plugin.keys).to include("name", "version") end end end context "#values" do it "return totals of plugins" do expect(payload["total"]).to eq(payload["plugins"].count) end it "return a list of available plugins" do payload["plugins"].each do |plugin| expect do Gem::Specification.find_by_name(plugin["name"]) end.not_to raise_error end end it "return non empty version values" do payload["plugins"].each do |plugin| expect(plugin["version"]).not_to be_empty end end end end
Version data entries
58 entries across 58 versions & 6 rubygems