Commit dc14a890 authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Peter Leitzen

Fix leaky constant in commit entity spec

parent a733c4a6
......@@ -375,7 +375,6 @@ RSpec/LeakyConstantDeclaration:
- 'spec/models/concerns/bulk_insertable_associations_spec.rb'
- 'spec/models/concerns/triggerable_hooks_spec.rb'
- 'spec/models/repository_spec.rb'
- 'spec/serializers/commit_entity_spec.rb'
- 'spec/services/clusters/applications/check_installation_progress_service_spec.rb'
- 'spec/services/clusters/applications/check_uninstall_progress_service_spec.rb'
- 'spec/support/shared_contexts/spam_constants.rb'
......
---
title: Fix leaky constant issue in commit entity spec
merge_request: 32039
author: Rajendra Kadam
type: fixed
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe CommitEntity do
SIGNATURE_HTML = 'TEST'.freeze
let(:signature_html) { 'TEST' }
let(:entity) do
described_class.new(commit, request: request)
......@@ -16,7 +16,7 @@ describe CommitEntity do
before do
render = double('render')
allow(render).to receive(:call).and_return(SIGNATURE_HTML)
allow(render).to receive(:call).and_return(signature_html)
allow(request).to receive(:project).and_return(project)
allow(request).to receive(:render).and_return(render)
......@@ -83,7 +83,7 @@ describe CommitEntity do
it 'exposes "signature_html"' do
expect(request.render).to receive(:call)
expect(subject.fetch(:signature_html)).to be SIGNATURE_HTML
expect(subject.fetch(:signature_html)).to be signature_html
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