diff options
Diffstat (limited to 'spec/models/issue_spec.rb')
-rw-r--r-- | spec/models/issue_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index 4221b5e5f7a..fe6f2ac6f4d 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -406,6 +406,22 @@ RSpec.describe Issue do end end + describe '#from_service_desk?' do + subject { issue.from_service_desk? } + + context 'when issue author is support bot' do + let(:issue) { create(:issue, author: ::User.support_bot) } + + it { is_expected.to be_truthy } + end + + context 'when issue author is not support bot' do + let(:issue) { create(:issue) } + + it { is_expected.to be_falsey } + end + end + describe '#suggested_branch_name' do let(:repository) { double } @@ -1002,6 +1018,16 @@ RSpec.describe Issue do end end + describe '.service_desk' do + it 'returns the service desk issue' do + service_desk_issue = create(:issue, author: ::User.support_bot) + regular_issue = create(:issue) + + expect(described_class.service_desk).to include(service_desk_issue) + expect(described_class.service_desk).not_to include(regular_issue) + end + end + it_behaves_like 'throttled touch' do subject { create(:issue, updated_at: 1.hour.ago) } end |