X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/01b84a810703041bc4a5011068214c92de0a5bec..53aa7259bb0612eb48a17d0b954ad71ea37d87a4:/test/controllers/diary_entries_controller_test.rb?ds=sidebyside diff --git a/test/controllers/diary_entries_controller_test.rb b/test/controllers/diary_entries_controller_test.rb index 45fe4add1..b1e9b72f2 100644 --- a/test/controllers/diary_entries_controller_test.rb +++ b/test/controllers/diary_entries_controller_test.rb @@ -273,7 +273,7 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest get edit_diary_entry_path(:display_name => entry.user.display_name, :id => 9999) assert_response :not_found assert_select "div.content-heading", :count => 1 do - assert_select "h2", :text => "No entry with the id: 9999", :count => 1 + assert_select "h1", :text => "No entry with the id: 9999", :count => 1 end # Now pass the id, and check that you can edit it, when using the same @@ -314,12 +314,12 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest get diary_entry_path(:display_name => entry.user.display_name, :id => entry) assert_response :success assert_template "show" - assert_select "title", :text => /Users' diaries | /, :count => 1 + assert_select "title", :text => /Users' Diaries | /, :count => 1 assert_select "div.content-heading", :count => 1 do - assert_select "h2", :text => /#{entry.user.display_name}'s diary/, :count => 1 + assert_select "h1", :text => /#{entry.user.display_name}'s Diary/, :count => 1 end assert_select "div#content", :count => 1 do - assert_select "div.post_heading", :text => /#{new_title}/, :count => 1 + assert_select "h2", :text => /#{new_title}/, :count => 1 # This next line won't work if the text has been run through the htmlize function # due to formatting that could be introduced assert_select "p", :text => /#{new_body}/, :count => 1 @@ -334,12 +334,12 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest get diary_entry_path(:display_name => entry.user.display_name, :id => entry) assert_response :success assert_template "show" - assert_select "title", :text => /Users' diaries | /, :count => 1 + assert_select "title", :text => /Users' Diaries | /, :count => 1 assert_select "div.content-heading", :count => 1 do - assert_select "h2", :text => /#{entry.user.display_name}'s diary/, :count => 1 + assert_select "h1", :text => /#{entry.user.display_name}'s Diary/, :count => 1 end assert_select "div#content", :count => 1 do - assert_select "div.post_heading", :text => /#{new_title}/, :count => 1 + assert_select "h2", :text => /#{new_title}/, :count => 1 # This next line won't work if the text has been run through the htmlize function # due to formatting that could be introduced assert_select "p", :text => /#{new_body}/, :count => 1 @@ -374,7 +374,7 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest post comment_diary_entry_path(:display_name => entry.user.display_name, :id => 9999) assert_response :not_found assert_select "div.content-heading", :count => 1 do - assert_select "h2", :text => "No entry with the id: 9999", :count => 1 + assert_select "h1", :text => "No entry with the id: 9999", :count => 1 end # Now try an invalid comment with an empty body @@ -848,9 +848,7 @@ class DiaryEntriesControllerTest < ActionDispatch::IntegrationTest get diary_comments_path(:display_name => user.display_name) assert_response :success assert_template :comments - assert_select "table.table-striped" do - assert_select "tr", :count => 1 # header, no comments - end + assert_select "h4", :html => "No diary comments" # Test a user with a comment create(:diary_comment, :user => other_user)