Files
danbooru/test/helpers/saved_search_test_helper.rb
r888888888 d9a26975ba fix tests
2017-03-15 16:08:47 -07:00

24 lines
624 B
Ruby

module SavedSearchTestHelper
def mock_saved_search_service!
mock_sqs_service = Class.new do
def initialize
@commands = []
end
def commands
@commands
end
def send_message(msg)
@commands << msg.split(/\n/).first
end
end
service = mock_sqs_service.new
SavedSearch.stubs(:sqs_service).returns(service)
Danbooru.config.stubs(:aws_sqs_saved_search_url).returns("http://localhost:3002")
Danbooru.config.stubs(:listbooru_auth_key).returns("blahblahblah")
Danbooru.config.stubs(:listbooru_server).returns("http://localhost:3001")
end
end