]> git.openstreetmap.org Git - rails.git/blob - test/lib/osm_community_index/resource_backend_test.rb
Add validation for page number passed to notes#index
[rails.git] / test / lib / osm_community_index / resource_backend_test.rb
1 require "test_helper"
2
3 class ResourceBackendTest < ActiveSupport::TestCase
4   def test_valid_url
5     klass = OsmCommunityIndex::ResourceBackend
6
7     assert klass.valid_url?(nil)
8     assert klass.valid_url?("http://example.com")
9     assert klass.valid_url?("mailto:bob@example.com?subject=Foo%20Bar")
10     assert klass.valid_url?("xmpp:osm@jabber.example.org?join")
11
12     assert_not klass.valid_url?("javascript:doSomething()")
13     assert_not klass.valid_url?("foo:[]")
14   end
15 end