Sha256: 58f6b9b5b7c5d52b3659f9ff09f46fdf3d5b03bc4db481caedaaeb16744e0a63

Contents?: true

Size: 566 Bytes

Versions: 4

Compression:

Stored size: 566 Bytes

Contents

require 'spec_helper'

describe Response, '#last_modified' do
  subject { object.last_modified }

  let(:object) { Response.build.with_headers(header) }

  let(:time) { Time.httpdate(Time.now.httpdate) }

  context 'when Content-Type header is present' do
    let(:header) { { 'Last-Modified' => time.httpdate } }

    it { should eql(time) }

    it_should_behave_like 'an idempotent method'
  end

  context 'when Content-Type header is not present' do
    let(:header) { {} }

    it { should be(nil) }

    it_should_behave_like 'an idempotent method'
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
response-0.0.5 spec/unit/response/last_modified_spec.rb
response-0.0.4 spec/unit/response/last_modified_spec.rb
response-0.0.3 spec/unit/response/last_modified_spec.rb
response-0.0.2 spec/unit/response/last_modified_spec.rb