aboutsummaryrefslogtreecommitdiffstats
path: root/script
diff options
context:
space:
mode:
authorTeddy Wing2017-06-07 13:12:56 +0200
committerTeddy Wing2017-06-07 13:19:05 +0200
commit073ac0eb3330787532f551d20abe4600a0615446 (patch)
tree718a94ffce47975414d9d0fce39f247f4b4ea0ad /script
parentf3ae5267d8b38f6c1ba3ab4e4ba2a0b4f0313e48 (diff)
downloadchouette-core-073ac0eb3330787532f551d20abe4600a0615446.tar.bz2
factories/workbenches: Add a new `:with_referential` trait
This new trait allows us to create a referential association along with the workbench. Works like this: create(:workbench, :with_referential) We do this to allow us to reuse the `organisation`, `line_referential`, and `stop_area_referential` associations to ensure that the values of those fields are consistent in both the resulting workbench and referential objects. If we need to create multiple referentials, we could add an `amount` later. Left in some commented code describing my earlier attempts at this. Fortunately, found this Stack Overflow post that pointed me in the right direction: https://stackoverflow.com/questions/20685322/how-to-create-an-association-in-factorygirl-with-a-value-lazy-evaluated-from-ano I need this for a new `spec/helpers/table_builder_helper_spec.rb` spec, wherein I'm trying to test building a table of workspaces, but having trouble with code I copied from the app that tries to get `#validity_period` from workbenches. Thought at first that adding a referential (which does have this field) could help get past that, but it didn't quite work. Needs more investigation. Refs #3479
Diffstat (limited to 'script')
0 files changed, 0 insertions, 0 deletions