spec/support/view_definition_helpers.rb in scenic-0.1.0 vs spec/support/view_definition_helpers.rb in scenic-0.2.0
- old
+ new
@@ -1,9 +1,9 @@
module ViewDefinitionHelpers
def with_view_definition(name, version, schema)
- view_file = ::Rails.root.join("db", "views", "#{name}_v#{version}.sql")
- File.open(view_file, "w") { |f| f.write(schema) }
+ definition = Scenic::Definition.new(name, version)
+ File.open(definition.full_path, "w") { |f| f.write(schema) }
yield
ensure
- File.delete view_file
+ File.delete definition.full_path
end
end