8cce70730c
* new merge request can be created by sending an email to the specific email address (similar to creating issues by email) * for the first iteration, source branch must be specified in the mail subject, other merge request parameters can not be set yet * user should enable "Receive notifications about your own activity" in user settings to receive a notification about created merge request Part of #32878
17 lines
625 B
Ruby
17 lines
625 B
Ruby
require 'spec_helper'
|
|
|
|
describe Gitlab::Email::Handler do
|
|
describe '.for' do
|
|
it 'picks issue handler if there is not merge request prefix' do
|
|
expect(described_class.for('email', 'project+key')).to be_an_instance_of(Gitlab::Email::Handler::CreateIssueHandler)
|
|
end
|
|
|
|
it 'picks merge request handler if there is merge request key' do
|
|
expect(described_class.for('email', 'project+merge-request+key')).to be_an_instance_of(Gitlab::Email::Handler::CreateMergeRequestHandler)
|
|
end
|
|
|
|
it 'returns nil if no handler is found' do
|
|
expect(described_class.for('email', '')).to be_nil
|
|
end
|
|
end
|
|
end
|