Class: QunitForRails::QunitTestsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/qunit_for_rails/qunit_tests_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/qunit_for_rails/qunit_tests_controller.rb', line 6

def index
  test_files = []
  
  Dir.glob(::Rails.root.to_s + "/public/javascripts/test/*").each { |file| 
    if file.end_with?('_test.js')
      test_files << file.split('/').last
    end
  }
  
  render :index, :locals => { :test_files => test_files, :root_url => ENV['RAILS_RELATIVE_URL_ROOT'] }
end