Merge branch 'dev' of gitmaco:Growstuff/growstuff into photo_concern

This commit is contained in:
Mackenzie Morgan
2016-11-30 09:44:36 -05:00
4 changed files with 7 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ before_install:
- phantomjs --version
before_script:
- bundle exec rake db:create db:migrate db:test:prepare
- bundle exec rake assets:precompile
script:
- bundle exec rubocop --display-cop-names --rails
- script/gemfile_check

View File

@@ -4,7 +4,7 @@ module PlantingsHelper
0
elsif !planting.finished_at.nil?
((p = planting.finished_at - DateTime.now).to_i) <= 0 ? 0 : p.to_i
elsif planting.days_before_maturity.nil?
elsif planting.planted_at.nil? || planting.days_before_maturity.nil?
"unknown"
else
((p = (planting.planted_at + planting.days_before_maturity) - DateTime.now).to_i <= 0) ? 0 : p.to_i

View File

@@ -6,6 +6,10 @@ Growstuff::Application.configure do
# preloads Rails for running tests, you may have to set it to true.
config.eager_load = false
# Do not compile assets on-demand. On-demand compilation slows down the test
# suite and causes random test failures.
config.assets.compile = false
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped

View File

@@ -2,7 +2,7 @@ require 'rake'
begin
require 'rspec/core/rake_task'
task(:spec).clear
RSpec::Core::RakeTask.new(spec: 'db:test:prepare') do |t|
RSpec::Core::RakeTask.new(spec: ['db:create', 'db:test:prepare']) do |t|
t.verbose = false
end
rescue LoadError