Sha256: 39ba128c38e59adc6d69d232a94f902d1a47786e141e9f78736de8b4c6f7d442
Contents?: true
Size: 1.08 KB
Versions: 15
Compression:
Stored size: 1.08 KB
Contents
module Inferno module Web module Controllers module TestSessions class ClientShow < Controller CLIENT_PAGE = ERB.new( File.read( File.join( Inferno::Application.root, 'lib', 'inferno', 'apps', 'web', 'index.html.erb' ) ) ).result.freeze def handle(req, res) test_session_id = req.params[:id] test_suite_id = req.params[:test_suite_id] test_session = repo.find(test_session_id) halt 404 if test_session.nil? if test_suite_id.blank? || test_suite_id != test_session.test_suite_id test_suite_id = test_session.test_suite_id res.redirect_to "#{Inferno::Application['base_url']}/#{test_suite_id}/#{test_session_id}" end test_suite = Inferno::Repositories::TestSuites.new.find(test_suite_id) halt 404 if test_suite.nil? res.format = :html res.body = CLIENT_PAGE end end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems