Renamed helpers to correspond to renamed Controller classes.
[merb_radiant.git] / radiant_extensions_plugins / plugins / scenarios / spec / scenarios / .svn / text-base / things_scenario.rb.svn-base
blobd37abd39b4ab9df217613de5259c16218f83cdbd
1 class ThingsScenario < Scenario::Base
3   def load
4     create_thing "one"
5     create_thing "two"
6   end
8   helpers do
9     def create_thing(attributes = {})
10       attributes = { :name => attributes } if attributes.kind_of?(String)
11       attributes = thing_params(attributes)
12       create_record(:thing, attributes[:name].strip.gsub(' ', '_').underscore.to_sym, attributes)
13     end
15     def thing_params(attributes = {})
16       attributes = {
17         :name        => "Unnamed Thing",
18         :description => "I'm not sure what this is."
19       }.update(attributes)
20     end
21   end
22 end