Skip to content

Commit

Permalink
Fix tests: Remove usage of before block together with Time.stub
Browse files Browse the repository at this point in the history
  • Loading branch information
rbUUbr authored and davydovanton committed Feb 4, 2021
1 parent 53896ab commit 9a35e03
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## HEAD
* 02.02.2021: Fix tests *Kirill Tatchihin*
* 02.09.2020: Improve dark mode workers table links readability(#160) *V-Gutierrez*
* 25.08.2020: Refactor realtime statistic JS code (#159) *kostadriano*
* 24.08.2020: Fix translation pt-Br start/stop (#153) *brunnohenrique*
Expand Down
9 changes: 1 addition & 8 deletions test/statistic/metrics/cache_keys_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
describe 'for success status' do
let(:metric) { Sidekiq::Statistic::Metric.new('HistoryWorker') }

before do
metric.status = Sidekiq::Statistic::Metric::STATUSES[:success]
end

it 'returns correct key for "status" attribute' do
travel_to Time.new(2021, 1, 17, 14, 00, 00) do
result = Sidekiq::Statistic::Metrics::CacheKeys.new(metric)
Expand All @@ -23,12 +19,9 @@
describe 'for failure status' do
let(:metric) { Sidekiq::Statistic::Metric.new('HistoryWorker') }

before do
metric.status = Sidekiq::Statistic::Metric::STATUSES[:failure]
end

it 'returns correct key for "status" attribute' do
travel_to Time.new(2021, 1, 17, 14, 00, 00) do
metric.fails!
result = Sidekiq::Statistic::Metrics::CacheKeys.new(metric)

assert_equal '2021-01-17:HistoryWorker:failed', result.status
Expand Down

0 comments on commit 9a35e03

Please sign in to comment.