diff --git a/.gitignore b/.gitignore index 8af1da5b..f3bc277a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ tmp/ *.swp .redcar bin/ +coverage diff --git a/Gemfile b/Gemfile index 50f8b79d..75c53643 100644 --- a/Gemfile +++ b/Gemfile @@ -42,10 +42,13 @@ end group :development, :test do gem 'fabrication' gem 'rspec-rails' + gem 'capybara' gem 'cucumber-rails', require: false gem "faker" gem 'pry' gem 'sqlite3' + + end group :production do @@ -53,6 +56,7 @@ group :production do end group :test do + gem "simplecov", :require => false gem "mocha" gem "database_cleaner" gem "launchy" diff --git a/Gemfile.lock b/Gemfile.lock index 7ffccfa5..8424216a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -202,6 +202,10 @@ GEM ffi (~> 1.0.9) multi_json (~> 1.0.4) rubyzip + simplecov (0.7.1) + multi_json (~> 1.0) + simplecov-html (~> 0.7.1) + simplecov-html (0.7.1) slop (2.4.3) sprockets (2.0.4) hike (~> 1.2) @@ -234,6 +238,7 @@ PLATFORMS DEPENDENCIES bson_ext cancan + capybara coffee-rails (~> 3.1.0) cucumber-rails database_cleaner @@ -257,6 +262,7 @@ DEPENDENCIES sass-rails (~> 3.1.0) semantic_menu! simple_form! + simplecov sqlite3 uglifier unicorn diff --git a/features/support/env.rb b/features/support/env.rb index 07737733..78880136 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -3,6 +3,14 @@ # newer version of cucumber-rails. Consider adding your own code to a new file # instead of editing this one. Cucumber will automatically load all features/**/*.rb # files. +# + +require 'simplecov' +SimpleCov.start do + add_filter '/spec/' + add_filter '/config/' + add_filter '/vendor/' +end require 'cucumber/rails' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 79d1f541..9a181a89 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,15 @@ +require 'simplecov' +SimpleCov.start do + add_filter '/config/' + add_filter '/vendor/' + add_filter '/features/' +end + ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' require 'database_cleaner' +require 'capybara/rspec' # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. @@ -28,4 +36,5 @@ config.before(:each) { reset_email } config.include Devise::TestHelpers, :type => :controller + config.include Capybara::DSL end