Sha256: d4b69f04ee8696cd9cc4c4648af883ce4a7ec82a8a0028c02a15793cb1bb6f6e

Contents?: true

Size: 720 Bytes

Versions: 1

Compression:

Stored size: 720 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 suites
    @suites = Teabag.configuration.suites.keys.map { |suite| Teabag::Suite.new(suite: suite) }
  end

  def runner
    @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

1 entries across 1 versions & 1 rubygems

Version Path
teabag-0.5.2 app/controllers/teabag/spec_controller.rb