RSpec과 함께 사용할 FactoryGirl의 튜토리얼 및 문서를 따라했습니다.RSpec 및 FactoryGirl이있는 레일즈 엔진
describe "GenericRecipesController" do
describe "GET 'index'" do
it "displays list of generic recipes" do
generic_recipe = FactoryGirl.create(:generic_recipe)
visit '/recipe'
response.should be_success
end
end
end
그리고 오류 : code is there의
GenericRecipesController GET 'index' displays list of generic recipes
Failure/Error: generic_recipe = FactoryGirl.create(:generic_recipe)
NameError:
uninitialized constant GenericRecipe
# ./spec/integration/generic_recipes_spec.rb:8:in `block (3 levels) in <top (required)>'
나머지 FactoryGirl.create를 사용하려고 할 때 현재 내가 한 오류가 발생합니다.
다음은 질문하기 전에 전체 소스 코드를 사용할 수있는 upvote입니다. – depa
또한 공장 코드를 알려주시겠습니까? – depa
고마워, 공장은 여기에있다 : https://github.com/valk/edible-recipe/blob/master/spec/factories.rb – valk