Sha256: fbc1b251c277687a031852561fe0159070114f2da197e168ccc79f76e90ae53f

Contents?: true

Size: 684 Bytes

Versions: 1

Compression:

Stored size: 684 Bytes

Contents

require 'rspec/webservice_matchers'

#
# TODO: Set up a server for these. (Or a mock?) 
#       Faraday supports testing: we can use that now.
#
describe 'redirect_permanently_to' do
  it 'passes when receiving a 301 to the given URL' do
    expect('http://weblaws.org').to redirect_permanently_to('http://www.weblaws.org/')
    expect('http://www.getquisitive.com/press-kit/').to redirect_permanently_to 'http://getquisitive.com/press-kit/'
  end
end

describe 'redirect_temporarily_to' do
  it 'passes when it gets a 302' do
    'http://www.oregonlaws.org/cms/about_us'.should redirect_temporarily_to 'http://www.weblaws.org/cms/about_us'
  end

  it 'passes when it gets a 307'
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-webservice_matchers-1.1.2 spec/rspec/webservice_matchers/redirect_spec.rb