Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

moved from markbates/willie to gobuffalo/httptest #1244

Merged
merged 2 commits into from
Aug 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN go get -u github.com/golang/dep/cmd/dep \
&& go get -v -u github.com/markbates/grift \
&& go get -v -u github.com/markbates/inflect \
&& go get -v -u github.com/markbates/refresh \
&& go get -v -u github.com/markbates/willie \
&& go get -v -u github.com/gobuffalo/httptest \
&& go get -v -u github.com/gorilla/sessions \
&& go get -v -u golang.org/x/vgo \
&& go get -u github.com/alecthomas/gometalinter \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.slim.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN go get -u github.com/golang/dep/cmd/dep \
&& go get -v -u github.com/markbates/grift \
&& go get -v -u github.com/markbates/inflect \
&& go get -v -u github.com/markbates/refresh \
&& go get -v -u github.com/markbates/willie \
&& go get -v -u github.com/gobuffalo/httptest \
&& go get -v -u github.com/gorilla/sessions \
&& go get -v -u golang.org/x/vgo \
&& go get -u github.com/alecthomas/gometalinter \
Expand Down
124 changes: 119 additions & 5 deletions SHOULDERS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `github.com/gobuffalo/buffalo` Stands on the Shoulders of Giants

`github.com/gobuffalo/buffalo` does not try to reinvent the wheel! Instead, it uses the already great wheels developed by the Go community and puts them altogether in the best way possible. Without these giants this project would not be possible. Please make sure to check them out and thank them for all of their hard work.
`github.com/gobuffalo/buffalo` does not try to reinvent the wheel! Instead, it uses the already great wheels developed by the Go community and puts them all together in the best way possible. Without these giants this project would not be possible. Please make sure to check them out and thank them for all of their hard work.

Thank you to the following **GIANTS**:

Expand Down Expand Up @@ -39,6 +39,8 @@ Thank you to the following **GIANTS**:

* [github.com/gobuffalo/github_flavored_markdown](https://godoc.org/github.com/gobuffalo/github_flavored_markdown)

* [github.com/gobuffalo/httptest](https://godoc.org/github.com/gobuffalo/httptest)

* [github.com/gobuffalo/makr](https://godoc.org/github.com/gobuffalo/makr)

* [github.com/gobuffalo/mw-contenttype](https://godoc.org/github.com/gobuffalo/mw-contenttype)
Expand All @@ -47,8 +49,6 @@ Thank you to the following **GIANTS**:

* [github.com/gobuffalo/mw-paramlogger](https://godoc.org/github.com/gobuffalo/mw-paramlogger)

* [github.com/gobuffalo/mw-poptx](https://godoc.org/github.com/gobuffalo/mw-poptx)

* [github.com/gobuffalo/mw-tokenauth](https://godoc.org/github.com/gobuffalo/mw-tokenauth)

* [github.com/gobuffalo/packr](https://godoc.org/github.com/gobuffalo/packr)
Expand Down Expand Up @@ -95,8 +95,12 @@ Thank you to the following **GIANTS**:

* [github.com/gobuffalo/validate/validators](https://godoc.org/github.com/gobuffalo/validate/validators)

* [github.com/gobuffalo/x/defaults](https://godoc.org/github.com/gobuffalo/x/defaults)

* [github.com/gobuffalo/x/httpx](https://godoc.org/github.com/gobuffalo/x/httpx)

* [github.com/gobuffalo/x/randx](https://godoc.org/github.com/gobuffalo/x/randx)

* [github.com/gorilla/context](https://godoc.org/github.com/gorilla/context)

* [github.com/gorilla/mux](https://godoc.org/github.com/gorilla/mux)
Expand Down Expand Up @@ -127,6 +131,18 @@ Thank you to the following **GIANTS**:

* [github.com/hashicorp/hcl/json/token](https://godoc.org/github.com/hashicorp/hcl/json/token)

* [github.com/hpcloud/tail](https://godoc.org/github.com/hpcloud/tail)

* [github.com/hpcloud/tail/ratelimiter](https://godoc.org/github.com/hpcloud/tail/ratelimiter)

* [github.com/hpcloud/tail/util](https://godoc.org/github.com/hpcloud/tail/util)

* [github.com/hpcloud/tail/vendor/gopkg.in/fsnotify/fsnotify.v1](https://godoc.org/github.com/hpcloud/tail/vendor/gopkg.in/fsnotify/fsnotify.v1)

* [github.com/hpcloud/tail/vendor/gopkg.in/tomb.v1](https://godoc.org/github.com/hpcloud/tail/vendor/gopkg.in/tomb.v1)

* [github.com/hpcloud/tail/watch](https://godoc.org/github.com/hpcloud/tail/watch)

* [github.com/jmoiron/sqlx](https://godoc.org/github.com/jmoiron/sqlx)

* [github.com/jmoiron/sqlx/reflectx](https://godoc.org/github.com/jmoiron/sqlx/reflectx)
Expand All @@ -135,6 +151,8 @@ Thank you to the following **GIANTS**:

* [github.com/kr/pretty](https://godoc.org/github.com/kr/pretty)

* [github.com/kr/text](https://godoc.org/github.com/kr/text)

* [github.com/lib/pq](https://godoc.org/github.com/lib/pq)

* [github.com/lib/pq/oid](https://godoc.org/github.com/lib/pq/oid)
Expand All @@ -149,8 +167,6 @@ Thank you to the following **GIANTS**:

* [github.com/markbates/going/randx](https://godoc.org/github.com/markbates/going/randx)

* [github.com/markbates/going/wait](https://godoc.org/github.com/markbates/going/wait)

* [github.com/markbates/grift/cmd](https://godoc.org/github.com/markbates/grift/cmd)

* [github.com/markbates/grift/grift](https://godoc.org/github.com/markbates/grift/grift)
Expand Down Expand Up @@ -187,8 +203,62 @@ Thank you to the following **GIANTS**:

* [github.com/onsi/ginkgo](https://godoc.org/github.com/onsi/ginkgo)

* [github.com/onsi/ginkgo/config](https://godoc.org/github.com/onsi/ginkgo/config)

* [github.com/onsi/ginkgo/internal/codelocation](https://godoc.org/github.com/onsi/ginkgo/internal/codelocation)

* [github.com/onsi/ginkgo/internal/containernode](https://godoc.org/github.com/onsi/ginkgo/internal/containernode)

* [github.com/onsi/ginkgo/internal/failer](https://godoc.org/github.com/onsi/ginkgo/internal/failer)

* [github.com/onsi/ginkgo/internal/leafnodes](https://godoc.org/github.com/onsi/ginkgo/internal/leafnodes)

* [github.com/onsi/ginkgo/internal/remote](https://godoc.org/github.com/onsi/ginkgo/internal/remote)

* [github.com/onsi/ginkgo/internal/spec](https://godoc.org/github.com/onsi/ginkgo/internal/spec)

* [github.com/onsi/ginkgo/internal/spec_iterator](https://godoc.org/github.com/onsi/ginkgo/internal/spec_iterator)

* [github.com/onsi/ginkgo/internal/specrunner](https://godoc.org/github.com/onsi/ginkgo/internal/specrunner)

* [github.com/onsi/ginkgo/internal/suite](https://godoc.org/github.com/onsi/ginkgo/internal/suite)

* [github.com/onsi/ginkgo/internal/testingtproxy](https://godoc.org/github.com/onsi/ginkgo/internal/testingtproxy)

* [github.com/onsi/ginkgo/internal/writer](https://godoc.org/github.com/onsi/ginkgo/internal/writer)

* [github.com/onsi/ginkgo/reporters](https://godoc.org/github.com/onsi/ginkgo/reporters)

* [github.com/onsi/ginkgo/reporters/stenographer](https://godoc.org/github.com/onsi/ginkgo/reporters/stenographer)

* [github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable](https://godoc.org/github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable)

* [github.com/onsi/ginkgo/types](https://godoc.org/github.com/onsi/ginkgo/types)

* [github.com/onsi/gomega](https://godoc.org/github.com/onsi/gomega)

* [github.com/onsi/gomega/format](https://godoc.org/github.com/onsi/gomega/format)

* [github.com/onsi/gomega/internal/assertion](https://godoc.org/github.com/onsi/gomega/internal/assertion)

* [github.com/onsi/gomega/internal/asyncassertion](https://godoc.org/github.com/onsi/gomega/internal/asyncassertion)

* [github.com/onsi/gomega/internal/oraclematcher](https://godoc.org/github.com/onsi/gomega/internal/oraclematcher)

* [github.com/onsi/gomega/internal/testingtsupport](https://godoc.org/github.com/onsi/gomega/internal/testingtsupport)

* [github.com/onsi/gomega/matchers](https://godoc.org/github.com/onsi/gomega/matchers)

* [github.com/onsi/gomega/matchers/support/goraph/bipartitegraph](https://godoc.org/github.com/onsi/gomega/matchers/support/goraph/bipartitegraph)

* [github.com/onsi/gomega/matchers/support/goraph/edge](https://godoc.org/github.com/onsi/gomega/matchers/support/goraph/edge)

* [github.com/onsi/gomega/matchers/support/goraph/node](https://godoc.org/github.com/onsi/gomega/matchers/support/goraph/node)

* [github.com/onsi/gomega/matchers/support/goraph/util](https://godoc.org/github.com/onsi/gomega/matchers/support/goraph/util)

* [github.com/onsi/gomega/types](https://godoc.org/github.com/onsi/gomega/types)

* [github.com/pelletier/go-toml](https://godoc.org/github.com/pelletier/go-toml)

* [github.com/pkg/errors](https://godoc.org/github.com/pkg/errors)
Expand Down Expand Up @@ -247,20 +317,64 @@ Thank you to the following **GIANTS**:

* [golang.org/x/net/html/atom](https://godoc.org/golang.org/x/net/html/atom)

* [golang.org/x/net/html/charset](https://godoc.org/golang.org/x/net/html/charset)

* [golang.org/x/sync/errgroup](https://godoc.org/golang.org/x/sync/errgroup)

* [golang.org/x/sys/unix](https://godoc.org/golang.org/x/sys/unix)

* [golang.org/x/text/cases](https://godoc.org/golang.org/x/text/cases)

* [golang.org/x/text/encoding](https://godoc.org/golang.org/x/text/encoding)

* [golang.org/x/text/encoding/charmap](https://godoc.org/golang.org/x/text/encoding/charmap)

* [golang.org/x/text/encoding/htmlindex](https://godoc.org/golang.org/x/text/encoding/htmlindex)

* [golang.org/x/text/encoding/internal](https://godoc.org/golang.org/x/text/encoding/internal)

* [golang.org/x/text/encoding/internal/enctest](https://godoc.org/golang.org/x/text/encoding/internal/enctest)

* [golang.org/x/text/encoding/internal/identifier](https://godoc.org/golang.org/x/text/encoding/internal/identifier)

* [golang.org/x/text/encoding/japanese](https://godoc.org/golang.org/x/text/encoding/japanese)

* [golang.org/x/text/encoding/korean](https://godoc.org/golang.org/x/text/encoding/korean)

* [golang.org/x/text/encoding/simplifiedchinese](https://godoc.org/golang.org/x/text/encoding/simplifiedchinese)

* [golang.org/x/text/encoding/traditionalchinese](https://godoc.org/golang.org/x/text/encoding/traditionalchinese)

* [golang.org/x/text/encoding/unicode](https://godoc.org/golang.org/x/text/encoding/unicode)

* [golang.org/x/text/internal](https://godoc.org/golang.org/x/text/internal)

* [golang.org/x/text/internal/gen](https://godoc.org/golang.org/x/text/internal/gen)

* [golang.org/x/text/internal/language](https://godoc.org/golang.org/x/text/internal/language)

* [golang.org/x/text/internal/language/compact](https://godoc.org/golang.org/x/text/internal/language/compact)

* [golang.org/x/text/internal/tag](https://godoc.org/golang.org/x/text/internal/tag)

* [golang.org/x/text/internal/testtext](https://godoc.org/golang.org/x/text/internal/testtext)

* [golang.org/x/text/internal/ucd](https://godoc.org/golang.org/x/text/internal/ucd)

* [golang.org/x/text/internal/utf8internal](https://godoc.org/golang.org/x/text/internal/utf8internal)

* [golang.org/x/text/language](https://godoc.org/golang.org/x/text/language)

* [golang.org/x/text/runes](https://godoc.org/golang.org/x/text/runes)

* [golang.org/x/text/transform](https://godoc.org/golang.org/x/text/transform)

* [golang.org/x/text/unicode/cldr](https://godoc.org/golang.org/x/text/unicode/cldr)

* [golang.org/x/text/unicode/norm](https://godoc.org/golang.org/x/text/unicode/norm)

* [golang.org/x/text/unicode/rangetable](https://godoc.org/golang.org/x/text/unicode/rangetable)

* [gopkg.in/check.v1](https://godoc.org/gopkg.in/check.v1)

* [gopkg.in/russross/blackfriday.v1](https://godoc.org/gopkg.in/russross/blackfriday.v1)
Expand Down
25 changes: 12 additions & 13 deletions default_context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import (
"bytes"
"context"
"net/http"
"net/http/httptest"
"net/url"
"testing"

"github.com/gobuffalo/buffalo/render"
"github.com/markbates/willie"
"github.com/gobuffalo/httptest"
"github.com/pkg/errors"
"github.com/stretchr/testify/require"
)
Expand All @@ -31,8 +30,8 @@ func Test_DefaultContext_Redirect(t *testing.T) {
return c.Redirect(302, u)
})

w := willie.New(a)
res := w.Request("/").Get()
w := httptest.New(a)
res := w.HTML("/").Get()
r.Equal(u, res.Location())
}

Expand Down Expand Up @@ -66,12 +65,12 @@ func Test_DefaultContext_Redirect_Helper(t *testing.T) {
return c.Redirect(302, "rootPath()")
})

w := willie.New(a)
res := w.Request("/").Get()
w := httptest.New(a)
res := w.HTML("/").Get()
r.Equal(tt.S, res.Code)
r.Equal(tt.E, res.Location())

res = w.Request("/nomap").Get()
res = w.HTML("/nomap").Get()
r.Equal(302, res.Code)
r.Equal("/", res.Location())
}
Expand All @@ -98,7 +97,7 @@ func Test_DefaultContext_Param_form(t *testing.T) {
return nil
})

w := willie.New(app)
w := httptest.New(app)
res := w.HTML("/").Post(map[string]string{
"name": "Mark",
})
Expand Down Expand Up @@ -160,9 +159,9 @@ func Test_DefaultContext_Bind_Default(t *testing.T) {
return c.Render(201, nil)
})

w := willie.New(a)
w := httptest.New(a)
uv := url.Values{"first_name": []string{"Mark"}}
res := w.Request("/").Post(uv)
res := w.HTML("/").Post(uv)
r.Equal(201, res.Code)

r.Equal("Mark", user.FirstName)
Expand Down Expand Up @@ -243,9 +242,9 @@ func Test_DefaultContext_Bind_Default_BlankFields(t *testing.T) {
return c.Render(201, nil)
})

w := willie.New(a)
w := httptest.New(a)
uv := url.Values{"first_name": []string{""}}
res := w.Request("/").Post(uv)
res := w.HTML("/").Post(uv)
r.Equal(201, res.Code)

r.Equal("", user.FirstName)
Expand All @@ -267,7 +266,7 @@ func Test_DefaultContext_Bind_JSON(t *testing.T) {
return c.Render(201, nil)
})

w := willie.New(a)
w := httptest.New(a)
res := w.JSON("/").Post(map[string]string{
"first_name": "Mark",
})
Expand Down
7 changes: 4 additions & 3 deletions errors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package buffalo
import (
"testing"

"github.com/markbates/willie"
"github.com/gobuffalo/httptest"

"github.com/pkg/errors"
"github.com/stretchr/testify/require"
)
Expand All @@ -15,7 +16,7 @@ func Test_defaultErrorHandler_SetsContentType(t *testing.T) {
return c.Error(401, errors.New("boom"))
})

w := willie.New(app)
w := httptest.New(app)
res := w.HTML("/").Get()
r.Equal(401, res.Code)
ct := res.Header().Get("content-type")
Expand All @@ -41,7 +42,7 @@ func Test_PanicHandler(t *testing.T) {

const stack = `github.com/gobuffalo/buffalo.(*App).PanicHandler`

w := willie.New(app)
w := httptest.New(app)
for _, tt := range table {
t.Run(tt.path, func(st *testing.T) {
r := require.New(st)
Expand Down
22 changes: 11 additions & 11 deletions flash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"github.com/gobuffalo/buffalo/render"
"github.com/markbates/willie"
"github.com/gobuffalo/httptest"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -37,8 +37,8 @@ func Test_FlashRender(t *testing.T) {
return c.Render(201, rr.String(errorsTPL))
})

w := willie.New(a)
res := w.Request("/").Get()
w := httptest.New(a)
res := w.HTML("/").Get()

r.Contains(res.Body.String(), "Error AJ set")
r.Contains(res.Body.String(), "Error DAL set")
Expand All @@ -53,9 +53,9 @@ func Test_FlashRenderEmpty(t *testing.T) {
return c.Render(201, rr.String(errorsTPL))
})

w := willie.New(a)
w := httptest.New(a)

res := w.Request("/").Get()
res := w.HTML("/").Get()
r.NotContains(res.Body.String(), "Flash:")
}

Expand All @@ -76,8 +76,8 @@ func Test_FlashRenderEntireFlash(t *testing.T) {
return c.Render(201, rr.String(keyTPL))
})

w := willie.New(a)
res := w.Request("/").Get()
w := httptest.New(a)
res := w.HTML("/").Get()
r.Contains(res.Body.String(), "something to say!")
}

Expand All @@ -97,8 +97,8 @@ func Test_FlashRenderCustomKey(t *testing.T) {
return c.Render(201, rr.String(keyTPL))
})

w := willie.New(a)
res := w.Request("/").Get()
w := httptest.New(a)
res := w.HTML("/").Get()
r.Contains(res.Body.String(), "something to say!")
}

Expand All @@ -111,8 +111,8 @@ func Test_FlashRenderCustomKeyNotDefined(t *testing.T) {
return c.Render(201, rr.String(customKeyTPL))
})

w := willie.New(a)
res := w.Request("/").Get()
w := httptest.New(a)
res := w.HTML("/").Get()
r.NotContains(res.Body.String(), "something to say!")
}

Expand Down
Loading