From e36487458fe9e2dd03802c0cc1b94597f4941bfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Gil?= Date: Fri, 9 Apr 2010 11:38:33 -0300 Subject: [PATCH] test added for nested params files upload --- spec/private/rails/attaches_file_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spec/private/rails/attaches_file_spec.rb b/spec/private/rails/attaches_file_spec.rb index 8d1445c..c7e0211 100644 --- a/spec/private/rails/attaches_file_spec.rb +++ b/spec/private/rails/attaches_file_spec.rb @@ -93,4 +93,22 @@ describe "attach_file" do attach_file "Photo", @filename click_button end + + it "should support nested attributes with multiple files" do + with_html <<-HTML + +
+ + + + + +
+ + HTML + webrat_session.should_receive(:post).with("/albums", { "album" => { "photos_attributes" => [{"image" => @uploaded_file}, {"image" => @uploaded_file}] } }) + attach_file "Photo 1", @filename + attach_file "Photo 2", @filename + click_button + end end