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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 60d203e147f739fb5e026bf127e677cfba019599
4
- data.tar.gz: 3bb6d2250ac6e83727cf8e2bc9b478f2b5e9ebcb
3
+ metadata.gz: b82af6245f67dc75d86df9c2f193c04306e4cb92
4
+ data.tar.gz: 8a1cbe9a9d832dfcbe1de9ba8553da88b2c5d610
5
5
  SHA512:
6
- metadata.gz: 578e8e1e0d2bb3be132b5042fd74bbdc942a109ab940df8fafe8d2234e20d081fae2331e8611f3134c3a29057edd63e1e5abac9cc9bb4c6fee444a5005518022
7
- data.tar.gz: 3fc67766f1cd728ca8f85aba6f1e65dd50fe13aba62134e987e71fd6d741c65525aec37c88d9166a6131c1c619100d6280ed2b978991449857fb9e350f5baf92
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) для тестирования с
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Spark
2
2
  RAILS_VERSION = "4.2.1"
3
3
  RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.2"
5
5
  end
@@ -25,7 +25,7 @@ module TestHelpers
25
25
  if File.exist?(project_path)
26
26
  Dir.chdir(project_path) do
27
27
  Bundler.with_clean_env do
28
- `rake db:drop`
28
+ %x(rake db:drop)
29
29
  end
30
30
  end
31
31
  end
@@ -29,6 +29,7 @@ group :development, :test do
29
29
  gem "factory_girl_rails"
30
30
  gem "pry-rails"
31
31
  gem "rspec-rails", "~> 3.1.0"
32
+ gem "jasmine-rails"
32
33
  end
33
34
 
34
35
  group :test do
@@ -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)
@@ -0,0 +1,7 @@
1
+ //= require application
2
+
3
+ describe("application", function() {
4
+ it("uses unobtrusive scripting adapter for jQuery", function() {
5
+ expect($.rails).toBeDefined();
6
+ });
7
+ });
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.1
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-17 00:00:00.000000000 Z
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