require_relative '../../lib/qaplay_projects'
require_relative '../../lib/localhost_projects'
class ProjectsController < ApplicationController
skip_before_action :verify_authenticity_token, if: :json_request?
skip_before_action :verify_authenticity_token, only: [:project_login]
before_action :validate_session
def initialize
@projects = ENV['RAILS_ENV'] == 'test' ? LocalhostProjects.new : QAPlayProjects.new
end
def list
render :json => projects_list
end
def fetch
project = project_from_id(params['id'])
# TODO: fail if not found
model = project.dup
# add anything interesting here...
render :json => model
end
protected
def projects_list
@projects.projects(@current_session[:user], @current_session[:p4ticket])
end
def project_from_id(id)
index = projects_list.index { |obj| obj['id'] == id }
return projects_list[index] unless index.nil?
end
end
# |
Change |
User |
Description |
Committed |
|
#3
|
16024 |
Doug Scheirer |
Some cloud spec forking, got the mock_raymond to spin up in cloud testing, split normal vs cloud spec output |
|
|
#2
|
15877 |
Doug Scheirer |
Cleanup mock behavior, get create client working again in HWS for cloud |
|
|
#1
|
15851 |
Doug Scheirer |
mock raymond service, rails app development standin for the helix cloud webapp |
|
|