Developer Tips: Scenarios and Datasets
You may have the need to update specs for your extension if you had been using the Scenarios plugin that came with Radiant.
If you’re working with your extension and your specs no longer run because of an error like:
../../activesupport/lib/active_support/dependencies.rb:279:in `load_missing_constant': uninitialized constant Scenario (NameError)
That means that you’ll either need to add back the Scenarios plugin, or just alter some code to use Datasets.
spec/spec_helper.rb might have something like
if File.directory?(File.dirname(__FILE__) + "/scenarios") Scenario.load_paths.unshift File.dirname(__FILE__) + "/scenarios" end
You’ll need to change that to
Dataset::Resolver.default << (File.dirname(__FILE__) + "/datasets")
And your specs load your scenarios with
scenario :users. You’ll just need to change that to
dataset :users. Here’s an example from the site_watcher extension