Commit ba4fe3c8 authored by Stan Hu's avatar Stan Hu
Browse files

Work around migration specs failing due to repository storages not being selected

Migration specs may be missing a column necessary to create an ApplicationSetting
object, which causes the FakeApplicationSetting to be initialized. However, the
project selects a random repository storage via ApplicationSetting#pick_repository_storage,
which isn't present in the OpenStruct.

To workaround this issues, we add a pick_repository_storage method in
FakeApplicationSetting.
parent 9d8b66e157e3
......@@ -11,6 +11,10 @@ def initialize(options = {})
FakeApplicationSettings.define_predicate_methods(options)
end
def pick_repository_storage
repository_storages.sample
end
# Mimic ActiveRecord predicate methods for boolean values
def self.define_predicate_methods(options)
options.each do |key, value|
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment