aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlban Peignier2018-04-22 17:34:15 +0200
committerAlban Peignier2018-04-22 17:34:15 +0200
commited97c41fcb9d3cd2ba16c77c0ec166500803752f (patch)
treea495ecb6f2a2cd38bd5ccce63e70fcc1f057bf28
parentfdd91bf918c9aaf35d8381c553652458c850b609 (diff)
downloadchouette-core-ed97c41fcb9d3cd2ba16c77c0ec166500803752f.tar.bz2
Fixes JourneyPattern specs with distance is not defined/zero. Refs #6413
-rw-r--r--spec/models/chouette/journey_pattern_spec.rb25
1 files changed, 13 insertions, 12 deletions
diff --git a/spec/models/chouette/journey_pattern_spec.rb b/spec/models/chouette/journey_pattern_spec.rb
index 02a54f056..1648c6ecb 100644
--- a/spec/models/chouette/journey_pattern_spec.rb
+++ b/spec/models/chouette/journey_pattern_spec.rb
@@ -41,13 +41,6 @@ describe Chouette::JourneyPattern, :type => :model do
end
context "when the costs are incomplete" do
- context "with a missing distance" do
- before(:each){
- journey_pattern.costs = generate_journey_pattern_costs(->(i){i == 1 ? nil : 10}, 10)
- }
- it { should be_falsy }
- end
-
context "with a missing time" do
before(:each){
journey_pattern.costs = generate_journey_pattern_costs(10, ->(i){i == 1 ? nil : 10})
@@ -56,19 +49,27 @@ describe Chouette::JourneyPattern, :type => :model do
end
end
- context "with a zeroed cost" do
+ context "when all the times are set" do
before(:each){
- journey_pattern.costs = generate_journey_pattern_costs(->(i){i == 1 ? 0 : 10}, 10)
+ journey_pattern.costs = generate_journey_pattern_costs(10, 10)
}
- it { should be_falsy }
+ it { should be_truthy }
end
- context "when all the times are set" do
+ context "with a missing distance" do
before(:each){
- journey_pattern.costs = generate_journey_pattern_costs(10, 10)
+ journey_pattern.costs = generate_journey_pattern_costs(->(i){i == 1 ? nil : 10}, 10)
}
it { should be_truthy }
end
+
+ context "with a zeroed distance" do
+ before(:each){
+ journey_pattern.costs = generate_journey_pattern_costs(->(i){i == 1 ? 0 : 10}, 10)
+ }
+ it { should be_truthy }
+ end
+
end
describe "distance_to" do