Sha256: a2bd161e32be6224c3c01b1d497d83698483584628e08c38494aad4909cc10af

Contents?: true

Size: 628 Bytes

Versions: 2

Compression:

Stored size: 628 Bytes

Contents

class Teaspoon::SuiteController < ActionController::Base
  before_filter :prepend_fixture_paths

  layout false

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

  def show
    @suite = Teaspoon::Suite.new(params)
  end

  def hook
    hooks = Teaspoon::Suite.new(params).hooks[params[:hook].to_s]
    hooks.each { |hook| hook.call(params[:args]) }
    render nothing: true
  end

  def fixtures
    render template: "/#{params[:filename]}"
  end

  private

  def prepend_fixture_paths
    Teaspoon.configuration.fixture_paths.each do |path|
      prepend_view_path Teaspoon.configuration.root.join(path)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
teaspoon-0.9.1 app/controllers/teaspoon/suite_controller.rb
teaspoon-0.9.0 app/controllers/teaspoon/suite_controller.rb