Sha256: b00a6810f6bbf99da0ee97eb23c681950a202efa4d5ddd3e7b47c98495664395

Contents?: true

Size: 953 Bytes

Versions: 3

Compression:

Stored size: 953 Bytes

Contents

require 'spec_helper'
require 'rspec/webservice_matchers'


describe 'redirect_permanently_to' do
  it 'passes when receiving a 301 to the given URL' do
    expect('http://perm-redirector.com').to redirect_permanently_to('http://www.website.com/')
  end

  it 'handles domain names gracefully' do
    expect('perm-redirector.com').to redirect_permanently_to('www.website.com/')
  end

  it 'handles missing final slash' do
    expect('perm-redirector.com').to redirect_permanently_to('www.website.com')
  end 
end


describe 'redirect_temporarily_to' do
  it 'passes when it gets a 302' do
    'http://temp-redirector.org'.should redirect_temporarily_to 'http://a-page.com/a/page.txt'
  end

  it 'handles domain names gracefully' do
    'temp-redirector.org'.should redirect_temporarily_to 'a-page.com/a/page.txt'
  end 

  it 'passes when it gets a 307' do
    'temp-307-redirector.net'.should redirect_temporarily_to 'a-page.com/a/page.txt'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rspec-webservice_matchers-1.4.4 spec/rspec/webservice_matchers/redirect_spec.rb
rspec-webservice_matchers-1.4.3 spec/rspec/webservice_matchers/redirect_spec.rb
rspec-webservice_matchers-1.4.2 spec/rspec/webservice_matchers/redirect_spec.rb