test_track 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +80 -0
- data/Rakefile +4 -21
- data/app/controllers/test_track/tests_controller.rb +3 -3
- data/app/views/test_track/tests/index.html.erb +7 -7
- data/app/views/test_track/tests/jasmine.html.erb +1 -1
- data/app/views/test_track/tests/qunit.html.erb +9 -9
- data/config/routes.rb +2 -2
- data/lib/test_track/engine.rb +6 -3
- data/lib/test_track/version.rb +1 -1
- data/lib/test_track.rb +15 -19
- data/test/dummy/app/assets/javascripts/application.js +2 -3
- data/test/dummy/app/assets/javascripts/player.js +24 -0
- data/test/dummy/app/assets/javascripts/song.js +7 -0
- data/test/dummy/app/assets/javascripts/test/qunit.js +1 -0
- data/test/dummy/app/views/layouts/application.html.erb +0 -1
- data/test/dummy/config/application.rb +5 -1
- data/test/dummy/config/environments/development.rb +0 -18
- data/test/dummy/config/environments/production.rb +0 -42
- data/test/dummy/config/environments/test.rb +0 -28
- data/test/dummy/config/initializers/test_track.rb +3 -0
- data/test/dummy/config/routes.rb +3 -56
- data/test/dummy/log/development.log +249 -0
- data/test/dummy/spec/javascripts/helpers/spec_helper.js +10 -0
- data/test/dummy/spec/javascripts/jasmine.js +9 -0
- data/test/dummy/spec/javascripts/jasmine_examples/player_spec.js.coffee +48 -0
- data/test/dummy/spec/javascripts/test_spec.js.coffee +10 -0
- data/test/dummy/test/javascripts/qunit_example.js +9 -0
- data/test/dummy/tmp/cache/assets/C73/FE0/sprockets%2F7654c9875816c385ed75764e327456cf +0 -0
- data/test/dummy/tmp/cache/assets/C88/9C0/sprockets%2Ffc16ec1bd513161f2516982931976b88 +0 -0
- data/test/dummy/tmp/cache/assets/CA9/780/sprockets%2F5518381f8130b2f0ab37890446cc8ba5 +0 -0
- data/test/dummy/tmp/cache/assets/CB8/A70/sprockets%2Fd69ece2c66002e6445530b04f499f593 +0 -0
- data/test/dummy/tmp/cache/assets/CBE/430/sprockets%2F94fb0d0924ac757662793e67b9e244b4 +0 -0
- data/test/dummy/tmp/cache/assets/CDE/B50/sprockets%2F65680ea711329a483b5e78a3b218c3ee +0 -0
- data/test/dummy/tmp/cache/assets/CF2/820/sprockets%2Fbf724471a612e0ab5b44b01a34243b8f +0 -0
- data/test/dummy/tmp/cache/assets/CF3/540/sprockets%2F301a41e68e879890297cc5fe1ba8957c +0 -0
- data/test/dummy/tmp/cache/assets/D23/D20/sprockets%2F93ccd58e9bb379d5936bd516573c0a78 +0 -0
- data/test/dummy/tmp/cache/assets/D32/6B0/sprockets%2F4bd8c18d2ae32ac6e81b3d481562d161 +0 -0
- data/test/dummy/tmp/cache/assets/D37/7B0/sprockets%2F17ac92c241725deaf19677d422c6dab2 +0 -0
- data/test/dummy/tmp/cache/assets/D38/DF0/sprockets%2F4942f4adbe676f444da602d82e2311dc +0 -0
- data/test/dummy/tmp/cache/assets/D6C/E80/sprockets%2Fba564427e32c02e612efb85dfb7a839b +0 -0
- data/test/dummy/tmp/cache/assets/D78/AA0/sprockets%2Fd9a7b791fe846bfc2ab15890df1153d8 +0 -0
- data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -0
- data/test/dummy/tmp/cache/assets/D96/660/sprockets%2Fac79fd11b3a84e3e775c1f21cb5dd144 +0 -0
- data/test/dummy/tmp/cache/assets/D9C/520/sprockets%2Ffbcb374b79f13d1a1a004a3c989fb6e9 +0 -0
- data/test/dummy/tmp/cache/assets/D9D/BC0/sprockets%2Fccf044c9045cfad33d48280c3c48ff4e +0 -0
- data/test/dummy/tmp/cache/assets/DA0/DD0/sprockets%2Fa1add25c3825c15cc8a6be5917b96fe6 +0 -0
- data/test/dummy/tmp/cache/assets/DAA/CE0/sprockets%2Fd9d447b38d39c539a841f7bdc62baf4d +0 -0
- data/test/dummy/tmp/cache/assets/DB1/260/sprockets%2Fd6c1c8b4990d7ebc2e5e95388e19daa8 +0 -0
- data/test/dummy/tmp/cache/assets/DC6/9B0/sprockets%2F91ef1ca0ef363be62f4a38fb3fbc2291 +0 -0
- data/test/dummy/tmp/cache/assets/DC7/F00/sprockets%2F6909b9bb5dcd51cf3b18bd01f51efc60 +0 -0
- data/test/dummy/tmp/cache/assets/DDE/D20/sprockets%2Fb8d8382f8065b1cf95e613ceaebcc98f +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E5D/080/sprockets%2F71acf7bcbaf94bbaec8ad7189d3e8c30 +0 -0
- metadata +123 -54
- data/README.rdoc +0 -3
- data/lib/tasks/test_track.rake +0 -4
- data/test/dummy/app/assets/stylesheets/application.css +0 -7
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/inflections.rb +0 -10
- data/test/dummy/config/initializers/mime_types.rb +0 -5
data/README.md
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
# TestTrack
|
2
|
+
|
3
|
+
This gem provides sane defaults for using Javascript test frameworks in
|
4
|
+
the Rails 3.1 Asset Pipeline. It allows you to write and run
|
5
|
+
[Qunit][qunit] or [Jasmine][jasmine] tests while leveraging the new
|
6
|
+
compiling power of Tilt and Sprockets 2. Now enabling more profit when you
|
7
|
+
write your JS tests in CoffeeScript!
|
8
|
+
|
9
|
+
## How it works
|
10
|
+
|
11
|
+
TestTrack is a mountable engine whichs provides routes to
|
12
|
+
Javascript test runners pre-loaded with your application's code and
|
13
|
+
tests. In addition to the test runners, [Sinon.js][sinon] is included
|
14
|
+
for mocking, spies, and XHR faking. It's usage is entirely optional and
|
15
|
+
won't affect pre-existing test suites.
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
In your Rails 3.1 app, just add it to your Gemfile, like this:
|
20
|
+
|
21
|
+
gem "test_track"
|
22
|
+
|
23
|
+
Then create a manifest file named `qunit.js` or `jasmine.js` which
|
24
|
+
requires all of your test code for its respective suite, including
|
25
|
+
any custom helpers.
|
26
|
+
|
27
|
+
// SUITE :: Jasmine
|
28
|
+
// SUITE MANIFEST :: spec/javascripts/jasmine.js
|
29
|
+
// TEST SRC DIR :: spec/javascripts
|
30
|
+
//
|
31
|
+
//= require helpers/spec_helper
|
32
|
+
//= require profile_spec
|
33
|
+
//= require user_spec
|
34
|
+
|
35
|
+
TestTrack automatically adds test paths to your app's asset pipeline.
|
36
|
+
The default locations are...
|
37
|
+
|
38
|
+
* Jasmine - `spec/javascripts`
|
39
|
+
* Qunit - `test/javascripts`
|
40
|
+
|
41
|
+
We would recommend that you place your test manifests in these
|
42
|
+
directories and will look for them there by default. Feel free to place
|
43
|
+
these anywhere else in the asset pipeline, just don't forget to specify
|
44
|
+
its location in an initializer. If it happens to be in the root of an
|
45
|
+
asset directory, no additional configuration is required.
|
46
|
+
|
47
|
+
If you'd like to change a default, such as the name of your Jasmine
|
48
|
+
manifest, try the following in `config/initializers/test_track.rb`:
|
49
|
+
|
50
|
+
TestTrack.setup do |config|
|
51
|
+
config.qunit_manifest = "test/qunit"
|
52
|
+
end
|
53
|
+
|
54
|
+
To see this in action, check out the sample Rails code in `test/dummy`.
|
55
|
+
See `lib/test_track.rb` for all available options.
|
56
|
+
|
57
|
+
Finally, just mount the TestTrack engine in routes.rb.
|
58
|
+
|
59
|
+
mount TestTrack::Engine => "test"
|
60
|
+
|
61
|
+
And you're off the the races. An index is provide with links to the test
|
62
|
+
runners. They would be accessible at `/test/jasmine` and
|
63
|
+
`/test/qunit` in the example above.
|
64
|
+
|
65
|
+
## Production
|
66
|
+
|
67
|
+
Obviously, you may not want to have these routes available if your app
|
68
|
+
is running in `:production`. Give this a try!
|
69
|
+
|
70
|
+
mount TestTrack::Engine => "test" unless Rails.env.production?
|
71
|
+
|
72
|
+
## License
|
73
|
+
|
74
|
+
This project uses the MIT-LICENSE.
|
75
|
+
|
76
|
+
|
77
|
+
[jasmine]: https://github.com/pivotal/jasmine
|
78
|
+
[qunit]: https://github.com/jquery/qunit
|
79
|
+
[sinon]: http://sinonjs.org/
|
80
|
+
|
data/Rakefile
CHANGED
@@ -1,37 +1,20 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
|
+
|
3
|
+
# BUNDLER
|
2
4
|
begin
|
3
5
|
require 'bundler/setup'
|
4
6
|
rescue LoadError
|
5
7
|
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
8
|
end
|
7
|
-
begin
|
8
|
-
require 'rdoc/task'
|
9
|
-
rescue LoadError
|
10
|
-
require 'rdoc/rdoc'
|
11
|
-
require 'rake/rdoctask'
|
12
|
-
RDoc::Task = Rake::RDocTask
|
13
|
-
end
|
14
|
-
|
15
|
-
RDoc::Task.new(:rdoc) do |rdoc|
|
16
|
-
rdoc.rdoc_dir = 'rdoc'
|
17
|
-
rdoc.title = 'TestTrack'
|
18
|
-
rdoc.options << '--line-numbers'
|
19
|
-
rdoc.rdoc_files.include('README.rdoc')
|
20
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
|
-
end
|
22
|
-
|
23
|
-
|
24
|
-
|
25
9
|
Bundler::GemHelper.install_tasks
|
26
10
|
|
11
|
+
# TEST
|
27
12
|
require 'rake/testtask'
|
28
|
-
|
29
13
|
Rake::TestTask.new(:test) do |t|
|
30
14
|
t.libs << 'lib'
|
31
15
|
t.libs << 'test'
|
32
16
|
t.pattern = 'test/**/*_test.rb'
|
33
17
|
t.verbose = false
|
34
18
|
end
|
35
|
-
|
36
|
-
|
37
19
|
task :default => :test
|
20
|
+
|
@@ -1,15 +1,15 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
3
|
<head>
|
4
|
-
|
5
|
-
|
4
|
+
<meta charset="UTF-8" />
|
5
|
+
<title>JS Test Suites</title>
|
6
6
|
</head>
|
7
7
|
<body>
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
<h1>Pick One!</h1>
|
9
|
+
<ul>
|
10
|
+
<li><%= link_to "Jasmine" , :jasmine %></li>
|
11
|
+
<li><%= link_to "QUnit" , :qunit %></li>
|
12
|
+
</ul>
|
13
13
|
</body>
|
14
14
|
</html>
|
15
15
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<%= stylesheet_link_tag "jasmine/jasmine" %>
|
8
8
|
<%= javascript_include_tag "test_track/jasmine_suite" %>
|
9
9
|
|
10
|
-
|
10
|
+
<%= javascript_include_tag TestTrack.application_manifest %>
|
11
11
|
<%= javascript_include_tag TestTrack.jasmine_manifest %>
|
12
12
|
|
13
13
|
<script type="text/javascript">
|
@@ -1,19 +1,19 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
3
|
<head>
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
<meta charset="UTF-8" />
|
5
|
+
<title>QUnit Test Suite</title>
|
6
|
+
<%= stylesheet_link_tag 'qunit/qunit' %>
|
7
7
|
<%= javascript_include_tag 'test_track/qunit_suite' %>
|
8
8
|
<%= javascript_include_tag TestTrack.application_manifest %>
|
9
9
|
<%= javascript_include_tag TestTrack.qunit_manifest %>
|
10
10
|
</head>
|
11
11
|
<body>
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
<h1 id="qunit-header">QUnit Test Suite</h1>
|
13
|
+
<h2 id="qunit-banner"></h2>
|
14
|
+
<div id="qunit-testrunner-toolbar"></div>
|
15
|
+
<h2 id="qunit-userAgent"></h2>
|
16
|
+
<ol id="qunit-tests"></ol>
|
17
|
+
<div id="qunit-fixture">test markup</div>
|
18
18
|
</body>
|
19
19
|
</html>
|
data/config/routes.rb
CHANGED
data/lib/test_track/engine.rb
CHANGED
@@ -1,11 +1,14 @@
|
|
1
|
+
require "rails"
|
2
|
+
require "test_track"
|
3
|
+
|
1
4
|
module TestTrack
|
2
5
|
|
3
6
|
class Engine < Rails::Engine
|
4
7
|
isolate_namespace TestTrack
|
5
8
|
|
6
|
-
initializer :
|
7
|
-
|
8
|
-
|
9
|
+
initializer :setup_test_track do |app|
|
10
|
+
app.assets.append_path "#{app.root}/#{TestTrack.jasmine_path}"
|
11
|
+
app.assets.append_path "#{app.root}/#{TestTrack.qunit_path}"
|
9
12
|
end
|
10
13
|
end
|
11
14
|
|
data/lib/test_track/version.rb
CHANGED
data/lib/test_track.rb
CHANGED
@@ -2,30 +2,26 @@ require 'active_support/core_ext/module/attribute_accessors'
|
|
2
2
|
|
3
3
|
module TestTrack
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
mattr_accessor :jasmine_manifest
|
6
|
+
@@jasmine_manifest = "jasmine"
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
mattr_accessor :qunit_manifest
|
9
|
+
@@qunit_manifest = "qunit"
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
mattr_accessor :application_manifest
|
12
|
+
@@application_manifest = "application"
|
13
13
|
|
14
|
-
|
15
|
-
|
14
|
+
mattr_accessor :jasmine_path
|
15
|
+
@@jasmine_path = "spec/javascripts"
|
16
16
|
|
17
|
-
|
18
|
-
|
17
|
+
mattr_accessor :qunit_path
|
18
|
+
@@qunit_path = "test/javascripts"
|
19
19
|
|
20
|
-
|
21
|
-
|
20
|
+
def self.setup
|
21
|
+
yield self
|
22
|
+
end
|
22
23
|
|
23
|
-
def self.setup
|
24
|
-
@@custom_config = true
|
25
|
-
yield self
|
26
|
-
require 'test_track/engine'
|
27
|
-
end
|
28
|
-
|
29
|
-
require 'test_track/engine' unless @@custom_config
|
30
24
|
end
|
31
25
|
|
26
|
+
require 'test_track/engine'
|
27
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
function Player() {
|
2
|
+
}
|
3
|
+
|
4
|
+
Player.prototype.play = function(song) {
|
5
|
+
this.currentlyPlayingSong = song;
|
6
|
+
this.isPlaying = true;
|
7
|
+
};
|
8
|
+
|
9
|
+
Player.prototype.pause = function() {
|
10
|
+
this.isPlaying = false;
|
11
|
+
};
|
12
|
+
|
13
|
+
Player.prototype.resume = function() {
|
14
|
+
if (this.isPlaying) {
|
15
|
+
throw new Error("song is already playing");
|
16
|
+
}
|
17
|
+
|
18
|
+
this.isPlaying = true;
|
19
|
+
};
|
20
|
+
|
21
|
+
Player.prototype.makeFavorite = function() {
|
22
|
+
console.log(this);
|
23
|
+
this.currentlyPlayingSong.persistFavoriteStatus(true);
|
24
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require qunit_example
|
@@ -1,6 +1,10 @@
|
|
1
1
|
require File.expand_path('../boot', __FILE__)
|
2
2
|
|
3
|
-
require 'rails/all'
|
3
|
+
# require 'rails/all'
|
4
|
+
require 'action_controller/railtie'
|
5
|
+
require 'action_view/railtie'
|
6
|
+
require 'rails/test_unit/railtie'
|
7
|
+
require 'sprockets/railtie'
|
4
8
|
|
5
9
|
Bundler.require
|
6
10
|
require "test_track"
|
@@ -1,27 +1,9 @@
|
|
1
1
|
Dummy::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
3
|
-
|
4
|
-
# In the development environment your application's code is reloaded on
|
5
|
-
# every request. This slows down response time but is perfect for development
|
6
|
-
# since you don't have to restart the web server when you make code changes.
|
7
2
|
config.cache_classes = false
|
8
|
-
|
9
|
-
# Log error messages when you accidentally call methods on nil.
|
10
3
|
config.whiny_nils = true
|
11
|
-
|
12
|
-
# Show full error reports and disable caching
|
13
4
|
config.consider_all_requests_local = true
|
14
5
|
config.action_controller.perform_caching = false
|
15
|
-
|
16
|
-
# Don't care if the mailer can't send
|
17
|
-
config.action_mailer.raise_delivery_errors = false
|
18
|
-
|
19
|
-
# Print deprecation notices to the Rails logger
|
20
6
|
config.active_support.deprecation = :log
|
21
|
-
|
22
|
-
# Only use best-standards-support built into browsers
|
23
7
|
config.action_dispatch.best_standards_support = :builtin
|
24
|
-
|
25
|
-
# Do not compress assets
|
26
8
|
config.assets.compress = false
|
27
9
|
end
|
@@ -1,51 +1,9 @@
|
|
1
1
|
Dummy::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
3
|
-
|
4
|
-
# Code is not reloaded between requests
|
5
2
|
config.cache_classes = true
|
6
|
-
|
7
|
-
# Full error reports are disabled and caching is turned on
|
8
3
|
config.consider_all_requests_local = false
|
9
4
|
config.action_controller.perform_caching = true
|
10
|
-
|
11
|
-
# Disable Rails's static asset server (Apache or nginx will already do this)
|
12
5
|
config.serve_static_assets = false
|
13
|
-
|
14
|
-
# Compress JavaScripts and CSS
|
15
6
|
config.assets.compress = true
|
16
|
-
|
17
|
-
# Specifies the header that your server uses for sending files
|
18
|
-
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
19
|
-
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
20
|
-
|
21
|
-
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
22
|
-
# config.force_ssl = true
|
23
|
-
|
24
|
-
# See everything in the log (default is :info)
|
25
|
-
# config.log_level = :debug
|
26
|
-
|
27
|
-
# Use a different logger for distributed setups
|
28
|
-
# config.logger = SyslogLogger.new
|
29
|
-
|
30
|
-
# Use a different cache store in production
|
31
|
-
# config.cache_store = :mem_cache_store
|
32
|
-
|
33
|
-
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
34
|
-
# config.action_controller.asset_host = "http://assets.example.com"
|
35
|
-
|
36
|
-
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
37
|
-
# config.assets.precompile += %w( search.js )
|
38
|
-
|
39
|
-
# Disable delivery errors, bad email addresses will be ignored
|
40
|
-
# config.action_mailer.raise_delivery_errors = false
|
41
|
-
|
42
|
-
# Enable threaded mode
|
43
|
-
# config.threadsafe!
|
44
|
-
|
45
|
-
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
46
|
-
# the I18n.default_locale when a translation can not be found)
|
47
7
|
config.i18n.fallbacks = true
|
48
|
-
|
49
|
-
# Send deprecation notices to registered listeners
|
50
8
|
config.active_support.deprecation = :notify
|
51
9
|
end
|
@@ -1,39 +1,11 @@
|
|
1
1
|
Dummy::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
3
|
-
|
4
|
-
# The test environment is used exclusively to run your application's
|
5
|
-
# test suite. You never need to work with it otherwise. Remember that
|
6
|
-
# your test database is "scratch space" for the test suite and is wiped
|
7
|
-
# and recreated between test runs. Don't rely on the data there!
|
8
2
|
config.cache_classes = true
|
9
|
-
|
10
|
-
# Configure static asset server for tests with Cache-Control for performance
|
11
3
|
config.serve_static_assets = true
|
12
4
|
config.static_cache_control = "public, max-age=3600"
|
13
|
-
|
14
|
-
# Log error messages when you accidentally call methods on nil
|
15
5
|
config.whiny_nils = true
|
16
|
-
|
17
|
-
# Show full error reports and disable caching
|
18
6
|
config.consider_all_requests_local = true
|
19
7
|
config.action_controller.perform_caching = false
|
20
|
-
|
21
|
-
# Raise exceptions instead of rendering exception templates
|
22
8
|
config.action_dispatch.show_exceptions = false
|
23
|
-
|
24
|
-
# Disable request forgery protection in test environment
|
25
9
|
config.action_controller.allow_forgery_protection = false
|
26
|
-
|
27
|
-
# Tell Action Mailer not to deliver emails to the real world.
|
28
|
-
# The :test delivery method accumulates sent emails in the
|
29
|
-
# ActionMailer::Base.deliveries array.
|
30
|
-
config.action_mailer.delivery_method = :test
|
31
|
-
|
32
|
-
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
33
|
-
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
34
|
-
# like if you have constraints or database-specific column types
|
35
|
-
# config.active_record.schema_format = :sql
|
36
|
-
|
37
|
-
# Print deprecation notices to the stderr
|
38
10
|
config.active_support.deprecation = :stderr
|
39
11
|
end
|
data/test/dummy/config/routes.rb
CHANGED
@@ -1,58 +1,5 @@
|
|
1
1
|
Dummy::Application.routes.draw do
|
2
|
-
#
|
3
|
-
|
4
|
-
|
5
|
-
# Sample of regular route:
|
6
|
-
# match 'products/:id' => 'catalog#view'
|
7
|
-
# Keep in mind you can assign values other than :controller and :action
|
8
|
-
|
9
|
-
# Sample of named route:
|
10
|
-
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
|
11
|
-
# This route can be invoked with purchase_url(:id => product.id)
|
12
|
-
|
13
|
-
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
14
|
-
# resources :products
|
15
|
-
|
16
|
-
# Sample resource route with options:
|
17
|
-
# resources :products do
|
18
|
-
# member do
|
19
|
-
# get 'short'
|
20
|
-
# post 'toggle'
|
21
|
-
# end
|
22
|
-
#
|
23
|
-
# collection do
|
24
|
-
# get 'sold'
|
25
|
-
# end
|
26
|
-
# end
|
27
|
-
|
28
|
-
# Sample resource route with sub-resources:
|
29
|
-
# resources :products do
|
30
|
-
# resources :comments, :sales
|
31
|
-
# resource :seller
|
32
|
-
# end
|
33
|
-
|
34
|
-
# Sample resource route with more complex sub-resources
|
35
|
-
# resources :products do
|
36
|
-
# resources :comments
|
37
|
-
# resources :sales do
|
38
|
-
# get 'recent', :on => :collection
|
39
|
-
# end
|
40
|
-
# end
|
41
|
-
|
42
|
-
# Sample resource route within a namespace:
|
43
|
-
# namespace :admin do
|
44
|
-
# # Directs /admin/products/* to Admin::ProductsController
|
45
|
-
# # (app/controllers/admin/products_controller.rb)
|
46
|
-
# resources :products
|
47
|
-
# end
|
48
|
-
|
49
|
-
# You can have the root of your site routed with "root"
|
50
|
-
# just remember to delete public/index.html.
|
51
|
-
# root :to => 'welcome#index'
|
52
|
-
|
53
|
-
# See how all your routes lay out with "rake routes"
|
54
|
-
|
55
|
-
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
56
|
-
# Note: This route will make all actions in every controller accessible via GET requests.
|
57
|
-
# match ':controller(/:action(/:id(.:format)))'
|
2
|
+
#raise "routes"
|
3
|
+
mount TestTrack::Engine => "js_test"
|
58
4
|
end
|
5
|
+
|