travis-api/spec/unit/responders/service_spec.rb
2012-11-01 16:15:06 +01:00

22 lines
551 B
Ruby

require 'spec_helper'
describe Travis::Api::App::Responders::Service do
class MyService < Travis::Api::App::Responders::Service
end
let(:endpoint) { stub 'endpoint', public?: true }
let(:resource) { stub 'resource', run: {} }
let(:options) { {} }
let(:service) { MyService.new(endpoint, resource, options) }
context 'with final resource' do
before { resource.expects(:final?).returns(true) }
it 'caches resource for a year' do
endpoint.expects(:expires).with(31536000, :public)
service.apply
end
end
end