aboutsummaryrefslogtreecommitdiffstats
path: root/spec/factories
diff options
context:
space:
mode:
authorcedricnjanga2017-11-27 14:57:58 +0100
committercedricnjanga2017-11-27 14:57:58 +0100
commitd832ccaa091595bbab0ee0e4c5e863905963686c (patch)
treec696b71c0290a1f28eda7b7b737987289a785a29 /spec/factories
parent9b2edfbf417bb5ee8e6e76d881a4fc6e20b0eda2 (diff)
parent77abde1626e317b5017b2ff15b7a9def759b7701 (diff)
downloadchouette-core-d832ccaa091595bbab0ee0e4c5e863905963686c.tar.bz2
Merge branch '4941-refactoring_object_id'
Diffstat (limited to 'spec/factories')
-rw-r--r--spec/factories/chouette_lines.rb7
-rw-r--r--spec/factories/chouette_routes.rb7
-rw-r--r--spec/factories/line_referentials.rb1
-rw-r--r--spec/factories/referentials.rb1
-rw-r--r--spec/factories/stop_area_referentials.rb1
-rw-r--r--spec/factories/workbenches.rb1
6 files changed, 17 insertions, 1 deletions
diff --git a/spec/factories/chouette_lines.rb b/spec/factories/chouette_lines.rb
index 423ab99f2..95f760174 100644
--- a/spec/factories/chouette_lines.rb
+++ b/spec/factories/chouette_lines.rb
@@ -8,7 +8,7 @@ FactoryGirl.define do
association :network, :factory => :network
association :company, :factory => :company
-
+
before(:create) do |line|
line.line_referential ||= LineReferential.find_by! name: "first"
end
@@ -44,6 +44,11 @@ FactoryGirl.define do
end
+ factory :line_with_after_commit do |line|
+ line.run_callbacks(:commit)
+
+ end
+
end
end
diff --git a/spec/factories/chouette_routes.rb b/spec/factories/chouette_routes.rb
index 4986ab70e..4e20059fe 100644
--- a/spec/factories/chouette_routes.rb
+++ b/spec/factories/chouette_routes.rb
@@ -33,6 +33,13 @@ FactoryGirl.define do
end
end
+ factory :route_with_after_commit do
+ sequence(:objectid) {nil}
+ after(:create) do |route|
+ route.run_callbacks(:commit)
+ end
+ end
+
end
end
diff --git a/spec/factories/line_referentials.rb b/spec/factories/line_referentials.rb
index cfce1399f..e9e6dce5a 100644
--- a/spec/factories/line_referentials.rb
+++ b/spec/factories/line_referentials.rb
@@ -1,5 +1,6 @@
FactoryGirl.define do
factory :line_referential do
sequence(:name) { |n| "Line Referential #{n}" }
+ objectid_format 'stif_codifligne'
end
end
diff --git a/spec/factories/referentials.rb b/spec/factories/referentials.rb
index a4155d181..0276a47be 100644
--- a/spec/factories/referentials.rb
+++ b/spec/factories/referentials.rb
@@ -8,6 +8,7 @@ FactoryGirl.define do
association :organisation
time_zone "Europe/Paris"
ready { true }
+ objectid_format "stif_netex"
factory :workbench_referential do
association :workbench
diff --git a/spec/factories/stop_area_referentials.rb b/spec/factories/stop_area_referentials.rb
index c88819010..fcba996e4 100644
--- a/spec/factories/stop_area_referentials.rb
+++ b/spec/factories/stop_area_referentials.rb
@@ -1,5 +1,6 @@
FactoryGirl.define do
factory :stop_area_referential, :class => StopAreaReferential do
sequence(:name) { |n| "StopArea Referential #{n}" }
+ objectid_format 'stif_reflex'
end
end
diff --git a/spec/factories/workbenches.rb b/spec/factories/workbenches.rb
index 57bef2203..0f26559d8 100644
--- a/spec/factories/workbenches.rb
+++ b/spec/factories/workbenches.rb
@@ -1,6 +1,7 @@
FactoryGirl.define do
factory :workbench do
name "Gestion de l'offre"
+ objectid_format 'stif_netex'
association :organisation
association :line_referential