summaryrefslogtreecommitdiff
path: root/test/test_helper.rb
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2016-05-25 12:51:47 +0200
committerAzul <azul@riseup.net>2016-05-25 12:51:47 +0200
commitb883fa9e91ffd7c526a17f37df54ef63c5c6a4b8 (patch)
tree2291052d1a0bf5eadae43969aa915af44855a0aa /test/test_helper.rb
parent69f9b2cb51ff3b9fb3de39f657f734e507ccec68 (diff)
rubocop: initialize and use ruby 1.9 hash syntax
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r--test/test_helper.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 7fbe400..d4765bc 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -15,7 +15,7 @@ class Minitest::Test
Nickserver::Config.load
# by default, mock all non-localhost network connections
- WebMock.disable_net_connect!(:allow_localhost => true)
+ WebMock.disable_net_connect!(allow_localhost: true)
end
def file_content(filename)
@@ -35,23 +35,23 @@ class Minitest::Test
end
def stub_sks_vindex_reponse(uid, opts = {})
- options = {:status => 200, :body => ""}.merge(opts)
+ options = {status: 200, body: ""}.merge(opts)
stub_http_request(:get, Nickserver::Config.hkp_url).with(
- :query => {:op => 'vindex', :search => uid, :exact => 'on', :options => 'mr', :fingerprint => 'on'}
+ query: {op: 'vindex', search: uid, exact: 'on', options: 'mr', fingerprint: 'on'}
).to_return(options)
end
def stub_sks_get_reponse(key_id, opts = {})
- options = {:status => 200, :body => ""}.merge(opts)
+ options = {status: 200, body: ""}.merge(opts)
stub_http_request(:get, Nickserver::Config.hkp_url).with(
- :query => {:op => 'get', :search => "0x"+key_id, :exact => 'on', :options => 'mr'}
+ query: {op: 'get', search: "0x"+key_id, exact: 'on', options: 'mr'}
).to_return(options)
end
def stub_couch_response(uid, opts = {})
# can't stub localhost, so set couch_host to anything else
Nickserver::Config.stub :couch_host, 'notlocalhost' do
- options = {:status => 200, :body => ""}.merge(opts)
+ options = {status: 200, body: ""}.merge(opts)
query = "\?key=#{"%22#{uid}%22"}&reduce=false"
stub_http_request(:get, /#{Regexp.escape(Nickserver::Couch::FetchKey.couch_url)}.*#{query}/).to_return(options)
yield