Browse Source

feat: update flaky tests (#2352)

pull/2357/head
natdeanlewissoftwire 9 months ago committed by GitHub
parent
commit
d53c31602d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 28
      spec/lib/tasks/send_missing_addresses_csv_spec.rb
  2. 2
      spec/lib/tasks/update_schemes_and_locations_from_csv_spec.rb

28
spec/lib/tasks/send_missing_addresses_csv_spec.rb

@ -41,7 +41,7 @@ RSpec.describe "correct_addresses" do
it "prints out the jobs enqueued" do it "prints out the jobs enqueued" do
expect(Rails.logger).to receive(:info).with(nil) expect(Rails.logger).to receive(:info).with(nil)
expect(Rails.logger).to receive(:info).with("Sending missing lettings addresses CSV for test organisation to data_coordinator1@example.com, data_coordinator2@example.com") expect(Rails.logger).to receive(:info).with(match(/^Sending missing lettings addresses CSV for test organisation to (?:data_coordinator1@example\.com, data_coordinator2@example\.com|data_coordinator2@example\.com, data_coordinator1@example\.com)$/))
task.invoke task.invoke
end end
end end
@ -60,7 +60,7 @@ RSpec.describe "correct_addresses" do
it "prints out the jobs enqueued" do it "prints out the jobs enqueued" do
expect(Rails.logger).to receive(:info).with(nil) expect(Rails.logger).to receive(:info).with(nil)
expect(Rails.logger).to receive(:info).with("Sending missing lettings addresses CSV for test organisation to data_provider3@example.com, data_provider4@example.com") expect(Rails.logger).to receive(:info).with(match(/^Sending missing lettings addresses CSV for test organisation to (?:data_provider3@example\.com, data_provider4@example\.com|data_provider4@example\.com, data_provider3@example\.com)$/))
task.invoke task.invoke
end end
end end
@ -93,7 +93,7 @@ RSpec.describe "correct_addresses" do
it "prints out the jobs enqueued" do it "prints out the jobs enqueued" do
expect(Rails.logger).to receive(:info).with(nil) expect(Rails.logger).to receive(:info).with(nil)
expect(Rails.logger).to receive(:info).with("Sending missing lettings addresses CSV for test organisation to data_coordinator1@example.com, data_coordinator2@example.com") expect(Rails.logger).to receive(:info).with(match(/^Sending missing lettings addresses CSV for test organisation to (?:data_coordinator1@example\.com, data_coordinator2@example\.com|data_coordinator2@example\.com, data_coordinator1@example\.com)$/))
task.invoke task.invoke
end end
end end
@ -112,7 +112,7 @@ RSpec.describe "correct_addresses" do
it "prints out the jobs enqueued" do it "prints out the jobs enqueued" do
expect(Rails.logger).to receive(:info).with(nil) expect(Rails.logger).to receive(:info).with(nil)
expect(Rails.logger).to receive(:info).with("Sending missing lettings addresses CSV for test organisation to data_provider3@example.com, data_provider4@example.com") expect(Rails.logger).to receive(:info).with(match(/^Sending missing lettings addresses CSV for test organisation to (?:data_provider3@example\.com, data_provider4@example\.com|data_provider4@example\.com, data_provider3@example\.com)$/))
task.invoke task.invoke
end end
end end
@ -145,7 +145,7 @@ RSpec.describe "correct_addresses" do
it "prints out the jobs enqueued" do it "prints out the jobs enqueued" do
expect(Rails.logger).to receive(:info).with(nil) expect(Rails.logger).to receive(:info).with(nil)
expect(Rails.logger).to receive(:info).with("Sending missing lettings addresses CSV for test organisation to data_coordinator1@example.com, data_coordinator2@example.com") expect(Rails.logger).to receive(:info).with(match(/^Sending missing lettings addresses CSV for test organisation to (?:data_coordinator1@example\.com, data_coordinator2@example\.com|data_coordinator2@example\.com, data_coordinator1@example\.com)$/))
task.invoke task.invoke
end end
end end
@ -164,7 +164,7 @@ RSpec.describe "correct_addresses" do
it "prints out the jobs enqueued" do it "prints out the jobs enqueued" do
expect(Rails.logger).to receive(:info).with(nil) expect(Rails.logger).to receive(:info).with(nil)
expect(Rails.logger).to receive(:info).with("Sending missing lettings addresses CSV for test organisation to data_provider3@example.com, data_provider4@example.com") expect(Rails.logger).to receive(:info).with(match(/^Sending missing lettings addresses CSV for test organisation to (?:data_provider3@example\.com, data_provider4@example\.com|data_provider4@example\.com, data_provider3@example\.com)$/))
task.invoke task.invoke
end end
end end
@ -184,7 +184,7 @@ RSpec.describe "correct_addresses" do
it "prints out the jobs enqueued" do it "prints out the jobs enqueued" do
expect(Rails.logger).to receive(:info).with(nil) expect(Rails.logger).to receive(:info).with(nil)
expect(Rails.logger).to receive(:info).with("Sending missing lettings addresses CSV for test organisation to data_provider3@example.com, data_provider4@example.com") expect(Rails.logger).to receive(:info).with(match(/^Sending missing lettings addresses CSV for test organisation to (?:data_provider3@example\.com, data_provider4@example\.com|data_provider4@example\.com, data_provider3@example\.com)$/))
task.invoke task.invoke
end end
end end
@ -262,7 +262,7 @@ RSpec.describe "correct_addresses" do
it "prints out the jobs enqueued" do it "prints out the jobs enqueued" do
expect(Rails.logger).to receive(:info).with(nil) expect(Rails.logger).to receive(:info).with(nil)
expect(Rails.logger).to receive(:info).with("Sending missing sales addresses CSV for test organisation to data_coordinator1@example.com, data_coordinator2@example.com") expect(Rails.logger).to receive(:info).with(match(/^Sending missing sales addresses CSV for test organisation to (?:data_coordinator1@example\.com, data_coordinator2@example\.com|data_coordinator2@example\.com, data_coordinator1@example\.com)$/))
task.invoke task.invoke
end end
end end
@ -281,7 +281,7 @@ RSpec.describe "correct_addresses" do
it "prints out the jobs enqueued" do it "prints out the jobs enqueued" do
expect(Rails.logger).to receive(:info).with(nil) expect(Rails.logger).to receive(:info).with(nil)
expect(Rails.logger).to receive(:info).with("Sending missing sales addresses CSV for test organisation to data_provider3@example.com, data_provider4@example.com") expect(Rails.logger).to receive(:info).with(match(/^Sending missing sales addresses CSV for test organisation to (?:data_provider3@example\.com, data_provider4@example\.com|data_provider4@example\.com, data_provider3@example\.com)$/))
task.invoke task.invoke
end end
end end
@ -314,7 +314,7 @@ RSpec.describe "correct_addresses" do
it "prints out the jobs enqueued" do it "prints out the jobs enqueued" do
expect(Rails.logger).to receive(:info).with(nil) expect(Rails.logger).to receive(:info).with(nil)
expect(Rails.logger).to receive(:info).with("Sending missing sales addresses CSV for test organisation to data_coordinator1@example.com, data_coordinator2@example.com") expect(Rails.logger).to receive(:info).with(match(/^Sending missing sales addresses CSV for test organisation to (?:data_coordinator1@example\.com, data_coordinator2@example\.com|data_coordinator2@example\.com, data_coordinator1@example\.com)$/))
task.invoke task.invoke
end end
end end
@ -333,7 +333,7 @@ RSpec.describe "correct_addresses" do
it "prints out the jobs enqueued" do it "prints out the jobs enqueued" do
expect(Rails.logger).to receive(:info).with(nil) expect(Rails.logger).to receive(:info).with(nil)
expect(Rails.logger).to receive(:info).with("Sending missing sales addresses CSV for test organisation to data_provider3@example.com, data_provider4@example.com") expect(Rails.logger).to receive(:info).with(match(/^Sending missing sales addresses CSV for test organisation to (?:data_provider3@example\.com, data_provider4@example\.com|data_provider4@example\.com, data_provider3@example\.com)$/))
task.invoke task.invoke
end end
end end
@ -366,7 +366,7 @@ RSpec.describe "correct_addresses" do
it "prints out the jobs enqueued" do it "prints out the jobs enqueued" do
expect(Rails.logger).to receive(:info).with(nil) expect(Rails.logger).to receive(:info).with(nil)
expect(Rails.logger).to receive(:info).with("Sending missing sales addresses CSV for test organisation to data_coordinator1@example.com, data_coordinator2@example.com") expect(Rails.logger).to receive(:info).with(match(/^Sending missing sales addresses CSV for test organisation to (?:data_coordinator1@example\.com, data_coordinator2@example\.com|data_coordinator2@example\.com, data_coordinator1@example\.com)$/))
task.invoke task.invoke
end end
end end
@ -385,7 +385,7 @@ RSpec.describe "correct_addresses" do
it "prints out the jobs enqueued" do it "prints out the jobs enqueued" do
expect(Rails.logger).to receive(:info).with(nil) expect(Rails.logger).to receive(:info).with(nil)
expect(Rails.logger).to receive(:info).with("Sending missing sales addresses CSV for test organisation to data_provider3@example.com, data_provider4@example.com") expect(Rails.logger).to receive(:info).with(match(/^Sending missing sales addresses CSV for test organisation to (?:data_provider3@example\.com, data_provider4@example\.com|data_provider4@example\.com, data_provider3@example\.com)$/))
task.invoke task.invoke
end end
end end
@ -405,7 +405,7 @@ RSpec.describe "correct_addresses" do
it "prints out the jobs enqueued" do it "prints out the jobs enqueued" do
expect(Rails.logger).to receive(:info).with(nil) expect(Rails.logger).to receive(:info).with(nil)
expect(Rails.logger).to receive(:info).with("Sending missing sales addresses CSV for test organisation to data_provider3@example.com, data_provider4@example.com") expect(Rails.logger).to receive(:info).with(match(/^Sending missing sales addresses CSV for test organisation to (?:data_provider3@example\.com, data_provider4@example\.com|data_provider4@example\.com, data_provider3@example\.com)$/))
task.invoke task.invoke
end end
end end

2
spec/lib/tasks/update_schemes_and_locations_from_csv_spec.rb

@ -205,7 +205,7 @@ RSpec.describe "bulk_update" do
expect(Rails.logger).to receive(:info).with("Updating scheme S#{schemes[0].id} with sensitive: No") expect(Rails.logger).to receive(:info).with("Updating scheme S#{schemes[0].id} with sensitive: No")
expect(Rails.logger).to receive(:info).with("Updating scheme S#{schemes[0].id} with scheme_type: Direct Access Hostel") expect(Rails.logger).to receive(:info).with("Updating scheme S#{schemes[0].id} with scheme_type: Direct Access Hostel")
expect(Rails.logger).to receive(:info).with("Clearing location and scheme for logs with startdate and scheme S#{schemes[0].id}. Log IDs: ") expect(Rails.logger).to receive(:info).with("Clearing location and scheme for logs with startdate and scheme S#{schemes[0].id}. Log IDs: ")
expect(Rails.logger).to receive(:info).with("Clearing location and scheme for logs without startdate and scheme S#{schemes[0].id}. Log IDs: #{lettings_log.id}, #{lettings_log_4.id}, #{lettings_log_5.id}") expect(Rails.logger).to receive(:info).with(match(/^Clearing location and scheme for logs without startdate and scheme S#{schemes[0].id}\. Log IDs: (?=.*#{lettings_log.id})(?=.*#{lettings_log_4.id})(?=.*#{lettings_log_5.id}).*$/))
expect(Rails.logger).to receive(:info).with("Updating scheme S#{schemes[0].id} with arrangement_type: Another registered stock owner") expect(Rails.logger).to receive(:info).with("Updating scheme S#{schemes[0].id} with arrangement_type: Another registered stock owner")
expect(Rails.logger).to receive(:info).with("Updating scheme S#{schemes[0].id} with primary_client_group: People with drug problems") expect(Rails.logger).to receive(:info).with("Updating scheme S#{schemes[0].id} with primary_client_group: People with drug problems")
expect(Rails.logger).to receive(:info).with("Updating scheme S#{schemes[0].id} with has_other_client_group: No") expect(Rails.logger).to receive(:info).with("Updating scheme S#{schemes[0].id} with has_other_client_group: No")

Loading…
Cancel
Save