]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/notes_controller_test.rb
Move browse#new_note to notes#new
[rails.git] / test / controllers / notes_controller_test.rb
index 1450aced88275bec8b6e02c90199d81ba7469a43..4032b538d66603831a3d7d752d5c1f11cc0868e5 100644 (file)
@@ -15,6 +15,11 @@ class NotesControllerTest < ActionDispatch::IntegrationTest
       { :path => "/user/username/notes", :method => :get },
       { :controller => "notes", :action => "index", :display_name => "username" }
     )
+
+    assert_routing(
+      { :path => "/note/new", :method => :get },
+      { :controller => "notes", :action => "new" }
+    )
   end
 
   def test_index_success
@@ -73,4 +78,17 @@ class NotesControllerTest < ActionDispatch::IntegrationTest
     assert_response :success
     assert_select "table.note_list tr", :count => 11
   end
+
+  def test_empty_page
+    user = create(:user)
+    get user_notes_path(:display_name => user.display_name)
+    assert_response :success
+    assert_select "h4", :html => "No notes"
+  end
+
+  def test_new_note
+    get new_note_path
+    assert_response :success
+    assert_template "notes/new"
+  end
 end