【发布时间】:2015-04-24 07:27:56
【问题描述】:
我是 Rails 和 Rspec 的新手。我的spec文件有如下场景
scenario "Admin creates a new Specification ", js: true do
sign_in_with admin_user
visit "/general_docs/new"
fill_in "general_doc_name", :with => "Specifications1"
set_live_search_select_value_for('#general_doc_course_id', Course.first.id)
select "Specifications", :from=> "general_doc[doc_type]"
select "student", :from=> "general_doc[user_role_id]"
check "general_doc_active"
path = "/Home/workspace/ums/spec/fixtures/files/demo.png"
attach_file "multiple_file_uploader_url", path
click_button "Create General doc"
expect(page).to have_content "Document was successfully created."
end
我收到以下错误。 失败/错误:attach_file“multiple_file_uploader_url”,路径 水豚::FileNotFound: 无法附加文件,/Home/workspace/ums/spec/fixtures/files/demo.png 不存在
但是我给出的路径是正确的。
提前致谢。
【问题讨论】:
标签: ruby-on-rails rspec