test_clients_controller.rb 662 B

12345678910111213141516171819202122
  1. class TestClientsController < ClientsController
  2. before_filter :authenticate_client , :except => [ :home , :index , :test_create ]
  3. def home ; render :text => 'hello' ; end ;
  4. def index ; @clients = Client.all ; @rooms = Room.all ; end ;
  5. def test_create
  6. params[:name] = TEST_CLIENT_NAME
  7. persistent_client = Client.find_by_name (URI.escape TEST_CLIENT_NAME )
  8. duplicate_client = Client.find_by_name (URI.escape TEST_DUP_CLIENT_NAME)
  9. persistent_client.delete if persistent_client.present?
  10. duplicate_client .delete if duplicate_client .present?
  11. create
  12. end
  13. def cron ; Client.cleanup ; render :text => 'ok' ; end ;
  14. end