Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/messages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class MessagesController < ApplicationController

# GET /ruby-dev
def index(list_name: nil, yyyymm: nil, q: nil)
yyyymm = yyyymm.to_i
yyyymm = yyyymm&.to_i
if list_name
@list = List.find_by_name list_name

Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ message1:
list_id: 1
list_seq: 123
published_at: 1995-12-21 05:44:05
yyyymm: 199512

message2:
subject: Mail2
Expand All @@ -15,3 +16,4 @@ message2:
list_id: 2
list_seq: 234
published_at: 1997-07-28 14:51:40
yyyymm: 199707
2 changes: 1 addition & 1 deletion test/models/message_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class MessageTest < ActiveSupport::TestCase
Hello, world!
END_OF_BODY
m = Message.from_mail(mail, List.find_by_name('ruby-list'), 1)
assert_equal "Hello, world!\r\n", m.body
assert_equal "Hello, world!\n", m.body

assert_equal DateTime.parse('2005-12-15T19:32:40+09:00'), m.published_at
end
Expand Down
4 changes: 2 additions & 2 deletions test/system/messages_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class MessagesTest < ApplicationSystemTestCase
end

test 'visiting the search page, and searching a message' do
visit root_url
assert_selector "h1", text: "blade.ruby-lang.org"
visit '/ruby-list' # message1 is in ruby-list
assert_selector 'h1', text: 'ruby-list'

fill_in :q, with: @message1.body
click_button 'Search'
Expand Down
Loading