File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ def index
56
56
# counter合計を計算(/statsとの照合用)
57
57
@counter_sum = @dojos . sum { |d | d [ :counter ] }
58
58
59
- # 年が選択されている場合、統計情報を含むメッセージを設定
59
+ # 情報メッセージを設定
60
60
if @selected_year
61
61
# /statsページと同じ計算方法を使用
62
62
# 開設数 = その年に新規開設されたDojoのcounter合計
@@ -72,6 +72,9 @@ def index
72
72
display_date = Date . current . strftime ( '%Y年%-m月%-d日' ) if @selected_year == Date . current . year
73
73
74
74
flash . now [ :inline_info ] = "#{ display_date } 時点のアクティブな道場を表示中<br>(開設数: #{ new_dojos_count } / 合計数: #{ total_dojos_count } )" . html_safe
75
+ else
76
+ # 全期間表示時の情報メッセージ
77
+ flash . now [ :inline_info ] = "全期間の道場を表示中(非アクティブ含む)"
75
78
end
76
79
77
80
respond_to do |format |
Original file line number Diff line number Diff line change 91
91
expect ( assigns ( :dojos ) . map { |d | d [ :id ] } ) . to include ( @dojo_2020_inactive . id )
92
92
end
93
93
94
+ it "displays default message for all periods" do
95
+ get dojos_path ( format : :html )
96
+ expect ( response . body ) . to include ( '全期間の道場を表示中(非アクティブ含む)' )
97
+ expect ( response . body ) . to include ( 'alert-info' )
98
+ end
99
+
94
100
it "includes inactive dojos in CSV format" do
95
101
get dojos_path ( format : :csv )
96
102
csv = CSV . parse ( response . body , headers : true )
You can’t perform that action at this time.
0 commit comments