Skip to content

Commit

Permalink
Add jasmine via official jasmine gem
Browse files Browse the repository at this point in the history
* Run `rails g jasmine:install`
* Configure to avoid default phantomjs download
  • Loading branch information
fofr authored and vagrant committed Jul 11, 2014
1 parent d6c9dda commit 04e34a8
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Gemfile
Expand Up @@ -44,6 +44,10 @@ group :development do
gem 'quiet_assets'
end

group :development, :test do
gem 'jasmine', '2.0.2'
end

gem 'logstasher', '0.4.8'

group :test do
Expand Down
8 changes: 8 additions & 0 deletions Gemfile.lock
Expand Up @@ -112,6 +112,12 @@ GEM
rails (>= 3.2.0)
hike (1.2.3)
i18n (0.6.9)
jasmine (2.0.2)
jasmine-core (~> 2.0.0)
phantomjs
rack (>= 1.2.1)
rake
jasmine-core (2.0.0)
journey (1.0.4)
jquery-rails (3.0.4)
railties (>= 3.0, < 5.0)
Expand Down Expand Up @@ -143,6 +149,7 @@ GEM
mini_portile (~> 0.5.0)
null_logger (0.0.1)
orm_adapter (0.5.0)
phantomjs (1.9.7.0)
plek (1.7.0)
poltergeist (1.5.0)
capybara (~> 2.1)
Expand Down Expand Up @@ -268,6 +275,7 @@ DEPENDENCIES
factory_girl_rails (= 4.3.0)
gds-api-adapters (= 7.11.0)
govuk_admin_template (= 1.0.4)
jasmine (= 2.0.2)
json (= 1.7.7)
kaminari (= 0.16.1)
logstasher (= 0.4.8)
Expand Down
Empty file.
124 changes: 124 additions & 0 deletions spec/javascripts/support/jasmine.yml
@@ -0,0 +1,124 @@
# src_files
#
# Return an array of filepaths relative to src_dir to include before jasmine specs.
# Default: []
#
# EXAMPLE:
#
# src_files:
# - lib/source1.js
# - lib/source2.js
# - dist/**/*.js
#
src_files:
- assets/application.js

# stylesheets
#
# Return an array of stylesheet filepaths relative to src_dir to include before jasmine specs.
# Default: []
#
# EXAMPLE:
#
# stylesheets:
# - css/style.css
# - stylesheets/*.css
#
stylesheets:
- assets/application.css

# helpers
#
# Return an array of filepaths relative to spec_dir to include before jasmine specs.
# Default: ["helpers/**/*.js"]
#
# EXAMPLE:
#
# helpers:
# - helpers/**/*.js
#
helpers:
- 'helpers/**/*.js'

# spec_files
#
# Return an array of filepaths relative to spec_dir to include.
# Default: ["**/*[sS]pec.js"]
#
# EXAMPLE:
#
# spec_files:
# - **/*[sS]pec.js
#
spec_files:
- '**/*[sS]pec.js'

# src_dir
#
# Source directory path. Your src_files must be returned relative to this path. Will use root if left blank.
# Default: project root
#
# EXAMPLE:
#
# src_dir: public
#
src_dir:

# spec_dir
#
# Spec directory path. Your spec_files must be returned relative to this path.
# Default: spec/javascripts
#
# EXAMPLE:
#
# spec_dir: spec/javascripts
#
spec_dir:

# spec_helper
#
# Ruby file that Jasmine server will require before starting.
# Returned relative to your root path
# Default spec/javascripts/support/jasmine_helper.rb
#
# EXAMPLE:
#
# spec_helper: spec/javascripts/support/jasmine_helper.rb
#
spec_helper: spec/javascripts/support/jasmine_helper.rb

# boot_dir
#
# Boot directory path. Your boot_files must be returned relative to this path.
# Default: Built in boot file
#
# EXAMPLE:
#
# boot_dir: spec/javascripts/support/boot
#
boot_dir:

# boot_files
#
# Return an array of filepaths relative to boot_dir to include in order to boot Jasmine
# Default: Built in boot file
#
# EXAMPLE
#
# boot_files:
# - '**/*.js'
#
boot_files:

# rack_options
#
# Extra options to be passed to the rack server
# by default, Port and AccessLog are passed.
#
# This is an advanced options, and left empty by default
#
# EXAMPLE
#
# rack_options:
# server: 'thin'

4 changes: 4 additions & 0 deletions spec/javascripts/support/jasmine_helper.rb
@@ -0,0 +1,4 @@
# Prevent PhantomJS auto install, uses PhantomJS already on your path.
Jasmine.configure do |config|
config.prevent_phantom_js_auto_install = true
end

0 comments on commit 04e34a8

Please sign in to comment.