support pool version archive
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
require 'test_helper'
|
||||
|
||||
class BulkUpdateRequestsHelperTest < ActionView::TestCase
|
||||
end
|
||||
26
test/helpers/pool_archive_test_helper.rb
Normal file
26
test/helpers/pool_archive_test_helper.rb
Normal file
@@ -0,0 +1,26 @@
|
||||
module PoolArchiveTestHelper
|
||||
def mock_pool_archive_service!
|
||||
mock_sqs_service = Class.new do
|
||||
def send_message(msg)
|
||||
_, json = msg.split(/\n/)
|
||||
json = JSON.parse(json)
|
||||
prev = PoolArchive.where(pool_id: json["pool_id"]).order("id desc").first
|
||||
if prev && prev.updater_ip_addr.to_s == json["updater_ip_addr"]
|
||||
prev.update_columns(json)
|
||||
else
|
||||
PoolArchive.create(json)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
PoolArchive.stubs(:sqs_service).returns(mock_sqs_service.new)
|
||||
end
|
||||
|
||||
def start_pool_archive_transaction
|
||||
PoolArchive.connection.begin_transaction joinable: false
|
||||
end
|
||||
|
||||
def rollback_pool_archive_transaction
|
||||
PoolArchive.connection.rollback_transaction
|
||||
end
|
||||
end
|
||||
@@ -1,4 +0,0 @@
|
||||
require 'test_helper'
|
||||
|
||||
class SavedSearchesHelperTest < ActionView::TestCase
|
||||
end
|
||||
Reference in New Issue
Block a user