몽고이드를 사용하고 있습니다. 객체가 있습니다 :mongoid 제작 - 잘못된 인수 수
그리고 저는 Fabrication을 사용하고 있으며 문제가 있습니다. 보석이 잘 설치되었습니다. /spec/fabricators/employee_fabricator.rb에서 나는
Fabricator :employee do
end
을 그리고 my_controller_spec.rb에서 내가 가진 : 나는 터미널에서 'RSpec에 스펙'을 실행하면
describe CasesController do
describe "viewing cases" do
before(:each) do
Fabricate(:employee)
end
it "allows viewing the cases index page" do
get 'index'
response.should_not be_success
end
end
end
, 내가 얻을 :
Failures:
1) CasesController viewing cases allows viewing the cases index page
Failure/Error: Fabricate(:employee)
ArgumentError:
wrong number of arguments (2 for 1)
여기에 무슨 일이 있습니까? 여러 가지 순열을 시도했지만 그 중 일부는 다른 오류를 발생 시키지만 아무것도 실행하지 않습니다. Fabricate (: employee) 행을 호출하지 않고도 예상대로 실행되지만 지금까지는 빈 테스트 만 있습니다 ...