anadea-spark 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/spark/app_builder.rb +8 -0
- data/lib/spark/generators/app_generator.rb +4 -2
- data/lib/spark/version.rb +1 -1
- data/spec/support/spark.rb +1 -1
- data/templates/Gemfile.erb +1 -0
- data/templates/README.md.erb +25 -0
- data/templates/spec/javascripts/application.spec.js +7 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b82af6245f67dc75d86df9c2f193c04306e4cb92
|
4
|
+
data.tar.gz: 8a1cbe9a9d832dfcbe1de9ba8553da88b2c5d610
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a731cd4e1f20d594ea069f00caefef30ddb588ff0b05b64b934323b95ff52d8e7693624ce9620debeed247763d810227a1029696a2d1b5bc8a2030e6ca831a8c
|
7
|
+
data.tar.gz: 34cb2b0125f725e8d7416e97f68c1ce8f297a3a13d1773abeecd767b8f3a8b98f711e1da6fd3e6cbc7da24611919a96292332fec121b5189c33c748788181b90
|
data/README.md
CHANGED
@@ -63,6 +63,8 @@
|
|
63
63
|
тестирования HTML форм.
|
64
64
|
* [RSpec](https://github.com/rspec/rspec) для тестирования.
|
65
65
|
* [RSpec Mocks](https://github.com/rspec/rspec-mocks) для стабов.
|
66
|
+
* [jasmine-rails](https://github.com/searls/jasmine-rails) для юнит
|
67
|
+
тестирования JavaScript кода.
|
66
68
|
* [SimpleCov](https://github.com/colszowka/simplecov) для измерения покрытия
|
67
69
|
кода. Работает при передаче переменной окружения COVERAGE.
|
68
70
|
* [Timecop](https://github.com/jtrupiano/timecop-console) для тестирования с
|
data/lib/spark/app_builder.rb
CHANGED
@@ -174,6 +174,14 @@ module Spark
|
|
174
174
|
copy_file "spec/spec_helper.rb", "spec/spec_helper.rb"
|
175
175
|
end
|
176
176
|
|
177
|
+
def configure_jasmine_rails
|
178
|
+
bundle_command "exec rails generate jasmine_rails:install"
|
179
|
+
end
|
180
|
+
|
181
|
+
def add_jasmine_spec_sample
|
182
|
+
copy_file "spec/javascripts/application.spec.js", "spec/javascripts/application.spec.js"
|
183
|
+
end
|
184
|
+
|
177
185
|
def configure_i18n_for_missing_translations
|
178
186
|
raise_on_missing_translations_in("development")
|
179
187
|
raise_on_missing_translations_in("test")
|
@@ -26,14 +26,14 @@ module Spark
|
|
26
26
|
invoke :setup_secret_token
|
27
27
|
invoke :create_spark_views
|
28
28
|
invoke :configure_app
|
29
|
+
invoke :remove_routes_comment_lines
|
30
|
+
invoke :add_root_route
|
29
31
|
invoke :setup_development_environment
|
30
32
|
invoke :setup_test_environment
|
31
33
|
invoke :setup_production_environment
|
32
34
|
invoke :setup_assets
|
33
35
|
invoke :copy_miscellaneous_files
|
34
36
|
invoke :customize_error_pages
|
35
|
-
invoke :remove_routes_comment_lines
|
36
|
-
invoke :add_root_route
|
37
37
|
invoke :setup_git
|
38
38
|
invoke :setup_database
|
39
39
|
invoke :setup_bundler_audit
|
@@ -77,6 +77,8 @@ module Spark
|
|
77
77
|
build :enable_database_cleaner
|
78
78
|
build :configure_spec_support_features
|
79
79
|
build :configure_action_mailer_in_specs
|
80
|
+
build :configure_jasmine_rails
|
81
|
+
build :add_jasmine_spec_sample
|
80
82
|
end
|
81
83
|
|
82
84
|
def setup_production_environment
|
data/lib/spark/version.rb
CHANGED
data/spec/support/spark.rb
CHANGED
data/templates/Gemfile.erb
CHANGED
data/templates/README.md.erb
CHANGED
@@ -12,3 +12,28 @@ It assumes you have a machine equipped with Ruby, Postgres, etc.
|
|
12
12
|
After setting up, you can run the application using foreman or via regular:
|
13
13
|
|
14
14
|
% bin/rails s
|
15
|
+
|
16
|
+
## Running JavaScript specs from the command line
|
17
|
+
|
18
|
+
If you were to run:
|
19
|
+
|
20
|
+
% RAILS_ENV=test bundle exec rake spec:javascript
|
21
|
+
|
22
|
+
You'd hopefully see something like:
|
23
|
+
|
24
|
+
Running Jasmine specs...
|
25
|
+
|
26
|
+
PASS: 0 tests, 0 failures, 0.001 secs.
|
27
|
+
|
28
|
+
You can filter execution by passing the `SPEC` option as well:
|
29
|
+
|
30
|
+
% RAILS_ENV=test bundle exec rake spec:javascript SPEC=my_test
|
31
|
+
|
32
|
+
If you experience an error at this point, the most likely cause is JavaScript being loaded out of order, or otherwise conflicting with other existing JavaScript in your project. See "Debugging" below.
|
33
|
+
|
34
|
+
## Running from your browser
|
35
|
+
|
36
|
+
Startup your Rails server (ex: `bundle exec rails s`), and navigate to the path you have configured in your routes.rb file (ex: [http://localhost:3000/specs](http://localhost:3000/specs)).
|
37
|
+
The Jasmine spec runner should appear and start running your testsuite instantly.
|
38
|
+
|
39
|
+
For more information about running JavaScript specs visit [https://github.com/searls/jasmine-rails](https://github.com/searls/jasmine-rails)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anadea-spark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- anadea
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04
|
11
|
+
date: 2015-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- templates/config/postgresql_database.yml.erb
|
127
127
|
- templates/config/rails_secrets.yml
|
128
128
|
- templates/dot_gitignore
|
129
|
+
- templates/spec/javascripts/application.spec.js
|
129
130
|
- templates/spec/rails_helper.rb
|
130
131
|
- templates/spec/spec_helper.rb
|
131
132
|
- templates/spec/support/action_mailer.rb
|