Sha256: 4f8a066b81e404e075645ccee23b30e46387e012aed66384ca4b2843fcea5e2b

Contents?: true

Size: 501 Bytes

Versions: 2

Compression:

Stored size: 501 Bytes

Contents

module Landable
  module Spec
    module CoreHelpers
      def random_uuid
        SecureRandom.uuid
      end

      def at_json(path, object = last_json)
        path.split('/').reduce object do |parent, key|
          key = key.to_i if parent.is_a?(Array)
          parent.fetch key
        end
      end
    end

    module HttpHelpers
      def encode_basic_auth(username, token)
        ActionController::HttpAuthentication::Basic.encode_credentials(username, token)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
landable-1.14.0 spec/support/helpers.rb
landable-1.13.2 spec/support/helpers.rb