Merge remote-tracking branch 'upstream/pull/2280'
This commit is contained in:
commit
a66c34991a
5 changed files with 60 additions and 1 deletions
34
test/controllers/api/versions_controller_test.rb
Normal file
34
test/controllers/api/versions_controller_test.rb
Normal file
|
@ -0,0 +1,34 @@
|
|||
require "test_helper"
|
||||
|
||||
module Api
|
||||
class VersionsControllerTest < ActionController::TestCase
|
||||
##
|
||||
# test all routes which lead to this controller
|
||||
def test_routes
|
||||
assert_routing(
|
||||
{ :path => "/api/versions", :method => :get },
|
||||
{ :controller => "api/versions", :action => "show" }
|
||||
)
|
||||
assert_recognizes(
|
||||
{ :controller => "api/versions", :action => "show" },
|
||||
{ :path => "/api/versions", :method => :get }
|
||||
)
|
||||
end
|
||||
|
||||
def test_versions
|
||||
get :show
|
||||
assert_response :success
|
||||
assert_select "osm[generator='#{Settings.generator}']", :count => 1 do
|
||||
assert_select "api", :count => 1 do
|
||||
assert_select "version", Settings.api_version
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_no_version_in_root_element
|
||||
get :show
|
||||
assert_response :success
|
||||
assert_select "osm[version]", :count => 0
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue