X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/effb1b7f4170bb7244c4dfffcbe6134fe00e2bc4..d3700e6201b4b78a70bbb2941572edc985b63c2c:/test/controllers/diary_entry_controller_test.rb diff --git a/test/controllers/diary_entry_controller_test.rb b/test/controllers/diary_entry_controller_test.rb index f95c57d7c..141a86be3 100644 --- a/test/controllers/diary_entry_controller_test.rb +++ b/test/controllers/diary_entry_controller_test.rb @@ -335,7 +335,7 @@ class DiaryEntryControllerTest < ActionController::TestCase # and when not logged in as the user who wrote the entry get :view, :params => { :display_name => entry.user.display_name, :id => entry.id }, - :session => { :user => entry.user } + :session => { :user => create(:user) } assert_response :success assert_template "diary_entry/view" assert_select "title", :text => /Users' diaries | /, :count => 1 @@ -349,9 +349,7 @@ class DiaryEntryControllerTest < ActionController::TestCase assert_select "p", :text => /#{new_body}/, :count => 1 assert_select "abbr[class=geo][title='#{number_with_precision(new_latitude, :precision => 4)}; #{number_with_precision(new_longitude, :precision => 4)}']", :count => 1 # As we're not logged in, check that you cannot edit - assert_select "li[class='hidden show_if_user_#{entry.user.id}']", :count => 1 do - assert_select "a[href='/user/#{ERB::Util.u(entry.user.display_name)}/diary/#{entry.id}/edit']", :text => "Edit this entry", :count => 1 - end + assert_select "a[href='/user/#{ERB::Util.u(entry.user.display_name)}/diary/#{entry.id}/edit']", false end end