Sha256: 9e2c5f6a9c0333f30c9ffcf041a58215868db11a298cfa82ffafc803d5c195e3

Contents?: true

Size: 892 Bytes

Versions: 2

Compression:

Stored size: 892 Bytes

Contents

# frozen_string_literal: true
[
  File.join(File.dirname(__FILE__), '..'),
  File.join(File.dirname(__FILE__), '..', 'lib/fluent/plugin'),
  File.join(File.dirname(__FILE__), '..', 'spec')
].each do |dir|
  $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir)
end

require 'metrics_helper'
require 'date'
require 'rspec'
require 'rest-client'
require './spec/fixtures/files/creds'


RSpec.describe MetricsHelper do
  jpd_url, username, apikey = get_credentials
  describe '#get_metrics' do
    it 'should return response code 200 and response body > 1' do
      response = RestClient::Request.new(
        method: :get,
        url: "#{jpd_url}/artifactory/api/v1/metrics",
        user: username.to_s,
        password: apikey.to_s
      ).execute do |response, request, result|
        expect(response.code).to eq(200)
        expect(response.size).to be > 1
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fluent-plugin-jfrog-metrics-0.1.2 spec/lib/metrics_helper_spec.rb
fluent-plugin-jfrog-metrics-0.1.0 spec/lib/metrics_helper_spec.rb