Sha256: d10301734b56270ad925567f35b4c05782d7cce50ad9bf7804b81638a6a37ace

Contents?: true

Size: 756 Bytes

Versions: 8

Compression:

Stored size: 756 Bytes

Contents

require 'spec_helper'

describe RedboothRuby::Request::Info do
  describe '#url' do
    it 'constructs the url' do
      info = RedboothRuby::Request::Info.new(:get, nil, 'random', { id: 1 })

      expect(info.url).to match /random/
    end
  end

  describe '#path_with_params' do
    it 'does nothing when no params' do
      info = RedboothRuby::Request::Info.new(:get, nil, 'random', nil)
      path = '/path/to/someplace'

      expect(info.path_with_params(path, {})).to eq path
    end

    it 'constructs the path with params' do
      info = RedboothRuby::Request::Info.new(:get, nil, 'random', nil)
      path = '/path/to/someplace'

      expect(info.path_with_params(path, { random: 'stuff' })).to eq "#{ path }?random=stuff"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
redbooth-ruby-0.2.3 spec/redbooth-ruby/request/info_spec.rb
redbooth-ruby-0.2.2 spec/redbooth-ruby/request/info_spec.rb
redbooth-ruby-0.2.1 spec/redbooth-ruby/request/info_spec.rb
redbooth-ruby-0.2.0 spec/redbooth-ruby/request/info_spec.rb
redbooth-ruby-0.1.4 spec/redbooth-ruby/request/info_spec.rb
redbooth-ruby-0.1.3 spec/redbooth-ruby/request/info_spec.rb
redbooth-ruby-0.1.1 spec/redbooth-ruby/request/info_spec.rb
redbooth-ruby-0.1.0 spec/redbooth-ruby/request/info_spec.rb