Pergunta

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.

Foi útil?

Solução

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)
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top