about summary refs log tree commit diff
path: root/spec/helpers
diff options
context:
space:
mode:
authorkibigo! <marrus-sh@users.noreply.github.com>2017-07-15 14:33:15 -0700
committerkibigo! <marrus-sh@users.noreply.github.com>2017-07-15 14:33:15 -0700
commit09cfc079b0958c42fe619e2d88c3f9fd1d7c7900 (patch)
tree156de790a5bec0fdf050e392bee8a64b220d3a9d /spec/helpers
parent08d021916db9e350259b925d7e562aa13ba37422 (diff)
parent695439775eacea081c7257aabab39d0ec6b492dc (diff)
Merge upstream (#81)
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/activitystreams2_builder_helper_spec.rb15
-rw-r--r--spec/helpers/emoji_helper_spec.rb15
-rw-r--r--spec/helpers/http_helper_spec.rb13
-rw-r--r--spec/helpers/routing_helper.rb5
4 files changed, 15 insertions, 33 deletions
diff --git a/spec/helpers/activitystreams2_builder_helper_spec.rb b/spec/helpers/activitystreams2_builder_helper_spec.rb
deleted file mode 100644
index 612ce6ad2..000000000
--- a/spec/helpers/activitystreams2_builder_helper_spec.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-require 'rails_helper'
-
-describe Activitystreams2BuilderHelper, type: :helper do
-  it 'returns display name if present' do
-    account = Fabricate(:account, display_name: 'display name', username: 'username')
-    expect(account_name(account)).to eq 'display name'
-  end
-
-  it 'returns username if display name is not present' do
-    account = Fabricate(:account, display_name: '', username: 'username')
-    expect(account_name(account)).to eq 'username'
-  end
-end
diff --git a/spec/helpers/emoji_helper_spec.rb b/spec/helpers/emoji_helper_spec.rb
new file mode 100644
index 000000000..1eedfb719
--- /dev/null
+++ b/spec/helpers/emoji_helper_spec.rb
@@ -0,0 +1,15 @@
+require 'rails_helper'
+
+RSpec.describe EmojiHelper, type: :helper do
+  describe '#emojify' do
+    it 'converts shortcodes to unicode' do
+      text = ':book: Book'
+      expect(emojify(text)).to eq '📖 Book'
+    end
+
+    it 'does not convert shortcodes that are part of a string into unicode' do
+      text = ':see_no_evil::hear_no_evil::speak_no_evil:'
+      expect(emojify(text)).to eq text
+    end
+  end
+end
diff --git a/spec/helpers/http_helper_spec.rb b/spec/helpers/http_helper_spec.rb
deleted file mode 100644
index b8e31b8e6..000000000
--- a/spec/helpers/http_helper_spec.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# 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
diff --git a/spec/helpers/routing_helper.rb b/spec/helpers/routing_helper.rb
deleted file mode 100644
index 3cd397397..000000000
--- a/spec/helpers/routing_helper.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-require 'rails_helper'
-
-RSpec.describe RoutingHelper, type: :helper do
-
-end