aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZog2018-04-19 14:30:06 +0200
committercedricnjanga2018-04-19 22:05:31 -0700
commitad9e5c93133bf38eec1a9a2c533e783846936de8 (patch)
tree33b16d5bfe8a3a89501964a910bcd2f247558d92
parent66257b30c12197d24018f234e73aa1da0631f04d (diff)
downloadchouette-core-ad9e5c93133bf38eec1a9a2c533e783846936de8.tar.bz2
Refs #5519; Authorize 1-day calendars
-rw-r--r--app/models/calendar/period.rb2
-rw-r--r--config/locales/line_referentials.en.yml2
-rw-r--r--spec/models/chouette/purchase_window_spec.rb2
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