summaryrefslogtreecommitdiff
path: root/spec/models/group_label_spec.rb
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-17 17:48:46 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-19 14:58:27 -0200
commit8379fbcd47930320bf4dd6a3ac41c6efd427a91a (patch)
treec7f2f16f69032ae1584837c203d003c6b756ba25 /spec/models/group_label_spec.rb
parentd3b76e832f0afc38e2d0ffdff540c708a74ac26c (diff)
downloadgitlab-ce-8379fbcd47930320bf4dd6a3ac41c6efd427a91a.tar.gz
Add subject to group and projects labels which return group/project
Diffstat (limited to 'spec/models/group_label_spec.rb')
-rw-r--r--spec/models/group_label_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/group_label_spec.rb b/spec/models/group_label_spec.rb
index 92b07a3cd44..85eb889225b 100644
--- a/spec/models/group_label_spec.rb
+++ b/spec/models/group_label_spec.rb
@@ -9,6 +9,14 @@ describe GroupLabel, models: true do
it { is_expected.to validate_presence_of(:group) }
end
+ describe '#subject' do
+ it 'aliases group to subject' do
+ subject = described_class.new(group: build(:group))
+
+ expect(subject.subject).to be(subject.group)
+ end
+ end
+
describe '#to_reference' do
let(:label) { create(:group_label) }