Package org.mycompany.views

Source Code of org.mycompany.views.IndexTest

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");
    }
 
}
TOP

Related Classes of org.mycompany.views.IndexTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.