travis-api/spec_core/services/find_annotation_spec.rb
2016-06-19 14:35:54 +02:00

20 lines
504 B
Ruby

describe Travis::Services::FindAnnotations do
let(:job) { Factory(:test) }
let!(:annotation) { Factory(:annotation, job: job) }
let(:service) { described_class.new(params) }
attr_reader :params
describe 'run' do
it 'finds annotations by a given list of ids' do
@params = { ids: [annotation.id] }
service.run.should eq([annotation])
end
it 'finds annotations by job_id' do
@params = { job_id: job.id }
service.run.should eq([annotation])
end
end
end