Sha256: 0ccb2a3d7347ad92c9ed7796850254b1be775e13d1dc60716f5b3c4c868fa3c2

Contents?: true

Size: 770 Bytes

Versions: 4

Compression:

Stored size: 770 Bytes

Contents

# frozen_string_literal: true

module Rordash
  RSpec.describe UrlUtil do
    let(:url) { "http://html.joe.com/Jobs/123/249 Subert Place Feb29'27.pdf" }

    describe '.safe_escape' do
      it 'encodes url' do
        expect(described_class.safe_escape(url)).to eql("http://html.joe.com/Jobs/123/249%20Subert%20Place%20Feb29'27.pdf")
      end
    end

    describe '.error_from_http_status' do
      it 'returns appropriate http status message' do
        expect(described_class.error_from_http_status(400)).to eql("Bad Request")
      end

      context 'with invalid http status code' do
        it 'unknown http code message' do
          expect(described_class.error_from_http_status(-1)).to eql("Invalid HTTP Status Code")
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rordash-0.1.3 spec/rordash/url_util_spec.rb
rordash-0.1.2 spec/rordash/url_util_spec.rb
rordash-0.1.1 spec/rordash/url_util_spec.rb
rordash-0.1.0 spec/rordash/url_util_spec.rb