Sha256: 89b4409d6be49b8afa6af7b3de4aa4b19f7307d689e4c055c248ebcd7f168928

Contents?: true

Size: 812 Bytes

Versions: 6

Compression:

Stored size: 812 Bytes

Contents

require 'spec_helper'

describe CobotClient::UrlHelper, 'cobot_url' do
  let(:helper) do
    Object.new.tap do |o|
      o.extend CobotClient::UrlHelper
    end
  end

  it 'returns the default url' do
    expect(helper.cobot_url).to eql('https://www.cobot.me/')
  end

  it 'returns a url with a sudomain' do
    expect(helper.cobot_url('co-up')).to eql('https://co-up.cobot.me/')
  end

  it 'returns a url with a path' do
    expect(helper.cobot_url('co-up', '/x/y')).to eql('https://co-up.cobot.me/x/y')
  end

  it 'returns a url with params' do
    expect(helper.cobot_url('co-up', params: {x: 'y'})).to eql('https://co-up.cobot.me/?x=y')
  end

  it 'returns a url with params and path' do
    expect(helper.cobot_url('co-up', '/x/y', params: {a: 'b'})).to eql('https://co-up.cobot.me/x/y?a=b')
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cobot_client-0.5.0 spec/cobot_client/url_helper_spec.rb
cobot_client-0.4.0 spec/cobot_client/url_helper_spec.rb
cobot_client-0.3.0 spec/cobot_client/url_helper_spec.rb
cobot_client-0.2.0 spec/cobot_client/url_helper_spec.rb
cobot_client-0.1.0 spec/cobot_client/url_helper_spec.rb
cobot_client-0.0.1 spec/cobot_client/url_helper_spec.rb