diff options
Diffstat (limited to 'spec/support/counter_attribute.rb')
-rw-r--r-- | spec/support/counter_attribute.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/support/counter_attribute.rb b/spec/support/counter_attribute.rb index 8bd40b72dcf..44df2df0ea5 100644 --- a/spec/support/counter_attribute.rb +++ b/spec/support/counter_attribute.rb @@ -7,12 +7,15 @@ RSpec.configure do |config| CounterAttributeModel.class_eval do include CounterAttribute + after_initialize { self.allow_package_size_counter = true } + counter_attribute :build_artifacts_size counter_attribute :commit_count + counter_attribute :packages_size, if: ->(instance) { instance.allow_package_size_counter } - attr_accessor :flushed + attr_accessor :flushed, :allow_package_size_counter - counter_attribute_after_flush do |subject| + counter_attribute_after_commit do |subject| subject.flushed = true end end |