Commit e113fc9f authored by Felipe Artur's avatar Felipe Artur

Fix spec failures

parent 71312178
...@@ -23,6 +23,7 @@ Issue: ...@@ -23,6 +23,7 @@ Issue:
- weight - weight
- time_estimate - time_estimate
- relative_position - relative_position
- service_desk_reply_to
Event: Event:
- id - id
- target_type - target_type
......
...@@ -117,6 +117,11 @@ describe Project, models: true do ...@@ -117,6 +117,11 @@ describe Project, models: true do
end end
describe '#regenerate_service_desk_key' do describe '#regenerate_service_desk_key' do
before do
allow_any_instance_of(License).to receive(:add_on?).and_call_original
allow_any_instance_of(License).to receive(:add_on?).with('GitLab_ServiceDesk') { true }
end
subject { create(:project) } subject { create(:project) }
it 'leaves it blank by default' do it 'leaves it blank by default' do
......
...@@ -3,8 +3,16 @@ require 'spec_helper' ...@@ -3,8 +3,16 @@ require 'spec_helper'
describe EE::NotificationService do describe EE::NotificationService do
let(:subject) { NotificationService.new } let(:subject) { NotificationService.new }
before do
allow(Notify).to receive(:service_desk_new_note_email)
.with(kind_of(Integer), kind_of(Integer)).and_return(double(deliver_later: true))
allow_any_instance_of(License).to receive(:add_on?).and_call_original
allow_any_instance_of(License).to receive(:add_on?).with('GitLab_ServiceDesk') { true }
end
def should_email! def should_email!
expect(Notify).to receive(:service_desk_new_note_email).with(issue.id, instance_of(Integer)) expect(Notify).to receive(:service_desk_new_note_email).with(issue.id, kind_of(Integer))
end end
def should_not_email! def should_not_email!
...@@ -55,7 +63,7 @@ describe EE::NotificationService do ...@@ -55,7 +63,7 @@ describe EE::NotificationService do
context 'when the license doesn\'t allow service desk' do context 'when the license doesn\'t allow service desk' do
before do before do
expect(Gitlab::EE::ServiceDesk).to receive(:enabled?).and_return(false) expect(EE::Gitlab::ServiceDesk).to receive(:enabled?).and_return(false)
end end
it_should_not_email! it_should_not_email!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment