Commit ae10e20f authored by Lin Jen-Shin's avatar Lin Jen-Shin

Move the test to the correct place

parent fe89acc3
......@@ -16,20 +16,12 @@ describe Banzai::Renderer do
context 'without cache' do
let(:commit) { create(:project, :repository).commit }
let(:object) { fake_object(fresh: false) }
it 'returns cacheless render field' do
expect(renderer).to receive(:cacheless_render_field).with(commit, :title)
renderer.render_field(commit, :title)
end
it "skips database caching on a Geo secondary" do
allow(Gitlab::Geo).to receive(:secondary?).and_return(true)
expect(object).to receive(:refresh_markdown_cache!).with(do_update: false)
expect(renderer.render_field(object, :field)).to eq('field_html')
end
end
context 'with cache' do
......@@ -43,6 +35,13 @@ describe Banzai::Renderer do
is_expected.to eq('field_html')
end
it "skips database caching on a Geo secondary" do
allow(Gitlab::Geo).to receive(:secondary?).and_return(true)
expect(object).to receive(:refresh_markdown_cache!).with(do_update: false)
is_expected.to eq('field_html')
end
end
context 'with an up-to-date cache' do
......
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