Sha256: 3423bfc848d3b59fdcdc8fa30fe380bb8db162e30613fe0384cc3ca5287ede53

Contents?: true

Size: 604 Bytes

Versions: 2

Compression:

Stored size: 604 Bytes

Contents

class Teabag::SpecController < ActionController::Base
  helper Teabag::SpecHelper rescue nil

  layout false

  unless Rails.application.config.assets.debug
    rescue_from Exception, with: :javascript_exception
  end

  def index
    @suite = Teabag::Suite.new(params)
  end

  def fixtures
    prepend_view_path Teabag.configuration.root.join(Teabag.configuration.fixture_path)
    render "/#{params[:filename]}"
  end

  private

  def javascript_exception(exception)
    err  = "#{exception.class.name}: #{exception.message}"
    render text: "<script>throw Error(#{err.inspect})</script>"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
teabag-0.5.1 app/controllers/teabag/spec_controller.rb
teabag-0.5.0 app/controllers/teabag/spec_controller.rb