문제

I am writing a testing script using Ruby and Rails. I have to validate whether proper keyword is highlighted or not. How do i do in rub. For eg. "confidential" is my keyword and want to validate whether it got highlighted or not.

도움이 되었습니까?

해결책

Assuming you highlight your keyword with <em>-tags and have a HighLighter class that does the highlighting:

assert_contains "<em>confidential</em>", HighLighter.highlight(text)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top