diff options
| -rw-r--r-- | app/models/referential.rb | 1 | ||||
| -rw-r--r-- | spec/models/referential_spec.rb | 14 |
2 files changed, 10 insertions, 5 deletions
diff --git a/app/models/referential.rb b/app/models/referential.rb index c8e209afd..6e0b13ef6 100644 --- a/app/models/referential.rb +++ b/app/models/referential.rb @@ -143,6 +143,7 @@ class Referential < ActiveRecord::Base Apartment::Database.drop slug end + after_create :add_rule_parameter_set def add_rule_parameter_set RuleParameterSet.default_for_all_modes( self).save end diff --git a/spec/models/referential_spec.rb b/spec/models/referential_spec.rb index daee718d5..a11bbd9de 100644 --- a/spec/models/referential_spec.rb +++ b/spec/models/referential_spec.rb @@ -7,13 +7,17 @@ describe Referential do it { should validate_presence_of(:prefix) } it { should validate_presence_of(:time_zone) } + it "create a rule_parameter_set" do + referential = Factory.create(:referential) + referential.rule_parameter_sets.size.should == 1 + end end describe Chouette::StopArea do # check override methods - + subject {Factory(:stop_area)} - + it "should return referential projection " do subject.referential.projection_type='27572' subject.projection.should == subject.referential.projection_type @@ -39,9 +43,9 @@ end describe Chouette::AccessPoint do # check override methods - + subject {Factory(:access_point)} - + it "should return referential projection " do subject.referential.projection_type='27572' subject.projection.should == subject.referential.projection_type @@ -63,4 +67,4 @@ describe Chouette::AccessPoint do subject.projection_y.should be_nil end -end
\ No newline at end of file +end |
