Sha256: fadb2737a34343d9124a6578e01149d52bb028b9eb0a924fcd0e8e2a3cb79738

Contents?: true

Size: 546 Bytes

Versions: 5

Compression:

Stored size: 546 Bytes

Contents

class EmberTestsController < ActionController::Base
  def index
    render text: test_html_with_corrected_asset_urls, layout: false
  end

  private

  def test_html_with_corrected_asset_urls
    test_html.gsub(%r{assets/}i, "#{asset_prefix}/#{app_name}/")
  end

  def test_html
    tests_index_path.read
  end

  def tests_index_path
    app.tests_path.join("index.html")
  end

  def app
    EmberCLI.get_app(app_name)
  end

  def app_name
    params.fetch(:app_name)
  end

  def asset_prefix
    Rails.configuration.assets.prefix
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ember-cli-rails-0.1.13 app/controllers/ember_tests_controller.rb
ember-cli-rails-0.1.12 app/controllers/ember_tests_controller.rb
ember-cli-rails-0.1.11 app/controllers/ember_tests_controller.rb
ember-cli-rails-0.1.10 app/controllers/ember_tests_controller.rb
ember-cli-rails-0.1.9 app/controllers/ember_tests_controller.rb