Commit 4e37833e authored by Albert Salim's avatar Albert Salim

Fix flaky test due to memoization

`ReleaseHighlight.file_paths` memoizes @file_paths
in a class instance variable. As a result, when this
class method is called across tests, the value persists
and subsequent tests would fail.
parent c6c1dd31
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe ReleaseHighlight do
RSpec.describe ReleaseHighlight, :clean_gitlab_redis_cache do
let(:fixture_dir_glob) { Dir.glob(File.join('spec', 'fixtures', 'whats_new', '*.yml')).grep(/\d*\_(\d*\_\d*)\.yml$/) }
before do
......
......@@ -2,7 +2,11 @@
require 'spec_helper'
RSpec.describe WhatsNewController do
RSpec.describe WhatsNewController, :clean_gitlab_redis_cache do
after do
ReleaseHighlight.instance_variable_set(:@file_paths, nil)
end
describe 'whats_new_path' do
let(:item) { double(:item) }
let(:highlights) { double(:highlight, items: [item], map: [item].map, next_page: 2) }
......
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