Skip to content

Instantly share code, notes, and snippets.

@zhhz
zhhz / link_to_action with confirmation.rb
Created November 11, 2008 19:20
link_to_action with confirmation
# Helper method to adding the fixtures into the tests
def fixtures(*files)
files.each do |file|
klass = begin
Kernel::const_get(Extlib::Inflection.classify(Extlib::Inflection.singularize(file.to_s)))
rescue
nil
end
entries = YAML::load_file(File.dirname(__FILE__) + "/fixtures/#{file}.yml")
# do a migrate to create the table to clear the records
# spec_helper.rb
# Helper method to adding the fixtures into the tests
def fixtures(*files)
files.each do |file|
klass = begin
Kernel::const_get(
Extlib::Inflection.classify(
Extlib::Inflection.singularize(file.to_s)))
rescue
nil