aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/chouette/timeband_spec.rb
diff options
context:
space:
mode:
authorXinhui2016-02-22 14:17:18 +0100
committerXinhui2016-02-22 14:17:18 +0100
commitd49f47b4ac1db2cd88b96d830772bb7773924601 (patch)
tree191c7b9cda9edf939792e7780df4e7460d685a4a /spec/models/chouette/timeband_spec.rb
parent633004afc5861a6e8158948ddfecd73bf4dd86a8 (diff)
downloadchouette-core-d49f47b4ac1db2cd88b96d830772bb7773924601.tar.bz2
Merge model from ninoxe gem
Diffstat (limited to 'spec/models/chouette/timeband_spec.rb')
-rw-r--r--spec/models/chouette/timeband_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/models/chouette/timeband_spec.rb b/spec/models/chouette/timeband_spec.rb
new file mode 100644
index 000000000..1f812a6e2
--- /dev/null
+++ b/spec/models/chouette/timeband_spec.rb
@@ -0,0 +1,18 @@
+require 'spec_helper'
+
+describe Chouette::Timeband, :type => :model do
+
+ describe '#create' do
+ context 'when valid' do
+ it { create(:timeband) }
+ end
+
+ context 'when not valid' do
+ it 'fails validation with end_time before start_time' do
+ timeband = build(:timeband_invalid)
+ expect(timeband).to be_invalid
+ end
+ end
+ end
+
+end