diff --git a/db/seeds.rb b/db/seeds.rb index 16d57b8..edd0dbe 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -346,19 +346,22 @@ published: true, org: Org.find_by(abbreviation: Rails.configuration.branding[:organisation][:abbreviation]), is_default: true, - version: 1}, + version: 0, + dmptemplate_id: 1}, {title: "OLD - Department of Testing Award", published: false, org: Org.find_by(abbreviation: 'GA'), is_default: false, - version: 1}, + version: 0, + dmptemplate_id: 2}, {title: "Department of Testing Award", published: true, org: Org.find_by(abbreviation: 'GA'), is_default: false, - version: 2} + version: 0, + dmptemplate_id: 3} ] templates.map{ |t| Template.create!(t) if Template.find_by(title: t[:title]).nil? } diff --git a/test/test_helper.rb b/test/test_helper.rb index 49d4e34..14391ad 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -49,9 +49,11 @@ # each of the possible Question Formats. # ---------------------------------------------------------------------- def scaffold_template + template_family = Template.all.order(dmptemplate_id: :desc).first + template = Template.new(title: 'Test template', description: 'My test template', published: true, org: Org.first, locale: nil, is_default: false, - version: 1, visibility: 0) + version: 0, visibility: 0, dmptemplate_id: (template_family.dmptemplate_id + 1)) template.phases << Phase.new(title: 'Test phase', description: 'My test phase', number: 1, modifiable: false)