diff options
| author | Zog | 2018-04-19 14:30:06 +0200 |
|---|---|---|
| committer | Zog | 2018-04-19 14:30:06 +0200 |
| commit | 4eee0a1d832d57bf9be1c73e1efca5fe35cff82a (patch) | |
| tree | f6a228c167e0972d635935f9e492cf8476c60d3d | |
| parent | ca0a4907e5714d6f56ede8d47f2514cdd2752e2f (diff) | |
| download | chouette-core-5519-single-day-purchse-windows.tar.bz2 | |
Refs #5519; Authorize 1-day calendars5519-single-day-purchse-windows
| -rw-r--r-- | app/models/calendar/period.rb | 2 | ||||
| -rw-r--r-- | config/locales/line_referentials.en.yml | 2 | ||||
| -rw-r--r-- | spec/models/chouette/purchase_window_spec.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/app/models/calendar/period.rb b/app/models/calendar/period.rb index 07926e818..c549a7575 100644 --- a/app/models/calendar/period.rb +++ b/app/models/calendar/period.rb @@ -16,7 +16,7 @@ class Calendar < ApplicationModel alias_method :period_end=, :end= def check_end_greather_than_begin - if self.begin && self.end && self.begin >= self.end + if self.begin && self.end && self.begin > self.end errors.add(:base, I18n.t('calendars.errors.short_period')) end end diff --git a/config/locales/line_referentials.en.yml b/config/locales/line_referentials.en.yml index 18ff28c24..6c15b340a 100644 --- a/config/locales/line_referentials.en.yml +++ b/config/locales/line_referentials.en.yml @@ -9,7 +9,7 @@ en: show: title: Line referential synchronized: Synchronized - status: Status + state: Status message: Message activerecord: models: diff --git a/spec/models/chouette/purchase_window_spec.rb b/spec/models/chouette/purchase_window_spec.rb index 702a44eeb..5e81108e1 100644 --- a/spec/models/chouette/purchase_window_spec.rb +++ b/spec/models/chouette/purchase_window_spec.rb @@ -8,7 +8,7 @@ RSpec.describe Chouette::PurchaseWindow, :type => :model do describe 'validations' do it 'validates and date_ranges do not overlap' do expect(build(:purchase_window, referential: referential,date_ranges: [Date.today..Date.today + 10.day, Date.yesterday..Date.tomorrow])).to_not be_valid - # expect(build(periods: [Date.today..Date.today + 10.day, Date.yesterday..Date.tomorrow ])).to_not be_valid + expect(build(:purchase_window, referential: referential,date_ranges: [Date.today..Date.today])).to be_valid end end |
