summaryrefslogtreecommitdiff
path: root/spec/views
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-04-16 09:33:15 +0000
committerFilipa Lacerda <filipa@gitlab.com>2018-04-16 09:33:15 +0000
commitd182f6d16064940803d91c4fe82295766531e8f1 (patch)
tree09ec93e998d5daf54d75a745c164f10e21317e3f /spec/views
parented9971081cf8a192ec6dd28b4dad449082658a85 (diff)
parent3f66736fa9998174b883fa61c28550bfe80f0ad0 (diff)
downloadgitlab-ce-d182f6d16064940803d91c4fe82295766531e8f1.tar.gz
Merge branch 'deprecation-warning-for-dynamic-milestones' into 'master'
Deprecation warning for dynamic milestones Closes #42336 See merge request gitlab-org/gitlab-ce!17505
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/shared/milestones/_top.html.haml.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/views/shared/milestones/_top.html.haml.rb b/spec/views/shared/milestones/_top.html.haml.rb
new file mode 100644
index 00000000000..516d81c87ac
--- /dev/null
+++ b/spec/views/shared/milestones/_top.html.haml.rb
@@ -0,0 +1,35 @@
+require 'spec_helper'
+
+describe 'shared/milestones/_top.html.haml' do
+ set(:group) { create(:group) }
+ let(:project) { create(:project, group: group) }
+ let(:milestone) { create(:milestone, project: project) }
+
+ before do
+ allow(milestone).to receive(:milestones) { [] }
+ end
+
+ it 'renders a deprecation message for a legacy milestone' do
+ allow(milestone).to receive(:legacy_group_milestone?) { true }
+
+ render 'shared/milestones/top', milestone: milestone
+
+ expect(rendered).to have_css('.milestone-deprecation-message')
+ end
+
+ it 'renders a deprecation message for a dashboard milestone' do
+ allow(milestone).to receive(:dashboard_milestone?) { true }
+
+ render 'shared/milestones/top', milestone: milestone
+
+ expect(rendered).to have_css('.milestone-deprecation-message')
+ end
+
+ it 'does not render a deprecation message for a non-legacy and non-dashboard milestone' do
+ assign :group, group
+
+ render 'shared/milestones/top', milestone: milestone
+
+ expect(rendered).not_to have_css('.milestone-deprecation-message')
+ end
+end