2017-10-19 07:48:27 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Gitlab::Metrics::BackgroundTransaction do
|
|
|
|
let(:test_worker_class) { double(:class, name: 'TestWorker') }
|
|
|
|
|
|
|
|
subject { described_class.new(test_worker_class) }
|
|
|
|
|
|
|
|
describe '#action' do
|
|
|
|
it 'returns transaction action name' do
|
|
|
|
expect(subject.action).to eq('TestWorker#perform')
|
|
|
|
end
|
|
|
|
end
|
2017-11-07 13:23:52 -05:00
|
|
|
|
|
|
|
describe '#label' do
|
|
|
|
it 'returns labels based on class name' do
|
|
|
|
expect(subject.labels).to eq(controller: 'TestWorker', action: 'perform')
|
|
|
|
end
|
|
|
|
end
|
2017-10-19 07:48:27 -04:00
|
|
|
end
|