travis-api/spec/lib/services/find_annotation_spec.rb
Aakriti Gupta 65f1a29d86 Move travis-core files from /vendor to /lib.
- Re-factor
- Remove code for notifications
- Remove addons
- Remove travis-core gem.
- Ignore logs directory only
- Move core tests to spec/lib
2016-07-20 11:22:25 +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