X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/6027c42ee7b5ac6b36e8a62135d2cf67b3ca8250..d02e4ad461a4c6b41c7e7f0aeb6ce3e577b3424b:/test/controllers/browse_controller_test.rb?ds=inline diff --git a/test/controllers/browse_controller_test.rb b/test/controllers/browse_controller_test.rb index 230a74cb6..40e11a749 100644 --- a/test/controllers/browse_controller_test.rb +++ b/test/controllers/browse_controller_test.rb @@ -1,5 +1,4 @@ require "test_helper" -require "browse_controller" class BrowseControllerTest < ActionController::TestCase ## @@ -41,6 +40,10 @@ class BrowseControllerTest < ActionController::TestCase { :path => "/note/new", :method => :get }, { :controller => "browse", :action => "new_note" } ) + assert_routing( + { :path => "/query", :method => :get }, + { :controller => "browse", :action => "query" } + ) end def test_read_relation @@ -68,8 +71,10 @@ class BrowseControllerTest < ActionController::TestCase end def test_read_changeset + user = create(:user) private_changeset = create(:changeset, :user => create(:user, :data_public => false)) - changeset = create(:changeset) + changeset = create(:changeset, :user => user) + create(:changeset, :user => user) browse_check "changeset", private_changeset.id, "browse/changeset" browse_check "changeset", changeset.id, "browse/changeset" end @@ -219,6 +224,18 @@ class BrowseControllerTest < ActionController::TestCase assert_select ".browse-section.browse-relation", 2 end + def test_new_note + get :new_note + assert_response :success + assert_template "browse/new_note" + end + + def test_query + get :query + assert_response :success + assert_template "browse/query" + end + private # This is a convenience method for most of the above checks