From e5fbce6d76a7c2a42d13156f2208a09a239de880 Mon Sep 17 00:00:00 2001 From: Rafael Reggiani Manzo Date: Mon, 16 Sep 2013 19:44:59 -0300 Subject: [PATCH] Added Konacha for JavaScript unit testing --- Gemfile | 3 +++ Gemfile.lock | 8 ++++++++ config/initializers/konacha.rb | 8 ++++++++ lib/tasks/konacha.rake | 9 +++++++++ spec/javascripts/.keep | 0 5 files changed, 28 insertions(+), 0 deletions(-) create mode 100644 config/initializers/konacha.rb create mode 100644 lib/tasks/konacha.rake create mode 100644 spec/javascripts/.keep diff --git a/Gemfile b/Gemfile index 4910d22..e776471 100644 --- a/Gemfile +++ b/Gemfile @@ -68,6 +68,9 @@ group :development, :test do # Deployment gem 'capistrano' gem 'rvm-capistrano' + + # JavaScript unit tests + gem "konacha", "~> 3.0.0" end # Acceptance tests diff --git a/Gemfile.lock b/Gemfile.lock index 9baca4a..4c36478 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -60,6 +60,7 @@ GEM coffee-script-source execjs coffee-script-source (1.6.3) + colorize (0.5.8) cucumber (1.3.2) builder (>= 2.1.2) diff-lcs (>= 1.1.3) @@ -102,6 +103,12 @@ GEM railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) json (1.8.0) + konacha (3.0.0) + actionpack (>= 3.1, < 5) + capybara + colorize + railties (>= 3.1, < 5) + sprockets libv8 (3.16.14.3) mail (2.5.4) mime-types (~> 1.16) @@ -235,6 +242,7 @@ DEPENDENCIES jbuilder (~> 1.2) jquery-rails kalibro_entities! + konacha (~> 3.0.0) mocha modernizr-rails pg (~> 0.17.0) diff --git a/config/initializers/konacha.rb b/config/initializers/konacha.rb new file mode 100644 index 0000000..57b8a0f --- /dev/null +++ b/config/initializers/konacha.rb @@ -0,0 +1,8 @@ +Konacha.configure do |config| + require 'capybara/poltergeist' + + config.spec_dir = "spec/javascripts" + config.spec_matcher = /_spec\.|_test\./ + config.stylesheets = %w(application) + config.driver = :poltergeist +end if defined?(Konacha) \ No newline at end of file diff --git a/lib/tasks/konacha.rake b/lib/tasks/konacha.rake new file mode 100644 index 0000000..c851b08 --- /dev/null +++ b/lib/tasks/konacha.rake @@ -0,0 +1,9 @@ +namespace :konacha do + task :message do + puts "Running Konacha tests...\n" + end +end + +task 'konacha:run' => 'konacha:message' + +task :default => 'konacha:run' \ No newline at end of file diff --git a/spec/javascripts/.keep b/spec/javascripts/.keep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/spec/javascripts/.keep -- libgit2 0.21.2