Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/presenters/issue_presenter_spec.rb')
-rw-r--r--spec/presenters/issue_presenter_spec.rb20
1 files changed, 18 insertions, 2 deletions
diff --git a/spec/presenters/issue_presenter_spec.rb b/spec/presenters/issue_presenter_spec.rb
index 07a9f8015e9..6c971a55e74 100644
--- a/spec/presenters/issue_presenter_spec.rb
+++ b/spec/presenters/issue_presenter_spec.rb
@@ -73,8 +73,8 @@ RSpec.describe IssuePresenter do
end
end
- describe '#project_emails_disabled?' do
- subject { presenter.project_emails_disabled? }
+ describe '#parent_emails_disabled?' do
+ subject { presenter.parent_emails_disabled? }
it 'returns false when emails notifications is enabled for project' do
is_expected.to be(false)
@@ -87,6 +87,22 @@ RSpec.describe IssuePresenter do
it { is_expected.to be(true) }
end
+
+ context 'for group-level issue' do
+ let(:presented_issue) { create(:issue, :group_level, namespace: group) }
+
+ it 'returns false when email notifications are enabled for group' do
+ is_expected.to be(false)
+ end
+
+ context 'when email notifications are disabled for group' do
+ before do
+ allow(group).to receive(:emails_disabled?).and_return(true)
+ end
+
+ it { is_expected.to be(true) }
+ end
+ end
end
describe '#service_desk_reply_to' do