gitlab-org--gitlab-foss/spec/lib/gitlab/metrics/background_transaction_spec.rb
Pawel Chojnacki 90edcb45cd Make BackgroundTransaction#labels public
as are all other Transaction implementations
2017-11-07 19:23:52 +01:00

19 lines
502 B
Ruby

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
describe '#label' do
it 'returns labels based on class name' do
expect(subject.labels).to eq(controller: 'TestWorker', action: 'perform')
end
end
end