Skip to content

Instantly share code, notes, and snippets.

View jasongonzales23's full-sized avatar

Jason jasongonzales23

  • DevZero
  • San Francisco, CA
View GitHub Profile
import org.codehaus.groovy.grails.web.json.JSONObject;
import grails.converters.JSON;
import groovy.util.GroovyTestCase;
import org.springframework.mock.web.MockHttpServletResponse;
public class UserServiceTests extends GroovyTestCase {
@jasongonzales23
jasongonzales23 / GSP_tests.markdown
Created August 2, 2012 19:34
Testing GSP's with GroovyPagesTestCase

`import grails.test.GroovyPagesTestCase

class ReceiptAttacherTest extends GroovyPagesTestCase {

def lineItemModelService
def receiptService

void testAttachReceiptFromCreateOrItemizeModal_AttachmentShouldOpenInNewWindow() { //given def file = new File("grails-app/views/receipt/_drawerReceipt.gsp")

@jasongonzales23
jasongonzales23 / GSP_tests.markdown
Created August 2, 2012 19:35
Testing GSP's with GroovyPagesTestCase

Here's what it looks like

`import grails.test.GroovyPagesTestCase

class ReceiptAttacherTest extends GroovyPagesTestCase {

def lineItemModelService
def receiptService
@jasongonzales23
jasongonzales23 / GSP_tests.markdown
Created August 2, 2012 19:35
Testing GSP's with GroovyPagesTestCase

Here's what it looks like

`import grails.test.GroovyPagesTestCase class ReceiptAttacherTest extends GroovyPagesTestCase { def lineItemModelService def receiptService void testAttachReceiptFromCreateOrItemizeModal_AttachmentShouldOpenInNewWindow() { //given def file = new File("grails-app/views/receipt/_drawerReceipt.gsp")

@jasongonzales23
jasongonzales23 / GSP_tests.markdown
Created August 2, 2012 19:36
Testing GSP's with GroovyPagesTestCase

Here's what it looks like

import grails.test.GroovyPagesTestCase class ReceiptAttacherTest extends GroovyPagesTestCase { def lineItemModelService def receiptService void testAttachReceiptFromCreateOrItemizeModal_AttachmentShouldOpenInNewWindow() { //given def file = new File("grails-app/views/receipt/_drawerReceipt.gsp")

@jasongonzales23
jasongonzales23 / GSP_tests.markdown
Created August 2, 2012 19:36
Testing GSP's with GroovyPagesTestCase

Here's what it looks like

import grails.test.GroovyPagesTestCase class ReceiptAttacherTest extends GroovyPagesTestCase { def lineItemModelService def receiptService void testAttachReceiptFromCreateOrItemizeModal_AttachmentShouldOpenInNewWindow() { //given ` def file = new File("grails-app/views/receipt/_drawerReceipt.gsp")

@jasongonzales23
jasongonzales23 / GSP_tests.markdown
Created August 2, 2012 19:37
Testing GSP's with GroovyPagesTestCase

Here's what it looks like

import grails.test.GroovyPagesTestCase class ReceiptAttacherTest extends GroovyPagesTestCase { def lineItemModelService def receiptService void testAttachReceiptFromCreateOrItemizeModal_AttachmentShouldOpenInNewWindow() { //given def file = new File("grails-app/views/receipt/_drawerReceipt.gsp")

@jasongonzales23
jasongonzales23 / GSP_tests.markdown
Created August 2, 2012 19:39
Testing GSP's with GroovyPagesTestCase

Here's what it looks like

/* RC_LEGAL_LEGEND */

import grails.test.GroovyPagesTestCase

class ReceiptAttacherTest extends GroovyPagesTestCase {

def lineItemModelService

@jasongonzales23
jasongonzales23 / GSP_tests.markdown
Created August 2, 2012 19:44
Testing GSP's with GroovyPagesTestCase

Overview

*Unit vs. Integration Tests *Why and When to Test? *Anatomy of a Test *Assertions *Passing Models

Here's what an integration test looks like

@jasongonzales23
jasongonzales23 / GSP_tests.md
Created August 2, 2012 20:27
Testing GSP's with GroovyPagesTestCase

Overview

  • About Me
  • These are Integration Tests
  • How I Think About Tests
  • Anatomy of a Test
  • Assertions
  • Passing Models
  • Running the Test