Renamed helpers to correspond to renamed Controller classes.
[merb_radiant.git] / radiant_extensions_plugins / plugins / scenarios / spec / scenarios / .svn / text-base / people_scenario.rb.svn-base
blob792e0f4ac147dec72cc6cf2b6e9de3f1d71db530
1 class PeopleScenario < Scenario::Base
2   
3   def load
4     create_person "John Long"
5     create_person "Adam Williams"
6   end
7   
8   helpers do
9     def create_person(attributes = {})
10       if attributes.kind_of?(String)
11         first, last = attributes.split(/\s+/)
12         attributes = { :first_name => first, :last_name => last }
13       end 
14       attributes = person_params(attributes)
15       create_record(:person, attributes[:first_name].strip.gsub(' ', '_').underscore.to_sym, attributes)
16     end
17     
18     def person_params(attributes = {})
19       attributes = {
20         :first_name => "John",
21         :last_name  => "Q."
22       }.update(attributes)
23     end
24   end
25   
26 end