0
CanCanCan gem에서 메시지를 테스트하는 방법을 찾고 있습니다.Rspec에서 CanCanCan의 메시지를 테스트하는 방법은 무엇입니까?
def my
authorize! :my_words, word, message: I18n.t("messages.login_to_add_new_word")
end
같은 것은?
it "sets flash message" do
expect(message???).to eq I18n.t("messages.login_to_add_new_word")
end
컨트롤러 사양이므로 'my'를 'controller.my'로 변경하면됩니다. 고맙습니다. –