diff --git a/Gemfile.lock b/Gemfile.lock index 2870d0b2e..66d3b8d88 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -61,11 +61,10 @@ GEM autoprefixer-rails (>= 5.0.0.1) sass (>= 3.3.0) builder (3.2.2) - bullet (4.14.7) + bullet (4.14.10) activesupport (>= 3.0.0) uniform_notifier (~> 1.9.0) - byebug (5.0.0) - columnize (= 0.9.0) + byebug (6.0.2) capybara (2.5.0) mime-types (>= 1.16) nokogiri (>= 1.3.3) @@ -84,7 +83,6 @@ GEM coffee-script-source execjs coffee-script-source (1.9.1.1) - columnize (0.9.0) crack (0.4.2) safe_yaml (~> 1.0.0) crass (1.0.2) @@ -117,7 +115,7 @@ GEM railties (>= 3.0.0) faker (1.5.0) i18n (~> 0.5) - faraday (0.9.1) + faraday (0.9.2) multipart-post (>= 1.2, < 3) font-awesome-rails (4.4.0.0) railties (>= 3.2, < 5.0) @@ -131,7 +129,8 @@ GEM multi_json (~> 1.0) sprockets (>= 2.0.0, < 4.0) tilt (~> 1.2) - hashie (3.4.2) + hashdiff (0.2.2) + hashie (3.4.3) heroku-api (0.3.23) excon (~> 0.44) multi_json (~> 1.8) @@ -170,12 +169,12 @@ GEM railties mime-types (2.6.2) mini_portile (0.6.2) - minitest (5.8.1) + minitest (5.8.2) multi_json (1.11.2) multi_xml (0.5.5) multipart-post (2.0.0) nested_form (0.3.2) - newrelic_rpm (3.13.2.302) + newrelic_rpm (3.14.0.305) nokogiri (1.6.6.2) mini_portile (~> 0.6.0) nokogumbo (1.4.1) @@ -201,7 +200,7 @@ GEM omniauth-oauth (1.1.0) oauth omniauth (~> 1.0) - omniauth-oauth2 (1.3.1) + omniauth-oauth2 (1.4.0) oauth2 (~> 1.0) omniauth (~> 1.2) omniauth-twitter (1.2.1) @@ -289,7 +288,7 @@ GEM crass (~> 1.0.2) nokogiri (>= 1.4.4) nokogumbo (= 1.4.1) - sass (3.4.18) + sass (3.4.19) sass-rails (5.0.4) railties (>= 4.0.0, < 5.0) sass (~> 3.1) @@ -298,18 +297,18 @@ GEM tilt (>= 1.1, < 3) sentry-raven (0.15.2) faraday (>= 0.7.6) - shoulda-matchers (3.0.0) + shoulda-matchers (3.0.1) activesupport (>= 4.0.0) simple_form (3.2.0) actionpack (~> 4.0) activemodel (~> 4.0) - sprockets (3.3.5) + sprockets (3.4.0) rack (> 1, < 3) sprockets-rails (2.3.3) actionpack (>= 3.0) activesupport (>= 3.0) sprockets (>= 2.8, < 4.0) - sqlite3 (1.3.10) + sqlite3 (1.3.11) test_after_commit (0.4.1) activerecord (>= 3.2) thor (0.19.1) @@ -323,9 +322,10 @@ GEM uniform_notifier (1.9.0) warden (1.2.3) rack (>= 1.0) - webmock (1.21.0) + webmock (1.22.1) addressable (>= 2.3.6) crack (>= 0.3.2) + hashdiff websocket-driver (0.6.2) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.2) diff --git a/app/models/event.rb b/app/models/event.rb index 41ba70cae..4d42f82ff 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -51,12 +51,12 @@ class Event < ActiveRecord::Base with_options(unless: :historical?) do |normal_event| normal_event.with_options(if: :allow_student_rsvp?) do |workshop_event| - workshop_event.validates_numericality_of :student_rsvp_limit, only_integer: true, greater_than: 0 + workshop_event.validates_numericality_of :student_rsvp_limit, greater_than: 0 workshop_event.validate :validate_student_rsvp_limit end with_options(if: :has_volunteer_limit?) do |workshop_event| - workshop_event.validates_numericality_of :volunteer_rsvp_limit, only_integer: true, greater_than: 0 + workshop_event.validates_numericality_of :volunteer_rsvp_limit, greater_than: 0 workshop_event.validate :validate_volunteer_rsvp_limit end end diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb index 2d9b2960a..a1953e981 100644 --- a/spec/models/event_spec.rb +++ b/spec/models/event_spec.rb @@ -8,8 +8,8 @@ it { is_expected.to belong_to(:location) } it { is_expected.to have_many(:rsvps) } it { is_expected.to have_many(:event_sessions) } - it { is_expected.to validate_numericality_of(:student_rsvp_limit) } - it { is_expected.to validate_numericality_of(:volunteer_rsvp_limit) } + it { is_expected.to validate_numericality_of(:student_rsvp_limit).is_greater_than(0) } + it { is_expected.to validate_numericality_of(:volunteer_rsvp_limit).is_greater_than(0) } it { is_expected.to validate_presence_of(:title) } describe "validation of target_audience" do diff --git a/spec/support/shoulda_matchers_monkeypatch.rb b/spec/support/shoulda_matchers_monkeypatch.rb index 2b2993fc7..5f3c2c613 100644 --- a/spec/support/shoulda_matchers_monkeypatch.rb +++ b/spec/support/shoulda_matchers_monkeypatch.rb @@ -1,22 +1,3 @@ -module Shoulda - module Matchers - module ActiveModel - class ValidateNumericalityOfMatcher - def add_disallow_value_matcher - disallow_value_matcher = DisallowValueMatcher.new(NON_NUMERIC_VALUE). - for(@attribute). - with_message(:not_a_number) - disallow_value_matcher - .instance_variable_get(:@allow_matcher) - .ignoring_interference_by_writer - - add_submatcher(disallow_value_matcher) - end - end - end - end -end - module Shoulda module Matchers module ActiveRecord