diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 000000000..6e649991e --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1 @@ +service_name: travis-ci \ No newline at end of file diff --git a/.gitignore b/.gitignore index 3a1bbd53f..82617c2f4 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ /public/uploads /jetty .byebug_history +/coverage diff --git a/Gemfile b/Gemfile index 5e0179fc6..9712b9411 100644 --- a/Gemfile +++ b/Gemfile @@ -45,14 +45,19 @@ group :development, :test do # Access an IRB console on exception pages or by using <%= console %> in views gem 'web-console', '~> 2.0' - gem 'rspec-rails' - gem 'factory_girl' - gem 'capybara' gem 'database_cleaner' + gem 'rubocop', require: false gem 'rubocop-rspec', require: false end +group :test do + gem 'rspec-rails', require: false + gem 'factory_girl', require: false + gem 'capybara', require: false + gem 'coveralls', require: false +end + group :production do gem 'mysql2', '~> 0.3.20' # See https://github.com/sstephenson/execjs#readme for more supported runtimes diff --git a/Gemfile.lock b/Gemfile.lock index a05121343..8bdb0a394 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -186,6 +186,13 @@ GEM deep_merge (~> 1.0.0) confstruct (1.0.2) hashie (~> 3.3) + coveralls (0.8.9) + json (~> 1.8) + rest-client (>= 1.6.8, < 2) + simplecov (~> 0.10.0) + term-ansicolor (~> 1.3) + thor (~> 0.19.1) + tins (~> 1.6.0) daemons (1.2.3) database_cleaner (1.5.1) debug_inspector (0.0.2) @@ -216,6 +223,9 @@ GEM capistrano-bundle_audit (>= 0.0.3) capistrano-one_time_key capistrano-releaseboard + docile (1.1.5) + domain_name (0.5.25) + unf (>= 0.0.5, < 1.0.0) dor-fetcher (1.0.5) erubis (2.7.0) execjs (2.6.0) @@ -276,6 +286,8 @@ GEM hitimes (1.2.3) hooks (0.4.1) uber (~> 0.0.14) + http-cookie (1.0.2) + domain_name (~> 0.5) i18n (0.7.0) is_it_working-cbeer (1.0.16) iso-639 (0.2.5) @@ -336,6 +348,7 @@ GEM net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (3.0.1) + netrc (0.11.0) nokogiri (1.6.6.3) mini_portile (~> 0.6.0) nom-xml (0.5.4) @@ -400,6 +413,10 @@ GEM request_store (1.2.1) responders (2.1.0) railties (>= 4.2.0, < 5) + rest-client (1.8.0) + http-cookie (>= 1.0.2, < 2.0) + mime-types (>= 1.16, < 3.0) + netrc (~> 0.7) retriable (1.4.1) retries (0.0.5) roar (1.0.3) @@ -457,6 +474,11 @@ GEM faraday (~> 0.9) jwt (~> 1.5) multi_json (~> 1.10) + simplecov (0.10.0) + docile (~> 1.1.0) + json (~> 1.8) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) sir_trevor_rails (0.5.0b1) rails redcarpet (>= 2.0.1, < 4) @@ -501,6 +523,8 @@ GEM stomp (1.3.4) sucker_punch (1.6.0) celluloid (~> 0.17.2) + term-ansicolor (1.3.2) + tins (~> 1.0) test_xml (0.1.7) diffy (~> 3.0) nokogiri (>= 1.3.2) @@ -563,6 +587,7 @@ DEPENDENCIES capybara coffee-rails (~> 4.1.0) config + coveralls database_cleaner delayed_job delayed_job_active_record diff --git a/README.md b/README.md index d3d2c95cb..745f8ec84 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/sul-dlss/sul_exhibits_template.svg)](https://travis-ci.org/sul-dlss/sul_exhibits_template) [![Dependency Status](https://gemnasium.com/sul-dlss/sul_exhibits_template.svg)](https://gemnasium.com/sul-dlss/sul_exhibits_template) +[![Build Status](https://travis-ci.org/sul-dlss/sul_exhibits_template.svg)](https://travis-ci.org/sul-dlss/sul_exhibits_template) [![Coverage Status](https://coveralls.io/repos/sul-dlss/sul_exhibits_template/badge.svg?branch=master&service=github)](https://coveralls.io/github/sul-dlss/sul_exhibits_template?branch=master) [![Dependency Status](https://gemnasium.com/sul-dlss/sul_exhibits_template.svg)](https://gemnasium.com/sul-dlss/sul_exhibits_template) # SUL Spotlight Exhibit template project diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d75f422c5..d693bfd1e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,85 +1,28 @@ -# This file was generated by the `rails generate rspec:install` command. Conventionally, all -# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. -# The generated `.rspec` file contains `--require spec_helper` which will cause this -# file to always be loaded, without a need to explicitly require it in any files. -# -# Given that it is always loaded, you are encouraged to keep this file as -# light-weight as possible. Requiring heavyweight dependencies from this file -# will add to the boot time of your test suite on EVERY test run, even for an -# individual file that may not need all of that loaded. Instead, consider making -# a separate helper file that requires the additional dependencies and performs -# the additional setup, and require it from the spec files that actually need it. -# -# The `.rspec` file also contains a few flags that are not defaults but that -# users commonly want. -# +require 'coveralls' +Coveralls.wear!('rails') + # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration Dir['./spec/support/**/*.rb'].sort.each { |f| require f } RSpec.configure do |config| - # rspec-expectations config goes here. You can use an alternate - # assertion/expectation library such as wrong or the stdlib/minitest - # assertions if you prefer. config.expect_with :rspec do |expectations| - # This option will default to `true` in RSpec 4. It makes the `description` - # and `failure_message` of custom matchers include text for helper methods - # defined using `chain`, e.g.: - # be_bigger_than(2).and_smaller_than(4).description - # # => "be bigger than 2 and smaller than 4" - # ...rather than: - # # => "be bigger than 2" expectations.include_chain_clauses_in_custom_matcher_descriptions = true end - # rspec-mocks config goes here. You can use an alternate test double - # library (such as bogus or mocha) by changing the `mock_with` option here. config.mock_with :rspec do |mocks| - # Prevents you from mocking or stubbing a method that does not exist on - # a real object. This is generally recommended, and will default to - # `true` in RSpec 4. mocks.verify_partial_doubles = true end - # The settings below are suggested to provide a good initial experience - # with RSpec, but feel free to customize to your heart's content. - # # These two settings work together to allow you to limit a spec run - # # to individual examples or groups you care about by tagging them with - # # `:focus` metadata. When nothing is tagged with `:focus`, all examples - # # get run. - # config.filter_run :focus - # config.run_all_when_everything_filtered = true - # - # # Limits the available syntax to the non-monkey patched syntax that is recommended. - # # For more details, see: - # # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax - # # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ - # # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching - # config.disable_monkey_patching! - # - # # Many RSpec users commonly either run the entire suite or an individual - # # file, and it's useful to allow more verbose output when running an - # # individual spec file. - # if config.files_to_run.one? - # # Use the documentation formatter for detailed output, - # # unless a formatter has already been configured - # # (e.g. via a command-line flag). - # config.default_formatter = 'doc' - # end - # - # # Print the 10 slowest examples and example groups at the - # # end of the spec run, to help surface which specs are running - # # particularly slow. - # config.profile_examples = 10 - # - # # Run specs in random order to surface order dependencies. If you find an - # # order dependency and want to debug it, you can fix the order by providing - # # the seed, which is printed after each run. - # # --seed 1234 - # config.order = :random - # - # # Seed global randomization in this process using the `--seed` CLI option. - # # Setting this allows you to use `--seed` to deterministically reproduce - # # test failures related to randomization by passing the same `--seed` value - # # as the one that triggered the failure. - # Kernel.srand config.seed + if config.files_to_run.one? + config.default_formatter = 'doc' + end + + config.order = :random + + # Limits the available syntax to the non-monkey patched syntax that is recommended. + # For more details, see: + # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax + # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching + # config.disable_monkey_patching! end