Sha256: 5578dba18c2b8e6340fe4f96a451b9df63475811a79247fa146659b59fbc9d45
Contents?: true
Size: 872 Bytes
Versions: 19
Compression:
Stored size: 872 Bytes
Contents
require 'rest-core/test' describe RC::DefaultSite do app = RC::DefaultSite.new(RC::Dry.new, 'http://example.com/') would 'leave site along if it already has a protocol' do app.call(RC::REQUEST_PATH => 'http://nnf.tw') do |res| res[RC::REQUEST_PATH].should.eq 'http://nnf.tw' end end would 'prepend the site if there is no protocol' do app.call(RC::REQUEST_PATH => 'nnf.tw') do |res| res[RC::REQUEST_PATH].should.eq 'http://example.com/nnf.tw' end end would 'not prepend duplicated /' do app.call(RC::REQUEST_PATH => '/nnf.tw') do |res| res[RC::REQUEST_PATH].should.eq 'http://example.com/nnf.tw' end end would 'concatenate site and path regardlessly' do app.call(RC::REQUEST_PATH => 'nnf.tw', 'site' => 'example.com') do |res| res[RC::REQUEST_PATH].should.eq 'example.com/nnf.tw' end end end
Version data entries
19 entries across 19 versions & 1 rubygems