Browse Source

Load FormFixture only in tests (#1643)

It caused superclass mismatch errors. We can stop seeing this bug in local development by defining the class only in test environments
pull/1634/head
Jack 2 years ago committed by GitHub
parent
commit
31ea432cf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      spec/factories/form.rb

8
spec/factories/form.rb

@ -1,8 +1,9 @@
class FormFixture < Form if Rails.env.test?
class FormFixture < Form
attr_accessor :sections, :subsections, :pages, :questions attr_accessor :sections, :subsections, :pages, :questions
end end
class FormFactory class FormFactory
def initialize(year:, type:) def initialize(year:, type:)
@year = year @year = year
@type = type @type = type
@ -22,4 +23,5 @@ class FormFactory
form.questions = form.pages.flat_map(&:questions) form.questions = form.pages.flat_map(&:questions)
form form
end end
end
end end

Loading…
Cancel
Save