Skip to content

Instantly share code, notes, and snippets.

@paul
Created September 29, 2008 21:21
Show Gist options
  • Save paul/13680 to your computer and use it in GitHub Desktop.
Save paul/13680 to your computer and use it in GitHub Desktop.
require 'dm-sweatshop'
require 'uuidtools'
Configuration.fixture {{
:uuid => UUID.random_create,
:name => /\w+/.gen[1..4],
:client_href => ("http://core.ssbe.localhost/clients/" + /\w+/.gen),
:notes => /[:sentence:]/.gen[0..140],
:platform => /\w+/.gen,
:registered_templates => (0..20).of {RegisteredTemplate.make}
}}
RegisteredTemplate.fixture {{
:uuid => UUID.random_create,
:name => /\w+/.gen[1..4],
:template_path => { (template = Template.pick).path }
:disabled => false
:answers => (0..template.questions.size).of {Answer.make}
}}
Answer.fixture {{
:uuid => UUID.random_create,
:value => /\w+/.gen[1..2],
:question_name => template.questions.pick
}}
5.of { Configuration.gen }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment