about summary refs log tree commit diff
path: root/spec
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>2017-05-30 01:02:32 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-05-29 18:02:32 +0200
commitc8a226f61c91645b0670630ec95cb60e1d8cdde0 (patch)
treeb7e9044ca6eb75abc27615d8bb31f1782f6a4c38 /spec
parent7a281c477abacc4886e34a0e90ea0b1f489ceaf5 (diff)
Spec HttpHelper (#3416)
Diffstat (limited to 'spec')
-rw-r--r--spec/helpers/http_helper_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/helpers/http_helper_spec.rb b/spec/helpers/http_helper_spec.rb
new file mode 100644
index 000000000..b8e31b8e6
--- /dev/null
+++ b/spec/helpers/http_helper_spec.rb
@@ -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