From 05359e0d72a74adbf646db95cea457967f88eea7 Mon Sep 17 00:00:00 2001 From: Rick Carlino Date: Mon, 9 Mar 2015 05:18:02 -0500 Subject: [PATCH] Add codeclimate test reporter --- .ruby-version | 2 +- .travis.yaml | 4 ++-- Gemfile | 2 +- Gemfile.lock | 3 +++ README.md | 2 +- spec/models/schedule_spec.rb | 6 ++++-- spec/spec_helper.rb | 4 +++- 7 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.ruby-version b/.ruby-version index 7c3272873..ccbccc3dc 100755 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.1.1 \ No newline at end of file +2.2.0 diff --git a/.travis.yaml b/.travis.yaml index 439faaa91..ffe34b1e9 100755 --- a/.travis.yaml +++ b/.travis.yaml @@ -1,6 +1,6 @@ language: ruby rvm: - - 2.1.0 + - 2.2.0 services: - mongodb notifications: @@ -8,4 +8,4 @@ notifications: env: # A 'fake' secret token for use in our CI env. # Don't worry- this isn't the real one. - - SECRET_TOKEN=e815982094c62436066bafc9151f2d33c4a351a776654cb7487476de260a4592 \ No newline at end of file + - SECRET_TOKEN=e815982094c62436066bafc9151f2d33c4a351a776654cb7487476de260a4592 diff --git a/Gemfile b/Gemfile index a945e3de9..4785dfef3 100755 --- a/Gemfile +++ b/Gemfile @@ -48,5 +48,5 @@ group :test do gem 'capybara' gem 'launchy' #save_and_open_page while debugging integration tests. gem 'capybara-angular' # Avoid race conditions in angular integration tests - gem 'coveralls', require: false + gem 'codeclimate-test-reporter', require: nil end diff --git a/Gemfile.lock b/Gemfile.lock index 0378d1438..c134eb4cf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -96,6 +96,8 @@ GEM code_analyzer (0.4.5) sexp_processor code_metrics (0.1.3) + codeclimate-test-reporter (0.4.7) + simplecov (>= 0.7.1, < 1.0.0) coderay (1.1.0) coffee-rails (4.1.0) coffee-script (>= 2.2.0) @@ -338,6 +340,7 @@ DEPENDENCIES active_model_serializers (~> 0.8.3) capybara capybara-angular + codeclimate-test-reporter coffee-rails devise! factory_girl_rails diff --git a/README.md b/README.md index 479e0a7d5..49ce8e834 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![Code Climate](https://codeclimate.com/github/FarmBot/farmbot-web-app.png)](https://codeclimate.com/github/FarmBot/farmbot-web-app) [![Build Status](https://travis-ci.org/FarmBot/farmbot-web-app.svg)](https://travis-ci.org/FarmBot/farmbot-web-app) -# Farmbot Web App +[![Test Coverage](https://codeclimate.com/github/FarmBot/farmbot-web-app/badges/coverage.svg)](https://codeclimate.com/github/FarmBot/farmbot-web-app)# Farmbot Web App This Repo is the Web based side of FarmBot. It allows users to control the device from their web browser. **ITS NOT STABLE. WE ARE IN PRE ALPHA.** diff --git a/spec/models/schedule_spec.rb b/spec/models/schedule_spec.rb index 9d98d3c25..ba699cd76 100644 --- a/spec/models/schedule_spec.rb +++ b/spec/models/schedule_spec.rb @@ -3,8 +3,10 @@ describe Schedule do describe '#calculate_next_occurence' do let(:schedule) { FactoryGirl.create(:schedule) } - it 'indicates next_occurrence' do - expect(schedule.calculate_next_occurence.day).to eq(Date.today.day) + it 'indicates next_occurrence' do\ + actual = schedule.calculate_next_occurence + expected = schedule.schedule.next_occurrence + expect(actual).to eq(expected) end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c13cb4992..4172f756e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,5 @@ +require "codeclimate-test-reporter" +CodeClimate::TestReporter.start require 'simplecov' #Ignore anything with the word 'spec' in it. No need to test your tests. SimpleCov.start do @@ -35,4 +37,4 @@ end # Moped was making the test output buffer look ugly every time the database was # purged. These settings stop that. Mongoid.logger.level = Logger::WARN -Moped.logger.level = Logger::WARN \ No newline at end of file +Moped.logger.level = Logger::WARN