]> cat aescling's git repositories - mastodon.git/commitdiff
Spec HttpHelper (#3416)
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
Mon, 29 May 2017 16:02:32 +0000 (01:02 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 29 May 2017 16:02:32 +0000 (18:02 +0200)
spec/helpers/http_helper_spec.rb [new file with mode: 0644]

diff --git a/spec/helpers/http_helper_spec.rb b/spec/helpers/http_helper_spec.rb
new file mode 100644 (file)
index 0000000..b8e31b8
--- /dev/null
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+describe HttpHelper do
+  describe 'http_client' do
+    it 'returns HTTP::Client with default options' do
+      options = helper.http_client.default_options
+      expect(options.headers['User-Agent']).to match /.+ \(Mastodon\/.+;\ \+http:\/\/cb6e6126\.ngrok\.io\/\)/
+      expect(options.timeout_options).to eq read_timeout: 10, write_timeout: 10, connect_timeout: 10
+    end
+  end
+end