tests: move test/helpers to test/test_helpers.
The Rails convention is for test/helpers to be used for testing the view helpers in app/helpers. We were using it to store certain utility methods instead. Move these to test/test_helpers so that test/helpers can be used for its intended purpose.
This commit is contained in:
23
test/test_helpers/saved_search_test_helper.rb
Normal file
23
test/test_helpers/saved_search_test_helper.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
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
|
||||
Reference in New Issue
Block a user