Skip to content

Commit

Permalink
[api] make /about public available. it is used for live checks and is…
Browse files Browse the repository at this point in the history
… a route causing minimal load.
  • Loading branch information
adrianschroeter committed Sep 18, 2013
1 parent 664fae7 commit 182ce38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/api/app/controllers/about_controller.rb
@@ -1,6 +1,7 @@
class AboutController < ApplicationController

validate_action :index => {:method => :get, :response => :about}
skip_before_action :extract_user

def index
@api_revision = CONFIG['version'].to_s
Expand Down
10 changes: 7 additions & 3 deletions src/api/test/functional/about_controller_test.rb
Expand Up @@ -2,17 +2,21 @@

class AboutControllerTest < ActionDispatch::IntegrationTest

def setup
def test_about
prepare_request_valid_user
get "/about"
assert_response :success
assert_xml_tag( :tag => "about", :descendant => { :tag => "revision" } )
end
def test_about

def test_about_anonymous
get "/about"
assert_response :success
assert_xml_tag( :tag => "about", :descendant => { :tag => "revision" } )
end

def test_application_controller
prepare_request_valid_user
get "/about?user[asd]=yxc"
assert_response 400
assert_xml_tag( :tag => "status", :attributes => { :code => "invalid_parameter" } )
Expand Down

0 comments on commit 182ce38

Please sign in to comment.