refer to a field of the last created model in a Given step

0 views
Skip to first unread message

Philipp Kursawe

unread,
Mar 5, 2010, 3:17:46 AM3/5/10
to pickle
Hello!

I want to create this scenario

Given I have tracks titled Mama, We will rock you
And attach "test.mp3"


Given /^attach "([^\"]*)" as (.+) $/ do |file,attr|
full_file_path = File.join(RAILS_ROOT, 'features', 'upload-files',
filename)
file = File.new(full_file_path)
content_type = file.content_type
model().send("#attr=", file)
end

How would I refer to the last created (list of) model(s)?

Thanks,
Phil

Reply all
Reply to author
Forward
0 new messages