package org.mycompany.views;
import java.util.ArrayList;
import java.util.List;
import models.Task;
import org.junit.Test;
import play.mvc.Content;
import static org.fest.assertions.Assertions.assertThat;
import static play.test.Helpers.*;
/**
* see https://github.com/jamesward/play2torial/blob/master/JAVA.md#test-a-view
*
*/
public class IndexTest {
@Test
public void indexTemplate() {
List<Task> items = new ArrayList<Task>();
Task dummyTask = new Task();
dummyTask.id = 0L;
items.add(dummyTask);
Content html = views.html.index.render(items);
assertThat(contentType(html)).isEqualTo("text/html");
assertThat(contentAsString(html)).contains("Task List: 1");
}
}