Changeset 105

Show
Ignore:
Timestamp:
05/15/08 21:49:52 (6 months ago)
Author:
jweiss
Message:

close #80 - Add version info XML action

Location:
trunk
Files:
1 added
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/CHANGELOG.txt

    r101 r105  
    11 
    22SVN 
     3 
     4* Add version info XML action. Provided by Mathias Meyer 
    35 
    46* Update Net::SSH to 1.1.3 
  • trunk/app/controllers/sessions_controller.rb

    r77 r105  
    3030    redirect_back_or_default( home_path ) 
    3131  end 
     32   
     33  def version 
     34    app = OpenStruct.new(:name => "Webistrano", :version => WEBISTRANO_VERSION) 
     35    respond_to do |format| 
     36      format.xml { render :layout => false } 
     37    end 
     38  end 
    3239end 
  • trunk/config/routes.rb

    r87 r105  
    3232  # RESTful auth 
    3333  map.resources :users,:member => {:deployments => :get} 
    34   map.resources :sessions 
     34  map.resources :sessions, :collection => {:version => :get} 
    3535  map.signup '/signup', :controller => 'users', :action => 'new' 
    3636  map.login  '/login', :controller => 'sessions', :action => 'new' 
  • trunk/test/functional/sessions_controller_test.rb

    r1 r105  
    7575  end 
    7676 
     77  def test_should_render_the_version_xml 
     78    get :version 
     79    assert_select "application" do |element| 
     80      assert_select 'name', :text => "Webistrano" 
     81      assert_select 'version', :text => WEBISTRANO_VERSION 
     82    end 
     83  end 
     84   
    7785  protected 
    7886    def auth_token(token)