Commit 33d94b77 authored by Sean McGivern's avatar Sean McGivern

Make RuboCop happy

parent aebffaae
......@@ -6,21 +6,6 @@ describe Gitlab::Email::Handler, lib: true do
stub_config_setting(host: 'localhost')
end
let(:email_raw) { fixture_file('emails/service_desk.eml') }
let(:email_raw) { fixture_file('emails/valid_new_issue.eml') }
let(:email_raw) { fixture_file('emails/valid_reply.eml') }
let(:email_raw) { fixture_file('emails/valid_reply.eml').gsub(mail_key, "#{mail_key}+unsubscribe") }
let!(:project) { create(:empty_project) }
let!(:user) do
create(
:user,
email: 'jake@adventuretime.ooo',
incoming_email_token: 'auth_token'
)
end
describe '.for' do
def handler_for(fixture, mail_key)
described_class.for(fixture_file(fixture), mail_key)
......@@ -31,7 +16,6 @@ describe Gitlab::Email::Handler, lib: true 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').and_return(true)
expect(handler_for('emails/service_desk.eml', 'service_desk+auth_token')).to be_instance_of(Gitlab::Email::Handler::EE::ServiceDeskHandler)
end
......@@ -39,12 +23,13 @@ describe Gitlab::Email::Handler, lib: true 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').and_return(false)
expect(handler_for('emails/service_desk.eml', 'service_desk+auth_token')).to be_instance_of(Gitlab::Email::Handler::CreateIssueHandler)
end
end
context 'a new issue email' do
let!(:user) { create(:user, email: 'jake@adventuretime.ooo', incoming_email_token: 'auth_token') }
it 'uses the create issue handler when Service Desk is enabled' 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').and_return(true)
......@@ -56,7 +41,6 @@ describe Gitlab::Email::Handler, lib: true 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').and_return(false)
expect(handler_for('emails/valid_new_issue.eml', 'incoming+auth_token')).to be_instance_of(Gitlab::Email::Handler::CreateIssueHandler)
end
end
......
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