2017-04-17 1 views

답변

1

authorize! 방법은 CanCanCan::AccessDenied 오류가 발생합니다, 그래서 당신은 그것에 대해 테스트 할 수 있습니다.

it 'raises error' do 
    expect { my }.to raise_error(I18n.t("messages.login_to_add_new_word")) 
end 
+0

컨트롤러 사양이므로 'my'를 'controller.my'로 변경하면됩니다. 고맙습니다. –

관련 문제