diff options
Diffstat (limited to 'spec/services/issues/import_csv_service_spec.rb')
-rw-r--r-- | spec/services/issues/import_csv_service_spec.rb | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/spec/services/issues/import_csv_service_spec.rb b/spec/services/issues/import_csv_service_spec.rb index aa43892a36d..92b88489af9 100644 --- a/spec/services/issues/import_csv_service_spec.rb +++ b/spec/services/issues/import_csv_service_spec.rb @@ -18,9 +18,7 @@ describe Issues::ImportCsvService do let(:file) { fixture_file_upload('spec/fixtures/banana_sample.gif') } it 'returns invalid file error' do - expect_next_instance_of(Notify) do |instance| - expect(instance).to receive(:import_issues_csv_email) - end + expect(Notify).to receive_message_chain(:import_issues_csv_email, :deliver_later) expect(subject[:success]).to eq(0) expect(subject[:parse_error]).to eq(true) @@ -31,9 +29,7 @@ describe Issues::ImportCsvService do let(:file) { fixture_file_upload('spec/fixtures/csv_gitlab_export.csv') } it 'imports the CSV without errors' do - expect_next_instance_of(Notify) do |instance| - expect(instance).to receive(:import_issues_csv_email) - end + expect(Notify).to receive_message_chain(:import_issues_csv_email, :deliver_later) expect(subject[:success]).to eq(4) expect(subject[:error_lines]).to eq([]) @@ -54,9 +50,7 @@ describe Issues::ImportCsvService do let(:file) { fixture_file_upload('spec/fixtures/csv_comma.csv') } it 'imports CSV without errors' do - expect_next_instance_of(Notify) do |instance| - expect(instance).to receive(:import_issues_csv_email) - end + expect(Notify).to receive_message_chain(:import_issues_csv_email, :deliver_later) expect(subject[:success]).to eq(3) expect(subject[:error_lines]).to eq([]) @@ -77,9 +71,7 @@ describe Issues::ImportCsvService do let(:file) { fixture_file_upload('spec/fixtures/csv_tab.csv') } it 'imports CSV with some error rows' do - expect_next_instance_of(Notify) do |instance| - expect(instance).to receive(:import_issues_csv_email) - end + expect(Notify).to receive_message_chain(:import_issues_csv_email, :deliver_later) expect(subject[:success]).to eq(2) expect(subject[:error_lines]).to eq([3]) @@ -100,9 +92,7 @@ describe Issues::ImportCsvService do let(:file) { fixture_file_upload('spec/fixtures/csv_semicolon.csv') } it 'imports CSV with a blank row' do - expect_next_instance_of(Notify) do |instance| - expect(instance).to receive(:import_issues_csv_email) - end + expect(Notify).to receive_message_chain(:import_issues_csv_email, :deliver_later) expect(subject[:success]).to eq(3) expect(subject[:error_lines]).to eq([4]) |