aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support/referential.rb
diff options
context:
space:
mode:
authorTeddy Wing2017-09-27 12:54:53 +0200
committerTeddy Wing2017-09-27 12:54:53 +0200
commitd1bd434d78972d4f4156f3e3e864e075cad9e62d (patch)
tree7ddb37492f3e378b1de77328f6d5d2a41136e031 /spec/support/referential.rb
parent3ea043d39fc02b885294304157745c05b51dc19c (diff)
downloadchouette-core-d1bd434d78972d4f4156f3e3e864e075cad9e62d.tar.bz2
spec/support/referential.rb: Use factories
Instead of creating the objects directly in ActiveRecord, use our existing factories for these records as suggested by Robert. Refs #3520
Diffstat (limited to 'spec/support/referential.rb')
-rw-r--r--spec/support/referential.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/support/referential.rb b/spec/support/referential.rb
index 37c3c0a82..6f60bd86b 100644
--- a/spec/support/referential.rb
+++ b/spec/support/referential.rb
@@ -52,13 +52,21 @@ RSpec.configure do |config|
referential.add_member organisation, owner: true
end
- workbench = Workbench.create!(
+ workbench = FactoryGirl.create(
+ :workbench,
name: "Gestion de l'offre",
organisation: organisation,
line_referential: line_referential,
stop_area_referential: stop_area_referential
)
- referential = Referential.create! prefix: "first", name: "first", slug: "first", organisation: organisation, workbench: workbench
+ referential = FactoryGirl.create(
+ :referential,
+ prefix: "first",
+ name: "first",
+ slug: "first",
+ organisation: organisation,
+ workbench: workbench
+ )
end
config.before(:each) do