Sha256: f4bde25a7064ba9e747578c58945bb20d0d12713b0a3dfc2bd4e52afd3bf18dd
Contents?: true
Size: 1.03 KB
Versions: 28
Compression:
Stored size: 1.03 KB
Contents
require 'spec_helper' describe CobotClient::UrlHelper, 'cobot_url' do let(:helper) do Object.new.tap do |o| o.extend CobotClient::UrlHelper end end after(:each) do CobotClient::UrlHelper.site = 'https://www.cobot.me' end it 'lets me change the site' do CobotClient::UrlHelper.site = 'https://www.cobot.com' expect(helper.cobot_url).to eql('https://www.cobot.com/') 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
28 entries across 28 versions & 1 rubygems