Commit 2ead2b97 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Improce specs of authentication activity class methods

parent 00e4d918
require 'spec_helper' require 'fast_spec_helper'
describe Gitlab::Auth::Activity do describe Gitlab::Auth::Activity do
describe '#each_counter' do describe '.each_counter' do
it 'has all static counters defined' do it 'has all static counters defined' do
described_class.each_counter do |counter| described_class.each_counter do |counter|
expect(described_class).to respond_to(counter) expect(described_class).to respond_to(counter)
end end
end end
# todo incrementer pairs it 'has all static incrementers defined' do
# todo all metrics starting with `user`_ described_class.each_counter do |counter|
expect(described_class).to respond_to("#{counter}_increment!")
end
end
it 'has all counters starting with `user_`' do
described_class.each_counter do |counter|
expect(counter).to start_with('user_')
end
end
it 'yields counter method, name and description' do
described_class.each_counter do |method, name, description|
expect(method).to eq "#{name}_counter"
expect(description).to start_with('Counter of')
end
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment