Sha256: 95e8f29d3c6a5e424587ed5c8dd90901a33661c7b7a877e8867f061543d9ecda

Contents?: true

Size: 573 Bytes

Versions: 2

Compression:

Stored size: 573 Bytes

Contents

require 'spec_helper'

describe ::Acfs::Location do
  let(:location) { described_class.new(uri, args) }
  let(:uri)      { 'http://localhost/users/:id' }
  let(:args)     { {id: 4} }

  describe '#str' do
    subject(:str) { location.str }

    it 'replaces variables with values' do
      expect(str).to eq 'http://localhost/users/4'
    end

    context 'with special characters' do
      let(:args) { {id: '4 [@(\/!^$'} }

      it 'escapes special characters' do
        expect(str).to eq 'http://localhost/users/4+%5B%40%28%5C%2F%21%5E%24'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
acfs-1.3.2 spec/acfs/location_spec.rb
acfs-1.3.1 spec/acfs/location_spec.rb