Fix handling of title when replying to diary entries
This commit is contained in:
parent
fc90b73581
commit
0a86a1ea8d
5 changed files with 30 additions and 4 deletions
18
test/system/diary_entry_test.rb
Normal file
18
test/system/diary_entry_test.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
require "application_system_test_case"
|
||||
|
||||
class DiaryEntryTest < ApplicationSystemTestCase
|
||||
def setup
|
||||
create(:language, :code => "en")
|
||||
@diary_entry = create(:diary_entry)
|
||||
end
|
||||
|
||||
test "reply to diary entry should prefill the message subject" do
|
||||
sign_in_as(create(:user))
|
||||
visit diary_path
|
||||
|
||||
click_on "Reply to this entry"
|
||||
|
||||
assert page.has_content? "Send a new message"
|
||||
assert_equal "Re: #{@diary_entry.title}", page.find_field("Subject").value
|
||||
end
|
||||
end
|
|
@ -150,5 +150,13 @@ module ActiveSupport
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
def sign_in_as(user)
|
||||
stub_hostip_requests
|
||||
visit login_path
|
||||
fill_in "username", :with => user.email
|
||||
fill_in "password", :with => "test"
|
||||
click_on "Login", :match => :first
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue