Sha256: f8b4ef89661f1298d9e55e4a4299f9f6cf3c147fec2f6685ef637027994207a4

Contents?: true

Size: 530 Bytes

Versions: 21

Compression:

Stored size: 530 Bytes

Contents

# encoding: utf-8

require "uri"

module RequestHelpers
  PORT = 5678

  def get path, options = {}
    accept = options.delete(:accept) { :json }
    url = URI("http://localhost:#{PORT}").merge(path)
    HTTP.accept(accept).basic_auth(user: "admin", pass: "admin")
      .get(url, options)
  end

  def post path, options = {}
    accept = options.delete(:accept) { :json }
    url = URI("http://localhost:#{PORT}").merge(path)
    HTTP.accept(accept).basic_auth(user: "admin", pass: "admin")
      .post(url, options)
  end

end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rest-ftp-daemon-1.1.1 spec/support/request_helpers.rb
rest-ftp-daemon-1.1.0 spec/support/request_helpers.rb
rest-ftp-daemon-1.0.15 spec/support/request_helpers.rb
rest-ftp-daemon-1.0.14 spec/support/request_helpers.rb
rest-ftp-daemon-1.0.13 spec/support/request_helpers.rb
rest-ftp-daemon-1.0.12 spec/support/request_helpers.rb
rest-ftp-daemon-1.0.11 spec/support/request_helpers.rb
rest-ftp-daemon-1.0.10 spec/support/request_helpers.rb
rest-ftp-daemon-1.0.9 spec/support/request_helpers.rb
rest-ftp-daemon-1.0.8 spec/support/request_helpers.rb
rest-ftp-daemon-1.0.7 spec/support/request_helpers.rb
rest-ftp-daemon-1.0.6 spec/support/request_helpers.rb
rest-ftp-daemon-1.0.5 spec/support/request_helpers.rb
rest-ftp-daemon-1.0.4 spec/support/request_helpers.rb
rest-ftp-daemon-1.0.3 spec/support/request_helpers.rb
rest-ftp-daemon-1.0.2 spec/support/request_helpers.rb
rest-ftp-daemon-1.0.1 spec/support/request_helpers.rb
rest-ftp-daemon-0.502.2 spec/support/request_helpers.rb
rest-ftp-daemon-0.502.1 spec/support/request_helpers.rb
rest-ftp-daemon-0.502.0 spec/support/request_helpers.rb