Sha256: 9c5abed602446914cad35075c876143ed858065d4bd824366dcb281d1bb1af4c

Contents?: true

Size: 800 Bytes

Versions: 4

Compression:

Stored size: 800 Bytes

Contents

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

  layout false

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

  def suites
    @suites = Teaspoon::Suite.all
  end

  def runner
    @javascript_options = {}
    @javascript_options[:instrument] = Teaspoon.configuration.coverage || params[:coverage] == "true"
    @suite = Teaspoon::Suite.new(params)
  end

  def fixtures
    prepend_view_path Teaspoon.configuration.root.join(Teaspoon.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

4 entries across 4 versions & 1 rubygems

Version Path
teaspoon-0.7.7 app/controllers/teaspoon/spec_controller.rb
teaspoon-0.7.6 app/controllers/teaspoon/spec_controller.rb
teaspoon-0.7.5 app/controllers/teaspoon/spec_controller.rb
teaspoon-0.7.4 app/controllers/teaspoon/spec_controller.rb