lib/mechanical-cuke/web_steps.rb in mechanical-cuke-0.1.0 vs lib/mechanical-cuke/web_steps.rb in mechanical-cuke-0.2.0

- old
+ new

@@ -43,9 +43,13 @@ r = find_radiobutton(field) raise "Can't find radio button \"#{field}\"" if r.nil? r.check end +When /^(?:|I )attach the file "([^\"]*)" to "([^\"]*)"$/ do |path, field| + form.file_upload_with(:name => field).file_name = path +end + Then /^(?:|I )should see "([^\"]*)"$/ do |text| if defined?(Spec::Rails::Matchers) response.should contain(text) else assert current_page.body.include?(text)