package br.com.caelum.brutal.sanitizer;

import static br.com.caelum.brutal.sanitizer.HtmlSanitizer.sanitize;
import static org.junit.Assert.assertEquals;

import org.junit.Assert;
import org.junit.Test;

public class HtmlSanitizerTest {

	@Test
	public void shouldAddNoFollowIntoLinks() {
		String html = "<a href=\"http://www.teste.com.br\">teste</a>";
		String expected = "<a href=\"http://www.teste.com.br\" rel=\"nofollow\">teste</a>";
		String sanitized = sanitize(html);
		assertEquals(expected, sanitized);
	}

}

@@ -510,12 +510,322 @@
 zed);%0A%09%7D
+%0A%09%0A%0A%09@Test%0A%09public void shouldAllowImages() %7B%0A%09%09String html = %22%3Cimg src=%5C%22http://www.teste.com.br%5C%22 alt=%5C%22x%5C%22 width=%5C%225%5C%22 height=%5C%223%5C%22%3E%22;%0A%09%09String expected = %22%3Cimg src=%5C%22http://www.teste.com.br%5C%22 alt=%5C%22x%5C%22 width=%5C%225%5C%22 height=%5C%223%5C%22%3E%22;%0A%09%09String sanitized = sanitize(html);%0A%09%09assertEquals(expected, sanitized);%0A%09%7D
 %0A%0A%7D%0A

test saniztizer