Sha256: 129bd99276082c65707eefb880c96333e044895792e085065159f0ba15cbe826

Contents?: true

Size: 895 Bytes

Versions: 1

Compression:

Stored size: 895 Bytes

Contents

require 'spec_helper'

describe Response::Redirect::Found, '#build' do

  subject { object.build(location) }

  let(:object) { described_class }

  let(:location) { double('Location', :to_s => 'THE-LOCATION') }

  its(:status)  { should be(Response::Status::FOUND) }
  its(:headers) { should eql('Location' => location, 'Content-Type' => 'text/plain; charset=UTF-8') }
  its(:body)    { should eql('You are beeing redirected to: THE-LOCATION') }
end

describe Response::Redirect::Permanent, '#build' do

  subject { object.build(location) }

  let(:object) { described_class }

  let(:location) { double('Location', :to_s => 'THE-LOCATION') }

  its(:status)  { should be(Response::Status::MOVED_PERMANENTLY) }
  its(:headers) { should eql('Location' => location, 'Content-Type' => 'text/plain; charset=UTF-8') }
  its(:body)    { should eql('You are beeing redirected to: THE-LOCATION') }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
response-0.0.4 spec/unit/response/redirect/class_methods/build_spec.rb