Commit f8c00ca2 authored by Nicolas Dular's avatar Nicolas Dular

Use correct error for non-existing email track

This is changing a `NotImplementedError` to an `ArgumentError` to match
the actual error.
parent 09a37d36
...@@ -27,7 +27,7 @@ module Namespaces ...@@ -27,7 +27,7 @@ module Namespaces
end end
def execute def execute
raise NotImplementedError, "Track #{track} not defined" unless TRACKS.key?(track) raise ArgumentError, "Track #{track} not defined" unless TRACKS.key?(track)
groups_for_track.each_batch do |groups| groups_for_track.each_batch do |groups|
groups.each do |group| groups.each do |group|
......
...@@ -218,7 +218,7 @@ RSpec.describe Namespaces::InProductMarketingEmailsService, '#execute' do ...@@ -218,7 +218,7 @@ RSpec.describe Namespaces::InProductMarketingEmailsService, '#execute' do
stub_const("#{described_class}::TRACKS", { bar: :git_write }) stub_const("#{described_class}::TRACKS", { bar: :git_write })
end end
it { expect { subject }.to raise_error(NotImplementedError, 'Track foo not defined') } it { expect { subject }.to raise_error(ArgumentError, 'Track foo not defined') }
end end
context 'when group is a sub-group' do context 'when group is a sub-group' do
......
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