attach_file problem

10 views
Skip to first unread message

Martin Hawkins

unread,
Jul 7, 2010, 8:04:09 AM7/7/10
to webrat
I'm trying to test a file upload.

In logo_steps.rb, I have

When /^I upload a (.+) image located at (.+)$/ do |format, file_name|
attach_file "logo_logo", "#{Rails.root}/features/logo_files/
#{file_name}.#{format}"
end

which runs and passes.

If I have it to

When /^I upload a (.+) image located at (.+)$/ do |format, file_name|
attach_file "logo_logo", "#{Rails.root}/features/logo_files/
#{file_name}.#{format}", "image/#{format}"
end

I get
wrong number of arguments (3 for 2) (ArgumentError)
Am I doing something stupid?
thnx
Reply all
Reply to author
Forward
0 new messages