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
5656 # counter合計を計算(/statsとの照合用)
5757 @counter_sum = @dojos . sum { |d | d [ :counter ] }
5858
59- # 年が選択されている場合、統計情報を含むメッセージを設定
59+ # 情報メッセージを設定
6060 if @selected_year
6161 # /statsページと同じ計算方法を使用
6262 # 開設数 = その年に新規開設されたDojoのcounter合計
@@ -72,6 +72,9 @@ def index
7272 display_date = Date . current . strftime ( '%Y年%-m月%-d日' ) if @selected_year == Date . current . year
7373
7474 flash . now [ :inline_info ] = "#{ display_date } 時点のアクティブな道場を表示中<br>(開設数: #{ new_dojos_count } / 合計数: #{ total_dojos_count } )" . html_safe
75+ else
76+ # 全期間表示時の情報メッセージ
77+ flash . now [ :inline_info ] = "全期間の道場を表示中(非アクティブ含む)"
7578 end
7679
7780 respond_to do |format |
Original file line number Diff line number Diff line change 9191 expect ( assigns ( :dojos ) . map { |d | d [ :id ] } ) . to include ( @dojo_2020_inactive . id )
9292 end
9393
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+
94100 it "includes inactive dojos in CSV format" do
95101 get dojos_path ( format : :csv )
96102 csv = CSV . parse ( response . body , headers : true )
You can’t perform that action at this time.
0 commit comments