diff options
author | Luke Bennett <lukeeeebennettplus@gmail.com> | 2018-03-05 14:11:51 +0300 |
---|---|---|
committer | Luke Bennett <lukeeeebennettplus@gmail.com> | 2018-03-05 14:11:51 +0300 |
commit | eab81682b62eee96f14dd7391203627ea714a41d (patch) | |
tree | 6192b07ccba2dc8c9efdf30980ab1670c4d1afc2 /spec/views/shared | |
parent | c647787bc3d16f6bcc24e02eea2a5b3aad76f51c (diff) |
Add view spec for top
Diffstat (limited to 'spec/views/shared')
-rw-r--r-- | spec/views/shared/milestones/_top.html.haml.rb | 35 |
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..50efe1d5377 --- /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 + let(: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 |