David Chelimsky wrote: > 2. add the data in the current step > > When(/^I pick "(.*)" from (.*)$/) do |option_value, field_name| > field_name.gsub(' > ','').constantize.find_or_create_by_name(option_value) > selects option_value, :from => field_name > end
HI David, I tried the method above but I am getting "You have a nil object when you didn't expect it" I can see that the following line is creating a new ArticleCategory with :name => "My article category" (BTW is it just coincidence that I have the field :name in my Article category table or is this a convention I should be following anyway?) field_name.gsub(' ','').constantize.find_or_create_by_name(option_value) But I don't see where this new ArticleCategory is getting bound to the select control. -- Posted via http://www.ruby-forum.com/. _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users