From acf7fe972fa9902d32034173d8c16fe1341d2847 Mon Sep 17 00:00:00 2001 From: Rylan Bowers Date: Tue, 14 Aug 2018 20:10:04 -0600 Subject: [PATCH 1/8] Slight clean-up to detailed_hours validation and updates for newer hash syntax and spacing updates. --- app/models/location.rb | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/app/models/location.rb b/app/models/location.rb index 37c7aa4e..e5c65e4e 100755 --- a/app/models/location.rb +++ b/app/models/location.rb @@ -138,22 +138,13 @@ def mappable_address def detailed_hours_cannot_end_before_start (0..6).each do |index| if open_on_day?(index) - prefix = 'day' + index.to_s - if read_day_info(prefix + '_start') > read_day_info(prefix + '_end') - errors.add(prefix+'_status', 'must have an end time AFTER the start time') + if read_day_info("day#{index}_start") > read_day_info("day#{index}_end") + errors.add("day#{index}_status", 'must have an end time AFTER the start time') end end end end - def day_length(index) - hours_on_day(index).reduce(:-) - end - - def wrong_day_order?(index) - open_on_day?(index) && day_length(index).negative? - end - def populate_receipt_key self.receipt_key = (0...8).map { ('a'..'z').to_a[rand(26)] }.join if self.receipt_key.blank? end @@ -161,15 +152,15 @@ def populate_receipt_key def populate_detailed_hours_json_before_save hours_info = {} (0..6).each do |index| - prefix = 'day'+index.to_s+'_' - start = read_day_info(prefix+'start') - stop = read_day_info(prefix+'end') - next if start.nil? or stop.nil? + prefix = 'day' + index.to_s + '_' + start = read_day_info(prefix + 'start') + stop = read_day_info(prefix + 'end') + next if start.nil? || stop.nil? hours_info[index] = { - :status => read_day_info(prefix+'status').to_s, + status: read_day_info(prefix+'status').to_s, # save these with the timezone on them! - :start => start.to_formatted_s(:rfc822), - :end => stop.to_formatted_s(:rfc822) + start: start.to_formatted_s(:rfc822), + end: stop.to_formatted_s(:rfc822) } end self.detailed_hours_json = hours_info.to_json From bdfd59c4d3b58d63ad9c9cc00e7c06dff601bdcb Mon Sep 17 00:00:00 2001 From: Rylan Bowers Date: Sat, 29 Dec 2018 11:46:21 -0700 Subject: [PATCH 2/8] Cleaning up datepicker to work properly in a production ENV w/o extraneous header / footer. --- app/assets/javascripts/datepicker_footer.js | 9 --------- app/assets/javascripts/datepicker_head.js | 2 -- app/views/volunteers/_datepicker.html.erb | 12 +++++++++++- app/views/volunteers/region_admin.html.erb | 5 +---- 4 files changed, 12 insertions(+), 16 deletions(-) delete mode 100644 app/assets/javascripts/datepicker_footer.js delete mode 100644 app/assets/javascripts/datepicker_head.js diff --git a/app/assets/javascripts/datepicker_footer.js b/app/assets/javascripts/datepicker_footer.js deleted file mode 100644 index a216b58d..00000000 --- a/app/assets/javascripts/datepicker_footer.js +++ /dev/null @@ -1,9 +0,0 @@ -$(document).ready(function() { - flatpickr(".datepicker", { - "dateFormat": "Y-n-j", - "allowInput": false, - "onOpen": function(selectedDates, dateStr, instance) { - instance.setDate(instance.input.value, false); - } - }); -}); diff --git a/app/assets/javascripts/datepicker_head.js b/app/assets/javascripts/datepicker_head.js deleted file mode 100644 index 31a96fd2..00000000 --- a/app/assets/javascripts/datepicker_head.js +++ /dev/null @@ -1,2 +0,0 @@ -//= require jquery -//= require jquery_ujs diff --git a/app/views/volunteers/_datepicker.html.erb b/app/views/volunteers/_datepicker.html.erb index c84d6371..e0f4956b 100644 --- a/app/views/volunteers/_datepicker.html.erb +++ b/app/views/volunteers/_datepicker.html.erb @@ -4,6 +4,16 @@ - <%= javascript_include_tag "datepicker_head" %> + diff --git a/app/views/volunteers/region_admin.html.erb b/app/views/volunteers/region_admin.html.erb index 3e4af7e8..d0a916ce 100755 --- a/app/views/volunteers/region_admin.html.erb +++ b/app/views/volunteers/region_admin.html.erb @@ -1,4 +1,4 @@ -<%= render partial: "datepicker" %> +<%= render partial: 'datepicker' %>
@@ -129,6 +129,3 @@ <% end %>
- -<%= javascript_include_tag "datepicker_footer" %> - From f4a6ea66452a10214debd263cb56628819ad9025 Mon Sep 17 00:00:00 2001 From: Rylan Bowers Date: Sat, 29 Dec 2018 11:55:21 -0700 Subject: [PATCH 3/8] Trying to get load order to work with application js jquery / ujs to prevent duplicate loads. --- app/views/volunteers/_datepicker.html.erb | 32 ++++++++++------------ app/views/volunteers/region_admin.html.erb | 4 +-- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/app/views/volunteers/_datepicker.html.erb b/app/views/volunteers/_datepicker.html.erb index e0f4956b..4cc6d83d 100644 --- a/app/views/volunteers/_datepicker.html.erb +++ b/app/views/volunteers/_datepicker.html.erb @@ -1,19 +1,17 @@ - - - + + - - + - + }); + diff --git a/app/views/volunteers/region_admin.html.erb b/app/views/volunteers/region_admin.html.erb index d0a916ce..b44827da 100755 --- a/app/views/volunteers/region_admin.html.erb +++ b/app/views/volunteers/region_admin.html.erb @@ -1,5 +1,3 @@ -<%= render partial: 'datepicker' %> -

Region Admin Controls

@@ -129,3 +127,5 @@ <% end %>
+ +<%= render partial: 'datepicker' %> From ddc2b8352b4085c2c314821a5b73fa14cafe2a01 Mon Sep 17 00:00:00 2001 From: Rylan Bowers Date: Sat, 29 Dec 2018 12:02:05 -0700 Subject: [PATCH 4/8] Hopefully final update to get datepicker working --- app/views/volunteers/_datepicker.html.erb | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/app/views/volunteers/_datepicker.html.erb b/app/views/volunteers/_datepicker.html.erb index 4cc6d83d..66269b80 100644 --- a/app/views/volunteers/_datepicker.html.erb +++ b/app/views/volunteers/_datepicker.html.erb @@ -4,14 +4,17 @@ - + +<% end %> From 466513b33d75c384d69f36dca6ea5b6cc26f09bf Mon Sep 17 00:00:00 2001 From: Rylan Bowers Date: Fri, 22 Feb 2019 21:31:46 -0700 Subject: [PATCH 5/8] Updating ruby-version --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index 00355e29..bc4abe86 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.7 +2.3.8 From 93608ed6f583e3bbc140a5d2dfc15c67c7fdc43c Mon Sep 17 00:00:00 2001 From: Rylan Bowers Date: Fri, 22 Feb 2019 21:34:06 -0700 Subject: [PATCH 6/8] Running bundle update and updating to lock some gems to versions that broke server / rspec. --- Gemfile | 6 +- Gemfile.lock | 280 ++++++++++++++++++++++++++------------------------- 2 files changed, 146 insertions(+), 140 deletions(-) diff --git a/Gemfile b/Gemfile index 24424b91..50ea0a6f 100755 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ source 'https://rubygems.org' ruby File.read('.ruby-version').strip # the base rails libraries -gem 'pg' +gem 'pg', '~> 0.21.0' gem 'rails', '~> 3.2.16' gem 'rails_12factor' gem 'thin' @@ -89,13 +89,13 @@ gem 'jquery-datatables-rails', git: 'https://github.com/rweng/jquery-datatables- gem 'cocoon' # set timezone to browser timezone -gem 'browser-timezone-rails' # '~> 0.0.9' +gem 'browser-timezone-rails', '~> 0.2.00' gem 'ranked-model' # Send email when exception occurs. gem 'exception_notification', '~> 3.0.1' gem 'exception_notification-rake', '~> 0.0.6' -gem 'cancancan' +gem 'cancancan', '~> 1.15.0' gem 'interactor' gem 'newrelic_rpm' diff --git a/Gemfile.lock b/Gemfile.lock index b6489ee2..bd3b9d3f 100755 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/rweng/jquery-datatables-rails.git - revision: b8e6b6fa51e0074ea44b4771a68b1817a14023fc + revision: d486b31b192a2924b1913e080ad23460e6b96d31 specs: jquery-datatables-rails (3.4.0) actionpack (>= 3.1) @@ -36,7 +36,7 @@ GEM rack-cache (~> 1.2) rack-test (~> 0.6.1) sprockets (~> 2.2.1) - active_scaffold (3.4.38) + active_scaffold (3.4.43) rails (>= 3.2.22.2, < 5) activemodel (3.2.22.5) activesupport (= 3.2.22.5) @@ -52,22 +52,25 @@ GEM activesupport (3.2.22.5) i18n (~> 0.6, >= 0.6.4) multi_json (~> 1.0) - addressable (2.4.0) + addressable (2.6.0) + public_suffix (>= 2.0.2, < 4.0) arel (3.0.3) - ast (2.3.0) - awesome_print (1.7.0) - aws-sdk (2.3.9) - aws-sdk-resources (= 2.3.9) - aws-sdk-core (2.3.9) + ast (2.4.0) + awesome_print (1.8.0) + aws-sdk (2.11.227) + aws-sdk-resources (= 2.11.227) + aws-sdk-core (2.11.227) + aws-sigv4 (~> 1.0) jmespath (~> 1.0) - aws-sdk-resources (2.3.9) - aws-sdk-core (= 2.3.9) - bcrypt (3.1.11) - better_errors (2.1.1) + aws-sdk-resources (2.11.227) + aws-sdk-core (= 2.11.227) + aws-sigv4 (1.0.3) + bcrypt (3.1.12) + better_errors (2.5.1) coderay (>= 1.0.0) - erubis (>= 2.6.6) + erubi (>= 1.0.0) rack (>= 0.9.0) - binding_of_caller (0.7.2) + binding_of_caller (0.8.0) debug_inspector (>= 0.0.1) bootstrap-sass (3.2.0.2) sass (~> 3.2) @@ -78,37 +81,36 @@ GEM rails (>= 3.1) buftok (0.2.0) builder (3.0.4) - byebug (9.0.6) + byebug (11.0.0) cancancan (1.15.0) - capybara (2.7.1) + capybara (2.18.0) addressable - mime-types (>= 1.16) + mini_mime (>= 0.1.3) nokogiri (>= 1.3.3) rack (>= 1.0.0) rack-test (>= 0.5.4) - xpath (~> 2.0) - capybara-screenshot (1.0.14) - capybara (>= 1.0, < 3) + xpath (>= 2.0, < 4.0) + capybara-screenshot (1.0.22) + capybara (>= 1.0, < 4) launchy choice (0.2.0) - climate_control (0.0.3) - activesupport (>= 3.0) + climate_control (0.2.0) cliver (0.3.2) cocaine (0.5.8) climate_control (>= 0.0.3, < 1.0) - cocoon (1.2.9) - coderay (1.1.1) + cocoon (1.2.12) + coderay (1.1.2) coffee-rails (3.2.2) coffee-script (>= 2.2.0) railties (~> 3.2.0) coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.10.0) + coffee-script-source (1.12.2) commonjs (0.2.7) - concurrent-ruby (1.0.5) - daemons (1.2.4) - debug_inspector (0.0.2) + concurrent-ruby (1.1.4) + daemons (1.3.1) + debug_inspector (0.0.3) devise (3.2.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) @@ -116,40 +118,39 @@ GEM thread_safe (~> 0.1) warden (~> 1.2.3) diff-lcs (1.3) - domain_name (0.5.20160310) + domain_name (0.5.20180417) unf (>= 0.0.5, < 1.0.0) - dotenv (2.2.0) - dotenv-rails (2.2.0) - dotenv (= 2.2.0) - railties (>= 3.2, < 5.1) - equalizer (0.0.10) + dotenv (2.7.0) + dotenv-rails (2.7.0) + dotenv (= 2.7.0) + railties (>= 3.2, < 6.1) + equalizer (0.0.11) + erubi (1.8.0) erubis (2.7.0) - eventmachine (1.2.3) + eventmachine (1.2.7) exception_notification (3.0.1) actionmailer (>= 3.0.4) - exception_notification-rake (0.0.6) + exception_notification-rake (0.0.7) exception_notification (~> 3.0.1) rake (>= 0.9.0) execjs (2.7.0) - factory_girl (4.7.0) + factory_girl (4.9.0) activesupport (>= 3.0.0) - factory_girl_rails (4.7.0) - factory_girl (~> 4.7.0) + factory_girl_rails (4.9.0) + factory_girl (~> 4.9.0) railties (>= 3.0.0) faker (1.7.3) i18n (~> 0.5) - faraday (0.9.2) - multipart-post (>= 1.2, < 3) - ffi (1.9.18) + ffi (1.10.0) font-awesome-sass (4.4.0) sass (>= 3.2) formatador (0.2.5) - geocoder (1.3.6) + geocoder (1.5.1) gmaps4rails (1.5.6) - guard (2.14.1) + guard (2.15.0) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) - lumberjack (~> 1.0) + lumberjack (>= 1.0.12, < 2.0) nenv (~> 0.1) notiffany (~> 0.0) pry (>= 0.9.12) @@ -163,29 +164,28 @@ GEM highcharts-rails (3.0.10) railties (>= 3.1) hike (1.2.3) - http (1.0.4) + http (3.3.0) addressable (~> 2.3) http-cookie (~> 1.0) - http-form_data (~> 1.0.1) + http-form_data (~> 2.0) http_parser.rb (~> 0.6.0) - http-cookie (1.0.2) + http-cookie (1.0.3) domain_name (~> 0.5) - http-form_data (1.0.1) + http-form_data (2.1.1) http_parser.rb (0.6.0) i18n (0.9.5) concurrent-ruby (~> 1.0) - interactor (3.1.0) + interactor (3.1.1) interception (0.5) - jmespath (1.2.4) - json_pure (>= 1.8.1) + jaro_winkler (1.5.2) + jmespath (1.4.0) journey (1.0.4) jquery-cookie-rails (1.3.1.1) railties (>= 3.2.0, < 5.0) jquery-rails (2.1.4) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) - json (1.8.6) - json_pure (1.8.3) + json (2.2.0) jstz-rails (1.0.4.1) railties (~> 3.1) launchy (2.4.3) @@ -195,64 +195,66 @@ GEM less-rails (2.6.0) actionpack (>= 3.1) less (~> 2.6.0) - libv8 (3.16.14.15) + libv8 (3.16.14.19) listen (3.1.5) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) - lumberjack (1.0.12) + lumberjack (1.0.13) mail (2.5.5) mime-types (~> 1.16) treetop (~> 1.4.8) memoizable (0.4.2) thread_safe (~> 0.3, >= 0.3.1) - method_source (0.8.2) + method_source (0.9.2) mime-types (1.25.1) mimemagic (0.3.0) - mini_portile2 (2.0.0) + mini_mime (1.0.1) + mini_portile2 (2.4.0) multi_json (1.13.1) multipart-post (2.0.0) naught (1.1.0) nenv (0.3.0) - newrelic_rpm (3.18.0.329) - nokogiri (1.6.7.2) - mini_portile2 (~> 2.0.0.rc2) + newrelic_rpm (6.0.0.351) + nokogiri (1.10.1) + mini_portile2 (~> 2.4.0) notiffany (0.1.1) nenv (~> 0.1) shellany (~> 0.0) orm_adapter (0.5.0) - parallel (1.12.0) - parser (2.4.0.2) - ast (~> 2.3) + parallel (1.13.0) + parser (2.6.0.0) + ast (~> 2.4.0) pdf-core (0.6.1) - pg (0.18.4) - poltergeist (1.12.0) - capybara (~> 2.1) + pg (0.21.0) + poltergeist (1.18.1) + capybara (>= 2.1, < 4) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) polyglot (0.3.5) - power_assert (0.2.6) - powerpack (0.1.1) + power_assert (1.1.3) + powerpack (0.1.2) prawn (2.1.0) pdf-core (~> 0.6.1) ttfunk (~> 1.4.0) prawn-table (0.2.2) prawn (>= 1.3.0, < 3.0.0) - pry (0.10.4) + pry (0.12.2) coderay (~> 1.1.0) - method_source (~> 0.8.1) - slop (~> 3.4) - pry-byebug (3.4.0) - byebug (~> 9.0) + method_source (~> 0.9.0) + pry-byebug (3.7.0) + byebug (~> 11.0) pry (~> 0.10) - pry-rails (0.3.4) - pry (>= 0.9.10) + pry-rails (0.3.9) + pry (>= 0.10.4) pry-remote (0.1.8) pry (~> 0.9) slop (~> 3.0) - pry-rescue (1.4.4) + pry-rescue (1.5.0) interception (>= 0.5) - pry + pry (>= 0.12.0) + psych (3.1.0) + public_suffix (3.0.3) rack (1.4.7) rack-cache (1.8.0) rack (>= 0.4) @@ -268,7 +270,7 @@ GEM activesupport (= 3.2.22.5) bundler (~> 1.0) railties (= 3.2.22.5) - rails-erd (1.4.7) + rails-erd (1.5.2) activerecord (>= 3.2) activesupport (>= 3.2) choice (~> 0.2.0) @@ -285,49 +287,53 @@ GEM rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) - rainbow (2.2.2) - rake - rake (12.3.1) - ranked-model (0.4.0) + rainbow (3.0.0) + rake (12.3.2) + ranked-model (0.4.1) activerecord (>= 3.1.12) rb-fsevent (0.9.8) - rb-inotify (0.9.10) - ffi (>= 0.5.0, < 2) - rdoc (3.12.2) - json (~> 1.4) + rb-inotify (0.10.0) + ffi (~> 1.0) + rdoc (3.9.5) ref (2.0.0) - rspec (3.5.0) - rspec-core (~> 3.5.0) - rspec-expectations (~> 3.5.0) - rspec-mocks (~> 3.5.0) - rspec-core (3.5.4) - rspec-support (~> 3.5.0) - rspec-expectations (3.5.0) + rspec (3.8.0) + rspec-core (~> 3.8.0) + rspec-expectations (~> 3.8.0) + rspec-mocks (~> 3.8.0) + rspec-core (3.8.0) + rspec-support (~> 3.8.0) + rspec-expectations (3.8.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-mocks (3.5.0) + rspec-support (~> 3.8.0) + rspec-mocks (3.8.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.5.0) - rspec-rails (3.5.2) + rspec-support (~> 3.8.0) + rspec-rails (3.8.2) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) - rspec-core (~> 3.5.0) - rspec-expectations (~> 3.5.0) - rspec-mocks (~> 3.5.0) - rspec-support (~> 3.5.0) - rspec-support (3.5.0) - rubocop (0.51.0) + rspec-core (~> 3.8.0) + rspec-expectations (~> 3.8.0) + rspec-mocks (~> 3.8.0) + rspec-support (~> 3.8.0) + rspec-support (3.8.0) + rubocop (0.65.0) + jaro_winkler (~> 1.5.1) parallel (~> 1.10) - parser (>= 2.3.3.1, < 3.0) + parser (>= 2.5, != 2.5.1.1) powerpack (~> 0.1) - rainbow (>= 2.2.2, < 3.0) + psych (>= 3.1.0) + rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) - unicode-display_width (~> 1.0, >= 1.0.1) - ruby-graphviz (1.2.2) - ruby-progressbar (1.9.0) + unicode-display_width (~> 1.4.0) + ruby-graphviz (1.2.4) + ruby-progressbar (1.10.0) ruby_dep (1.5.0) - sass (3.4.22) + sass (3.7.3) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) @@ -343,32 +349,32 @@ GEM multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.12) - test-unit (3.1.5) + sqlite3 (1.4.0) + test-unit (3.3.0) power_assert - therubyracer (0.12.2) - libv8 (~> 3.16.14.0) + therubyracer (0.12.3) + libv8 (~> 3.16.14.15) ref thin (1.7.2) daemons (~> 1.0, >= 1.0.9) eventmachine (~> 1.0, >= 1.0.4) rack (>= 1, < 3) - thor (0.20.0) - thread_safe (0.3.5) + thor (0.20.3) + thread_safe (0.3.6) tilt (1.4.1) treetop (1.4.15) polyglot polyglot (>= 0.3.1) ttfunk (1.4.0) - twitter (5.16.0) + twitter (6.2.0) addressable (~> 2.3) buftok (~> 0.2.0) - equalizer (= 0.0.10) - faraday (~> 0.9.0) - http (~> 1.0) + equalizer (~> 0.0.11) + http (~> 3.0) + http-form_data (~> 2.0) http_parser.rb (~> 0.6.0) - json (~> 1.8) memoizable (~> 0.4.0) + multipart-post (~> 2.0) naught (~> 1.0) simple_oauth (~> 0.3.0) twitter-bootstrap-rails (3.2.2) @@ -376,22 +382,22 @@ GEM execjs (>= 2.2.2, >= 2.2) less-rails (>= 2.5.0) railties (>= 3.1) - tzinfo (0.3.54) - uglifier (3.0.0) + tzinfo (0.3.55) + uglifier (4.1.20) execjs (>= 0.3.0, < 3) unf (0.1.4) unf_ext - unf_ext (0.0.7.2) - unicode-display_width (1.3.0) - warden (1.2.6) + unf_ext (0.0.7.5) + unicode-display_width (1.4.1) + warden (1.2.7) rack (>= 1.0) - websocket-driver (0.6.4) + websocket-driver (0.7.0) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.2) - xpath (2.0.0) - nokogiri (~> 1.3) - yaml_db (0.3.0) - rails (>= 3.0, < 4.3) + websocket-extensions (0.1.3) + xpath (3.2.0) + nokogiri (~> 1.8) + yaml_db (0.7.0) + rails (>= 3.0) rake (>= 0.8.7) PLATFORMS @@ -405,8 +411,8 @@ DEPENDENCIES better_errors binding_of_caller bootstrap-sass (~> 3.2.0) - browser-timezone-rails - cancancan + browser-timezone-rails (~> 0.2.00) + cancancan (~> 1.15.0) capybara capybara-screenshot cocoon @@ -428,7 +434,7 @@ DEPENDENCIES json newrelic_rpm paperclip! - pg + pg (~> 0.21.0) poltergeist (~> 1.12) prawn (~> 2.1.0) prawn-table (~> 0.2.2) @@ -456,7 +462,7 @@ DEPENDENCIES yaml_db RUBY VERSION - ruby 2.3.7p456 + ruby 2.3.8p459 BUNDLED WITH - 1.16.1 + 1.16.6 From 33308dd0fed77458579262c43e02e7db40b2f066 Mon Sep 17 00:00:00 2001 From: Rylan Bowers Date: Fri, 22 Feb 2019 21:34:27 -0700 Subject: [PATCH 7/8] =?UTF-8?q?Fixing=20to=20get=20tests=20to=20pass=20at?= =?UTF-8?q?=20all=20times=20of=20the=20day.=20Seems=20later=20at=20night?= =?UTF-8?q?=20that=20they=20don=E2=80=99t=20pass.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../interactors/create_schedule_chain_spec.rb | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/spec/interactors/create_schedule_chain_spec.rb b/spec/interactors/create_schedule_chain_spec.rb index 220aad57..7a082275 100644 --- a/spec/interactors/create_schedule_chain_spec.rb +++ b/spec/interactors/create_schedule_chain_spec.rb @@ -4,15 +4,9 @@ RSpec.describe CreateScheduleChain do describe '::call' do - subject do - described_class.call( - schedule_chain: chain - ) - end + subject { described_class.call( schedule_chain: chain ) } - let(:chain) do - build(:schedule_chain, :one_time) - end + let(:chain) { build(:schedule_chain, :one_time) } it 'saves the schedule' do expect(subject.success?).to eq(true) @@ -20,9 +14,7 @@ end it 'does not create rescue logs' do - expect { - subject - }.to_not(change { Log.count }) + expect { subject }.to_not(change { Log.count }) end it 'fails if it cannot save the schedule' do @@ -33,15 +25,10 @@ context 'schedule is one time and same day' do let!(:donor) { create(:donation_schedule, schedule_chain: chain, location: create(:hub), position: 1) } let!(:recipient) { create(:recipient_schedule, schedule_chain: chain, location: create(:hub), position: 2) } - - let(:chain) do - create(:schedule_chain, :one_time, detailed_date: Date.today) - end + let(:chain) { create(:schedule_chain, :one_time, detailed_date: Date.current) } it 'creates rescue logs' do - expect { - subject - }.to change { Log.count }.by(1) + expect { subject }.to change { Log.count }.by(1) end end end From fcee14ea8f5ec020a96957e7d112e43798689897 Mon Sep 17 00:00:00 2001 From: Rylan Bowers Date: Fri, 12 Mar 2021 20:15:01 -0700 Subject: [PATCH 8/8] Update to trigger deploy for stack update