4
컨트롤러 용 테스트를 작성하기 시작했습니다. 그 중 한 번만 페이지가 렌더링되는지 여부를 확인하기 위해 로그인해야합니다.Rspec Rails - 모의 컨트롤러를 테스트하기 위해 current_user가됩니다.
User 모델에 대해 current_user 도우미가있는 Devise를 사용하고 있기 때문에 어떻게 작성해야합니까?
describe "when it GETS 'town'" do
it "should render the template and be successful" do
get :index
response.should render_template(:index)
response.should be_success
end
end
그래서 정의되지 않은 "인증을받지 못했습니다!" 방법 (구체적으로 고안) 오류?