ember-appkit-rails 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ember/appkit/rails.rb +4 -0
- data/lib/ember/appkit/rails/engine.rb +6 -1
- data/lib/ember/appkit/rails/teaspoon.rb +5 -0
- data/lib/ember/appkit/rails/teaspoon/engine.rb +3 -0
- data/lib/ember/appkit/rails/teaspoon/suite.rb +7 -0
- data/lib/ember/appkit/rails/version.rb +1 -1
- data/lib/ember/appkit/rails/views/teaspoon/spec/_eak_rails.html.erb +10 -0
- data/lib/generators/ember/bootstrap_generator.rb +27 -9
- data/lib/generators/ember/component_generator.rb +2 -2
- data/lib/generators/ember/controller_generator.rb +4 -4
- data/lib/generators/ember/generator_helpers.rb +4 -0
- data/lib/generators/ember/install_generator.rb +150 -0
- data/lib/generators/ember/model_generator.rb +7 -2
- data/lib/generators/ember/resource_generator.rb +1 -1
- data/lib/generators/ember/route_generator.rb +2 -2
- data/lib/generators/ember/scaffold_generator.rb +17 -3
- data/lib/generators/ember/serializer_override.rb +18 -0
- data/lib/generators/ember/view_generator.rb +2 -2
- data/{test/dummy/config/adapters/application.js.es6.erb → lib/generators/templates/adapters/application.es6.erb} +0 -0
- data/lib/generators/templates/application.js.erb +1 -0
- data/lib/generators/templates/{array_controller.js.es6 → array_controller.es6} +0 -0
- data/lib/generators/templates/{component.js.es6 → component.es6} +0 -0
- data/lib/generators/templates/{controller.js.es6 → controller.es6} +0 -0
- data/lib/generators/templates/environment.js.erb +2 -0
- data/lib/generators/templates/environments/development.js.erb +5 -5
- data/lib/generators/templates/environments/production.js.erb +2 -2
- data/lib/generators/templates/environments/test.js.erb +1 -1
- data/lib/generators/templates/initializers/teaspoon.rb +63 -0
- data/lib/generators/templates/{model.js.es6 → model.es6} +0 -0
- data/lib/generators/templates/{object_controller.js.es6 → object_controller.es6} +0 -0
- data/lib/generators/templates/{route.js.es6 → route.es6} +0 -0
- data/lib/generators/templates/{router.js.es6 → router.es6} +0 -0
- data/lib/generators/templates/scaffold/route/{edit.js.es6 → edit.es6} +1 -1
- data/lib/generators/templates/scaffold/route/{index.js.es6 → index.es6} +1 -1
- data/lib/generators/templates/scaffold/route/{new.js.es6 → new.es6} +1 -1
- data/lib/generators/templates/scaffold/route/{show.js.es6 → show.es6} +1 -1
- data/lib/generators/templates/scaffold/template/form.hbs +3 -4
- data/lib/generators/templates/scaffold/template/index.hbs +2 -2
- data/lib/generators/templates/scaffold/template/show.hbs +2 -2
- data/lib/generators/templates/scaffold_controller/controller.rb +2 -2
- data/lib/generators/templates/test/model.es6 +7 -0
- data/lib/generators/templates/test/route.es6 +23 -0
- data/lib/generators/templates/test/teaspoon_env.rb +38 -0
- data/lib/generators/templates/test/test_helper.js +55 -0
- data/lib/generators/templates/{view.js.es6 → view.es6} +0 -0
- data/test/dummy/config/adapters/application.es6.erb +3 -0
- data/test/dummy/config/application.js +1 -0
- data/test/dummy/config/environment.js.erb +2 -0
- data/test/dummy/config/environments/development.js.erb +5 -5
- data/test/dummy/config/environments/production.js.erb +2 -2
- data/test/dummy/config/environments/test.js.erb +1 -1
- data/test/dummy/config/initializers/secret_token.rb +1 -1
- data/test/dummy/config/initializers/teaspoon.rb +63 -0
- data/test/dummy/config/{router.js.es6 → router.es6} +0 -0
- data/test/dummy/log/test.log +71 -8
- data/test/dummy/test/teaspoon_env.rb +38 -0
- data/test/dummy/test/test_helper.js +55 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/{eeb5bd38d1dad0d908461fd114f702bc → 08230536deeb8bca57aa54c1cf9a8a67} +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/0f4e288e1e01cda64059f8f521519f5a +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/{492d1909e24832f58ebca96dade2a876 → 1318d49b0a8b80264cc6d140438953bf} +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/39492898b23538577ff8db562a35fb7c +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/3f9cb5a26b08b9e25de91fe142228ad2 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/4a1d4e32cd7b9fd1c62bfd553ae56051 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/4d3cadf0ab91b4a77adf81282a5550a1 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/{1f15c49a05b13c3a7ee50d2ac3900f38 → 571f65ff5db500e9ad70fc11060270a8} +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/660bc633c8899c6c1b20514637fa0169 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/67afcba9807cd5e57b80b5fdf9f26758 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/{47fb03bce147145961cb3deeafca54d7 → 7190c4707840ff0d7c60920ae9739c79} +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/7ca4966e0a480430a858a7ab74518c75 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/83030d43d9bff738a1a01366d61d7691 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/83af35bb6b852de883a26a9458fd4e3a +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/8adfb5e646dca2c629e5d3dc88e2c2e9 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/9160f792acb62d1f7721c714681fcfe6 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/a6a0d79927cb0ec286aa0afb9812685c +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/bb4a2293175928af3e23c47488077098 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/bf689240392e7355c0de5cfd47272146 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/{66c0ce49a71def0f29dcf0bcaf8fb28d → c4eca8931f39b747ea9f916a3b42d8da} +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/cdbe9110f011148cc7a1f172dc18a883 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/d5a48c6656341c56cac8a8e42bb925a5 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/{d4cb455bee790d041fb3111fb1636531 → d5b1e7219e29c039a8ebb0a4e5b19a2b} +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/{ce7582379ff02bb25cee3ac0486fe1f2 → d5ce5243d4ca4a3739a15e60e3c685ba} +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/de0932670a6c856bc6eda1586fd29061 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/e9abb671d48f6ff2be6ffb463ea652bf +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/{e36a853a1349d7f33f6c0083c05f897b → fb43f1b92235ac87bedc9ac12be00188} +0 -0
- data/test/dummy/tmp/generator_test_output/app/views/{post.js.es6 → post.es6} +0 -0
- data/test/fixtures/vcr_cassettes/fetch_ember_beta.yml +39609 -0
- data/test/fixtures/vcr_cassettes/fetch_ember_canary.yml +41381 -0
- data/test/fixtures/vcr_cassettes/fetch_ember_data_tagged.yml +4283 -0
- data/test/fixtures/vcr_cassettes/fetch_ember_release.yml +38824 -0
- data/test/fixtures/vcr_cassettes/fetch_ember_tagged.yml +29518 -0
- data/test/generators/bootstrap_generator_test.rb +12 -4
- data/test/generators/component_generator_test.rb +6 -6
- data/test/generators/controller_generator_test.rb +5 -5
- data/test/generators/install_generator_test.rb +163 -0
- data/test/generators/model_generator_test.rb +29 -7
- data/test/generators/resource_generator_test.rb +6 -6
- data/test/generators/route_generator_test.rb +1 -1
- data/test/generators/scaffold_generator_test.rb +59 -10
- data/test/generators/serializer_override_test.rb +19 -0
- data/test/generators/view_generator_test.rb +6 -6
- data/test/integration/engine_test.rb +4 -0
- data/test/support/generator_test_support.rb +2 -2
- data/vendor/assets/javascripts/{app.js.es6.erb → app.es6.erb} +3 -1
- data/vendor/assets/javascripts/ember-appkit/index.js +0 -1
- data/vendor/assets/javascripts/ember-appkit/resolver.js +235 -32
- data/vendor/assets/javascripts/fake_xml_http_request.js +473 -0
- data/vendor/assets/javascripts/fakehr.js +52 -0
- data/vendor/assets/javascripts/httpRespond.js +24 -0
- metadata +126 -55
- data/lib/generators/templates/adapter.js.erb +0 -3
- data/test/dummy/tmp/cache/assets/test/sprockets/10fe949cc641775f5630b5dad6deb5fc +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/129b422236f443119233cdb0a4525a06 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/25b8b60341168a02f48dabd2b0aa82ad +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/827fafc13575b345cc572fd041ef1fba +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/83a9a7d15d681a382363d2bccb9528bb +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/de94a60b438eb5bf57653f3a220acd80 +0 -0
- data/vendor/assets/javascripts/ember-appkit/resolver_ext.js +0 -40
@@ -11,8 +11,8 @@ module Ember
|
|
11
11
|
class_option :without_template, :type => :boolean, :default => false, :desc => "Create template for this view"
|
12
12
|
|
13
13
|
def create_view_files
|
14
|
-
file_path = File.join(app_path, 'views', class_path, "#{file_name}.
|
15
|
-
template "view.
|
14
|
+
file_path = File.join(app_path, 'views', class_path, "#{file_name}.es6")
|
15
|
+
template "view.es6", file_path
|
16
16
|
invoke('ember:template', [ name ], options) unless options[:without_template]
|
17
17
|
end
|
18
18
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -4,6 +4,8 @@
|
|
4
4
|
This is useful when using canary versions of Ember to enable
|
5
5
|
feature flags before Ember itself is loaded.
|
6
6
|
|
7
|
+
Example: ENV = { FEATURES: { 'query-params-new': true } };
|
8
|
+
|
7
9
|
See the feature flags guide for details:
|
8
10
|
|
9
11
|
http://emberjs.com/guides/configuring-ember/feature-flags/
|
@@ -2,8 +2,8 @@
|
|
2
2
|
//= require ember
|
3
3
|
//= require ember-data
|
4
4
|
|
5
|
-
config.LOG_ACTIVE_GENERATION = true
|
6
|
-
config.LOG_MODULE_RESOLVER = true
|
7
|
-
config.LOG_TRANSITIONS = true
|
8
|
-
config.LOG_TRANSITIONS_INTERNAL = true
|
9
|
-
config.LOG_VIEW_LOOKUPS = true
|
5
|
+
config.LOG_ACTIVE_GENERATION = true;
|
6
|
+
config.LOG_MODULE_RESOLVER = true;
|
7
|
+
config.LOG_TRANSITIONS = true;
|
8
|
+
config.LOG_TRANSITIONS_INTERNAL = true;
|
9
|
+
config.LOG_VIEW_LOOKUPS = true;
|
@@ -5,10 +5,10 @@
|
|
5
5
|
// For some configuration settings such as API keys,
|
6
6
|
// you should read them from the environment rather
|
7
7
|
// than checking them into version control. See also
|
8
|
-
// the Figaro gem.
|
8
|
+
// the Figaro gem.
|
9
9
|
// Keep in mind that API keys in js are visible to
|
10
10
|
// someone poking in the browser, so never expose
|
11
11
|
// a truly private API key in javascript.
|
12
12
|
// my_api_key = <%= ENV['MY_API_KEY'] %>
|
13
13
|
|
14
|
-
Ember.LOG_VERSION = false
|
14
|
+
Ember.LOG_VERSION = false;
|
@@ -0,0 +1,63 @@
|
|
1
|
+
Teaspoon.setup do |config|
|
2
|
+
# This determines where the Teaspoon routes will be mounted. Changing this to "/jasmine" would allow you to browse to
|
3
|
+
# http://localhost:3000/jasmine to run your tests.
|
4
|
+
config.mount_at = "/teaspoon"
|
5
|
+
|
6
|
+
# This defaults to Rails.root if left nil. If you're testing an engine using a dummy application it can be useful to
|
7
|
+
# set this to your engines root.. E.g. `Teaspoon::Engine.root`
|
8
|
+
config.root = nil
|
9
|
+
|
10
|
+
# These paths are appended to the Rails assets paths (relative to config.root), and by default is an array that you
|
11
|
+
# can replace or add to.
|
12
|
+
config.asset_paths = ["test", "test/stylesheets"]
|
13
|
+
|
14
|
+
# Fixtures are rendered through a standard controller. This means you can use things like HAML or RABL/JBuilder, etc.
|
15
|
+
# to generate fixtures within this path.
|
16
|
+
config.fixture_path = "test/fixtures"
|
17
|
+
|
18
|
+
# You can modify the default suite configuration and create new suites here. Suites can be isolated from one another.
|
19
|
+
# When defining a suite you can provide a name and a block. If the name is left blank, :default is assumed. You can
|
20
|
+
# omit various directives and the defaults will be used.
|
21
|
+
#
|
22
|
+
# To run a specific suite
|
23
|
+
# - in the browser: http://localhost/teaspoon/[suite_name]
|
24
|
+
# - from the command line: rake teaspoon suite=[suite_name]
|
25
|
+
config.suite do |suite|
|
26
|
+
suite.boot_partial = 'eak_rails'
|
27
|
+
|
28
|
+
# You can specify a file matcher and all matching files will be loaded when the suite is run. It's important that these files are serve-able from sprockets.
|
29
|
+
#
|
30
|
+
# Note: Can also be set to nil.
|
31
|
+
suite.matcher = "test/**/*_test.{js,js.coffee,es6,coffee}"
|
32
|
+
|
33
|
+
# Each suite can load a different helper, which can in turn require additional files. This file is loaded before
|
34
|
+
# your tests are loaded, and can be used as a manifest.
|
35
|
+
suite.helper = "test_helper"
|
36
|
+
|
37
|
+
# These are the core Teaspoon javascripts. It's strongly encouraged to include only the base files here. You can
|
38
|
+
# require other support libraries in your test helper, which allows you to change them without having to restart the
|
39
|
+
# server.
|
40
|
+
#
|
41
|
+
# Available frameworks: teaspoon-jasmine, teaspoon-mocha, teaspoon-qunit
|
42
|
+
#
|
43
|
+
# Note: To use the CoffeeScript source files use `"teaspoon/qunit"` etc.
|
44
|
+
suite.javascripts = ["teaspoon-qunit"]
|
45
|
+
|
46
|
+
# If you want to change how Teaspoon looks, or include your own stylesheets you can do that here. The default is the
|
47
|
+
# stylesheet for the HTML reporter.
|
48
|
+
suite.stylesheets = ["teaspoon"]
|
49
|
+
|
50
|
+
# When running coverage reports, you probably want to exclude libraries that you're not <testing.
|
51
|
+
# Accepts an array of filenames or regular expressions. The default is to exclude assets from vendors or gems.
|
52
|
+
suite.no_coverage = [%r{/lib/ruby/gems/}, %r{/vendor/assets/}, %r{/support/}, %r{/(.+)_helper.}]
|
53
|
+
# suite.no_coverage << "jquery.min.js" # excludes jquery from coverage reports
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
# Example suite. Since we're just filtering to files already within the root test/javascripts, these files will also
|
58
|
+
# be run in the default suite -- but can be focused into a more specific suite.
|
59
|
+
#config.suite :targeted do |suite|
|
60
|
+
# suite.matcher = "test/javascripts/targeted/*_test.{js,js.coffee,coffee}"
|
61
|
+
#end
|
62
|
+
|
63
|
+
end if defined?(Teaspoon) && Teaspoon.respond_to?(:setup) # let Teaspoon be undefined outside of development/test/asset groups
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export default Ember.Route.extend({
|
2
2
|
model: function(params) {
|
3
|
-
return this.store.find('<%=
|
3
|
+
return this.store.find('<%= require_name.singularize -%>', params.<%= file_name.singularize -%>_id);
|
4
4
|
},
|
5
5
|
deactivate: function() {
|
6
6
|
var model = this.get('controller.model');
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export default Ember.Route.extend({
|
2
2
|
model: function() {
|
3
|
-
return this.store.createRecord('<%=
|
3
|
+
return this.store.createRecord('<%= require_name.singularize -%>');
|
4
4
|
},
|
5
5
|
deactivate: function() {
|
6
6
|
var model = this.get('controller.model');
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export default Ember.Route.extend({
|
2
2
|
model: function(params) {
|
3
|
-
return this.store.find('<%=
|
3
|
+
return this.store.find('<%= require_name.singularize -%>', params.<%= file_name.singularize -%>_id);
|
4
4
|
},
|
5
5
|
actions: {
|
6
6
|
destroyRecord: function(model) {
|
@@ -1,9 +1,8 @@
|
|
1
1
|
<% attributes.each do |attribute| -%>
|
2
2
|
<div>
|
3
|
-
<label
|
4
|
-
{{input value=<%= attribute[:name].camelize(:lower) -%>}}
|
3
|
+
<label><%= attribute[:name].titleize -%> {{input value=<%= attribute[:name].camelize(:lower) -%> class='<%= file_name.dasherize -%>-<%= attribute[:name].dasherize -%>'}}</label>
|
5
4
|
</div>
|
6
5
|
<% end -%>
|
7
6
|
|
8
|
-
<button type="submit" {{action save this}}>Save</button>
|
9
|
-
<button type="submit" {{action cancel this}}>Cancel</button>
|
7
|
+
<button type="submit" {{action 'save' this}}>Save</button>
|
8
|
+
<button type="submit" {{action 'cancel' this}}>Cancel</button>
|
@@ -10,10 +10,10 @@
|
|
10
10
|
<% end -%>
|
11
11
|
</tr>
|
12
12
|
{{#each}}
|
13
|
-
<tr>
|
13
|
+
<tr class='<%= file_name.dasherize -%>'>
|
14
14
|
<td>{{link-to id '<%= file_name.pluralize -%>.show' this}}</td>
|
15
15
|
<% attributes.each do |attribute| -%>
|
16
|
-
<td>{{<%= attribute[:name] -%>}}</td>
|
16
|
+
<td>{{<%= attribute[:name].camelize(:lower) -%>}}</td>
|
17
17
|
<% end -%>
|
18
18
|
</tr>
|
19
19
|
{{/each}}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<h3>{{id}}</h3>
|
2
2
|
|
3
|
-
<p>{{link-to 'Edit' '<%= file_name.pluralize -%>.edit' this}} <button {{action destroyRecord this}}>Destroy</button></p>
|
3
|
+
<p>{{link-to 'Edit' '<%= file_name.pluralize -%>.edit' this}} <button {{action 'destroyRecord' this}}>Destroy</button></p>
|
4
4
|
|
5
5
|
<ul>
|
6
6
|
<% attributes.each do |attribute| -%>
|
7
|
-
<li><%= attribute[:name].titleize -%>: {{<%= attribute[:name] -%>}}</li>
|
7
|
+
<li class='<%= file_name.dasherize -%>-<%= attribute[:name].dasherize -%>'><%= attribute[:name].titleize -%>: {{<%= attribute[:name].camelize(:lower) -%>}}</li>
|
8
8
|
<% end -%>
|
9
9
|
</ul>
|
@@ -20,7 +20,7 @@ class Api::V<%= api_version %>::<%= controller_class_name %>Controller < Applica
|
|
20
20
|
if @<%= orm_instance.save %>
|
21
21
|
respond_with <%= "@#{singular_table_name}" %>, status: :created, location: [:api, :v<%= api_version %>, <%= "@#{singular_table_name}" %>]
|
22
22
|
else
|
23
|
-
render json: <%= "@#{orm_instance.errors}"
|
23
|
+
render json: { errors: <%= "@#{orm_instance.errors}" %> }, status: :unprocessable_entity
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
@@ -29,7 +29,7 @@ class Api::V<%= api_version %>::<%= controller_class_name %>Controller < Applica
|
|
29
29
|
if @<%= orm_instance.update("#{singular_table_name}_params") %>
|
30
30
|
respond_with <%= "@#{singular_table_name}" %>, status: :ok, location: [:api, :v<%= api_version %>, <%= "@#{singular_table_name}" %>]
|
31
31
|
else
|
32
|
-
render json: <%= "@#{orm_instance.errors}"
|
32
|
+
render json: { errors: <%= "@#{orm_instance.errors}" %> }, status: :unprocessable_entity
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import <%= config[:object] -%> from '<%= app_path -%>/routes/<%= require_name.dasherize.pluralize -%>/<%= config[:action] -%>';
|
2
|
+
|
3
|
+
var route, store;
|
4
|
+
|
5
|
+
module('Unit - <%= config[:object] -%>', {
|
6
|
+
setup: function(){
|
7
|
+
store = {};
|
8
|
+
|
9
|
+
route = <%= config[:object] -%>.create({
|
10
|
+
store: store
|
11
|
+
});
|
12
|
+
},
|
13
|
+
teardown: function(){
|
14
|
+
Ember.run(route, 'destroy');
|
15
|
+
}
|
16
|
+
});
|
17
|
+
|
18
|
+
test('it exist', function(){
|
19
|
+
expect(2);
|
20
|
+
|
21
|
+
ok(route);
|
22
|
+
ok(route instanceof Ember.Route);
|
23
|
+
});
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# This file allows you to override various Teaspoon configuration directives when running from the command line. It is not
|
2
|
+
# required from within the Rails environment, so overriding directives that have been defined within the initializer
|
3
|
+
# is not possible.
|
4
|
+
#
|
5
|
+
# Set RAILS_ROOT and load the environment.
|
6
|
+
ENV["RAILS_ROOT"] = File.expand_path("../../", __FILE__)
|
7
|
+
require File.expand_path("../../config/environment", __FILE__)
|
8
|
+
|
9
|
+
# Provide default configuration.
|
10
|
+
#
|
11
|
+
# You can override various configuration directives defined here by using arguments with the teaspoon command.
|
12
|
+
#
|
13
|
+
# teaspoon --driver=selenium --suppress-log
|
14
|
+
# rake teaspoon DRIVER=selenium SUPPRESS_LOG=false
|
15
|
+
Teaspoon.setup do |config|
|
16
|
+
# Driver / Server
|
17
|
+
#config.driver = "phantomjs" # available: phantomjs, selenium
|
18
|
+
#config.server = nil # defaults to Rack::Server
|
19
|
+
|
20
|
+
# Behaviors
|
21
|
+
#config.server_timeout = 20 # timeout for starting the server
|
22
|
+
#config.server_port = nil # defaults to any open port unless specified
|
23
|
+
#config.fail_fast = true # abort after the first failing suite
|
24
|
+
|
25
|
+
# Output
|
26
|
+
#config.formatters = "dot" # available: dot, tap, tap_y, swayze_or_oprah
|
27
|
+
#config.suppress_log = false # suppress logs coming from console[log/error/debug]
|
28
|
+
#config.color = true
|
29
|
+
|
30
|
+
# Coverage (requires istanbul -- https://github.com/gotwarlost/istanbul)
|
31
|
+
#config.coverage = true
|
32
|
+
#config.coverage_reports = "text,html,cobertura"
|
33
|
+
#config.coverage_output_dir = "coverage"
|
34
|
+
#config.statements_coverage_threshold = 50
|
35
|
+
#config.functions_coverage_threshold = 50
|
36
|
+
#config.branches_coverage_threshold = 50
|
37
|
+
#config.lines_coverage_threshold = 50
|
38
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
// Teaspoon includes some support files, but you can use anything from your own support path too.
|
2
|
+
// require support/sinon
|
3
|
+
// require support/your-support-file
|
4
|
+
//
|
5
|
+
// Deferring execution
|
6
|
+
// If you're using CommonJS, RequireJS or some other asynchronous library you can defer execution. Call Teaspoon.execute()
|
7
|
+
// after everything has been loaded. Simple example of a timeout:
|
8
|
+
//
|
9
|
+
// Teaspoon.defer = true
|
10
|
+
// setTimeout(Teaspoon.execute, 1000)
|
11
|
+
//
|
12
|
+
// Manifest
|
13
|
+
// If you'd rather require your test files manually (to control order for instance) you can disable the suite matcher in
|
14
|
+
// the configuration and use this file as a manifest.
|
15
|
+
//
|
16
|
+
// For more information: http://github.com/modeset/teaspoon
|
17
|
+
//
|
18
|
+
// You can require javascript files here. A good place to start is by
|
19
|
+
// requiring your application.js.
|
20
|
+
//= require application
|
21
|
+
//= require fake_xml_http_request
|
22
|
+
//= require fakehr
|
23
|
+
//= require httpRespond
|
24
|
+
|
25
|
+
Ember.testing = true;
|
26
|
+
|
27
|
+
function exists(selector) {
|
28
|
+
return !!find(selector).length;
|
29
|
+
}
|
30
|
+
|
31
|
+
function getAssertionMessage(actual, expected, message) {
|
32
|
+
return message || QUnit.jsDump.parse(expected) + " expected but was " + QUnit.jsDump.parse(actual);
|
33
|
+
}
|
34
|
+
|
35
|
+
function equal(actual, expected, message) {
|
36
|
+
message = getAssertionMessage(actual, expected, message);
|
37
|
+
QUnit.equal.call(this, actual, expected, message);
|
38
|
+
}
|
39
|
+
|
40
|
+
function strictEqual(actual, expected, message) {
|
41
|
+
message = getAssertionMessage(actual, expected, message);
|
42
|
+
QUnit.strictEqual.call(this, actual, expected, message);
|
43
|
+
}
|
44
|
+
|
45
|
+
window.exists = exists;
|
46
|
+
window.equal = equal;
|
47
|
+
window.strictEqual = strictEqual;
|
48
|
+
|
49
|
+
Ember.Test.registerHelper('shouldHaveElementWithCount',
|
50
|
+
function(app, selector, n, context) {
|
51
|
+
var el = findWithAssert(selector, context);
|
52
|
+
var count = el.length;
|
53
|
+
equal(n, count, "found " + count + " times");
|
54
|
+
}
|
55
|
+
);
|
File without changes
|
@@ -4,6 +4,8 @@
|
|
4
4
|
This is useful when using canary versions of Ember to enable
|
5
5
|
feature flags before Ember itself is loaded.
|
6
6
|
|
7
|
+
Example: ENV = { FEATURES: { 'query-params-new': true } };
|
8
|
+
|
7
9
|
See the feature flags guide for details:
|
8
10
|
|
9
11
|
http://emberjs.com/guides/configuring-ember/feature-flags/
|
@@ -2,8 +2,8 @@
|
|
2
2
|
//= require ember
|
3
3
|
//= require ember-data
|
4
4
|
|
5
|
-
config.LOG_ACTIVE_GENERATION = true
|
6
|
-
config.LOG_MODULE_RESOLVER = true
|
7
|
-
config.LOG_TRANSITIONS = true
|
8
|
-
config.LOG_TRANSITIONS_INTERNAL = true
|
9
|
-
config.LOG_VIEW_LOOKUPS = true
|
5
|
+
config.LOG_ACTIVE_GENERATION = true;
|
6
|
+
config.LOG_MODULE_RESOLVER = true;
|
7
|
+
config.LOG_TRANSITIONS = true;
|
8
|
+
config.LOG_TRANSITIONS_INTERNAL = true;
|
9
|
+
config.LOG_VIEW_LOOKUPS = true;
|
@@ -5,10 +5,10 @@
|
|
5
5
|
// For some configuration settings such as API keys,
|
6
6
|
// you should read them from the environment rather
|
7
7
|
// than checking them into version control. See also
|
8
|
-
// the Figaro gem.
|
8
|
+
// the Figaro gem.
|
9
9
|
// Keep in mind that API keys in js are visible to
|
10
10
|
// someone poking in the browser, so never expose
|
11
11
|
// a truly private API key in javascript.
|
12
12
|
// my_api_key = <%= ENV['MY_API_KEY'] %>
|
13
13
|
|
14
|
-
Ember.LOG_VERSION = false
|
14
|
+
Ember.LOG_VERSION = false;
|
@@ -9,4 +9,4 @@
|
|
9
9
|
|
10
10
|
# Make sure your secret_key_base is kept private
|
11
11
|
# if you're sharing your code publicly.
|
12
|
-
Dummy::Application.config.secret_key_base = '
|
12
|
+
Dummy::Application.config.secret_key_base = '18e06c38c91b6ee15b29a6c2d6425df7b6cccc922b38927f832e784bafeb51e87e24c6322f68be0df79b5fc4e3192ef72f6bf4e0efb0f2c5aa076618d62a0d2f'
|
@@ -0,0 +1,63 @@
|
|
1
|
+
Teaspoon.setup do |config|
|
2
|
+
# This determines where the Teaspoon routes will be mounted. Changing this to "/jasmine" would allow you to browse to
|
3
|
+
# http://localhost:3000/jasmine to run your tests.
|
4
|
+
config.mount_at = "/teaspoon"
|
5
|
+
|
6
|
+
# This defaults to Rails.root if left nil. If you're testing an engine using a dummy application it can be useful to
|
7
|
+
# set this to your engines root.. E.g. `Teaspoon::Engine.root`
|
8
|
+
config.root = nil
|
9
|
+
|
10
|
+
# These paths are appended to the Rails assets paths (relative to config.root), and by default is an array that you
|
11
|
+
# can replace or add to.
|
12
|
+
config.asset_paths = ["test", "test/stylesheets"]
|
13
|
+
|
14
|
+
# Fixtures are rendered through a standard controller. This means you can use things like HAML or RABL/JBuilder, etc.
|
15
|
+
# to generate fixtures within this path.
|
16
|
+
config.fixture_path = "test/fixtures"
|
17
|
+
|
18
|
+
# You can modify the default suite configuration and create new suites here. Suites can be isolated from one another.
|
19
|
+
# When defining a suite you can provide a name and a block. If the name is left blank, :default is assumed. You can
|
20
|
+
# omit various directives and the defaults will be used.
|
21
|
+
#
|
22
|
+
# To run a specific suite
|
23
|
+
# - in the browser: http://localhost/teaspoon/[suite_name]
|
24
|
+
# - from the command line: rake teaspoon suite=[suite_name]
|
25
|
+
config.suite do |suite|
|
26
|
+
suite.boot_partial = 'eak_rails'
|
27
|
+
|
28
|
+
# You can specify a file matcher and all matching files will be loaded when the suite is run. It's important that these files are serve-able from sprockets.
|
29
|
+
#
|
30
|
+
# Note: Can also be set to nil.
|
31
|
+
suite.matcher = "test/**/*_test.{js,js.coffee,es6,coffee}"
|
32
|
+
|
33
|
+
# Each suite can load a different helper, which can in turn require additional files. This file is loaded before
|
34
|
+
# your tests are loaded, and can be used as a manifest.
|
35
|
+
suite.helper = "test_helper"
|
36
|
+
|
37
|
+
# These are the core Teaspoon javascripts. It's strongly encouraged to include only the base files here. You can
|
38
|
+
# require other support libraries in your test helper, which allows you to change them without having to restart the
|
39
|
+
# server.
|
40
|
+
#
|
41
|
+
# Available frameworks: teaspoon-jasmine, teaspoon-mocha, teaspoon-qunit
|
42
|
+
#
|
43
|
+
# Note: To use the CoffeeScript source files use `"teaspoon/qunit"` etc.
|
44
|
+
suite.javascripts = ["teaspoon-qunit"]
|
45
|
+
|
46
|
+
# If you want to change how Teaspoon looks, or include your own stylesheets you can do that here. The default is the
|
47
|
+
# stylesheet for the HTML reporter.
|
48
|
+
suite.stylesheets = ["teaspoon"]
|
49
|
+
|
50
|
+
# When running coverage reports, you probably want to exclude libraries that you're not <testing.
|
51
|
+
# Accepts an array of filenames or regular expressions. The default is to exclude assets from vendors or gems.
|
52
|
+
suite.no_coverage = [%r{/lib/ruby/gems/}, %r{/vendor/assets/}, %r{/support/}, %r{/(.+)_helper.}]
|
53
|
+
# suite.no_coverage << "jquery.min.js" # excludes jquery from coverage reports
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
# Example suite. Since we're just filtering to files already within the root test/javascripts, these files will also
|
58
|
+
# be run in the default suite -- but can be focused into a more specific suite.
|
59
|
+
#config.suite :targeted do |suite|
|
60
|
+
# suite.matcher = "test/javascripts/targeted/*_test.{js,js.coffee,coffee}"
|
61
|
+
#end
|
62
|
+
|
63
|
+
end if defined?(Teaspoon) && Teaspoon.respond_to?(:setup) # let Teaspoon be undefined outside of development/test/asset groups
|