1
내가 제 5 장 테스트 파일을 실행했을 때 다음과 같은 오류를 받고 있어요 에있는 Hartl 튜토리얼에있어
실패 : 간결함을 위해
1) User pages Signup page
Failure/Error: it { should have_selector('title', text: full_title('Sign up')) }
NoMethodError:
undefined method `full_title' for #<RSpec::Core::ExampleGroup::Nested_2::Nested_1:0xaeb792c>
# ./spec/requests/user_pages_spec.rb:12:in `block (3 levels) in <top (required)>'
을, 문제 해결 중에 다른 "full_title을 찾을 수 없음"오류를 주석 처리했습니다.
메소드가 app/helpers/application_helper.rb 파일에 있음을 확인했습니다. 발견되지 않은 아이디어가 있습니까? 헬퍼 파일에있는 것이 가장 확실합니다.
내 사용자 페이지 사양 파일 :
이module ApplicationHelper
# Returns the full title on a per-page basis.
def full_title(page_title)
base_title = "Ruby on Rails Tutorial Sample App"
if page_title.empty?
base_title
else
"#{base_title} | #{page_title}"
end
end
end
정말 고마워요. 내가 어떻게 그걸 놓쳤는 지 잘 모르겠다. 나는 문자 그대로 이것을 몇 시간 동안보고 있었다. 그게 내 문제를 해결 했어. –