Commit 23193ed0 authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'leaky-constant-fix-17' into 'master'

Fix leaky constant in mentionable spec

See merge request gitlab-org/gitlab!32049
parents c20e990d 48dbac23
......@@ -383,8 +383,6 @@ RSpec/LeakyConstantDeclaration:
- 'spec/models/concerns/blocks_json_serialization_spec.rb'
- 'spec/models/concerns/bulk_insert_safe_spec.rb'
- 'spec/models/concerns/bulk_insertable_associations_spec.rb'
- 'spec/models/concerns/mentionable_spec.rb'
- 'spec/models/concerns/reactive_caching_spec.rb'
- 'spec/models/concerns/triggerable_hooks_spec.rb'
- 'spec/models/repository_spec.rb'
- 'spec/policies/merge_request_policy_spec.rb'
......
---
title: Fix leaky constant issue in mentionable spec
merge_request: 32049
author: Rajendra Kadam
type: fixed
......@@ -3,14 +3,17 @@
require 'spec_helper'
describe Mentionable do
class Example
include Mentionable
before do
stub_const('Example', Class.new)
Example.class_eval do
include Mentionable
attr_accessor :project, :message
attr_mentionable :message
attr_accessor :project, :message
attr_mentionable :message
def author
nil
def author
nil
end
end
end
......@@ -28,11 +31,11 @@ describe Mentionable do
end
describe '#any_mentionable_attributes_changed?' do
Message = Struct.new(:text)
message = Struct.new(:text)
let(:mentionable) { Example.new }
let(:changes) do
msg = Message.new('test')
msg = message.new('test')
changes = {}
changes[msg] = ['', 'some message']
......
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