We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 21df7e2 commit 776767cCopy full SHA for 776767c
spec/helpers/application_helper_spec.rb
@@ -0,0 +1,16 @@
1
+require 'rails_helper'
2
+
3
+RSpec.describe ApplicationHelper, type: :helper do
4
+ describe '#format_news_title' do
5
+ it '先頭文字が絵文字ならそのまま、そうでなければ 📰 を付与する' do
6
+ {
7
+ '🔔 新着' => '🔔 新着',
8
+ '更新情報' => '📰 更新情報',
9
+ '1つ目のお知らせ' => '📰 1つ目のお知らせ'
10
+ }.each do |input, expected|
11
+ news = double('news', title: input)
12
+ expect(helper.format_news_title(news)).to eq expected
13
+ end
14
15
16
+end
0 commit comments