diff --git a/tests/conformance/Authorize/Authorize.bru b/tests/conformance/Authorize/Authorize.bru new file mode 100644 index 0000000..315c472 --- /dev/null +++ b/tests/conformance/Authorize/Authorize.bru @@ -0,0 +1,20 @@ +meta { + name: Authorize + type: http + seq: 1 +} + +get { + url: {{host}}/oauth/authorize +} + +assert { + res.status: eq 307 + res.body: isEmpty + res.headers.location: isDefined + res.headers.location: eq {{authServerUrl}}/oauth/authorize +} + +script:pre-request { + req.setMaxRedirects(0); +} diff --git a/tests/conformance/Authorize/Callback/Authorize Callback Without Query Params.bru b/tests/conformance/Authorize/Callback/Authorize Callback Without Query Params.bru new file mode 100644 index 0000000..13c1a92 --- /dev/null +++ b/tests/conformance/Authorize/Callback/Authorize Callback Without Query Params.bru @@ -0,0 +1,14 @@ +meta { + name: Authorize Callback Without Query Params + type: http + seq: 1 +} + +get { + url: {{host}}/oauth/callback +} + +assert { + res.status: eq 400 + res.headers.location: undefined +} diff --git a/tests/conformance/Authorize/Callback/Authorize Callback.bru b/tests/conformance/Authorize/Callback/Authorize Callback.bru new file mode 100644 index 0000000..2a09a5c --- /dev/null +++ b/tests/conformance/Authorize/Callback/Authorize Callback.bru @@ -0,0 +1,20 @@ +meta { + name: Authorize Callback + type: http + seq: 1 +} + +get { + url: {{host}}/oauth/callback +} + +assert { + res.status: eq 301 + res.body: isEmpty + res.headers.location: isDefined + res.headers.location: eq / +} + +script:pre-request { + req.setMaxRedirects(0); +} diff --git a/tests/conformance/Sessions/Get Sessions/Get Sessions When Set Cookie.bru b/tests/conformance/Sessions/Get Sessions/Get Sessions When Set Cookie.bru new file mode 100644 index 0000000..13a4cb7 --- /dev/null +++ b/tests/conformance/Sessions/Get Sessions/Get Sessions When Set Cookie.bru @@ -0,0 +1,21 @@ +meta { + name: Get Sessions When Set Cookie + type: http + seq: 2 +} + +get { + url: {{host}}/sessions + body: none + auth: none +} + +headers { + Cookie: jwt=test +} + +assert { + res.status: eq 200 + res.body: isJson + res.body.sessions: length 0 +} diff --git a/tests/conformance/Sessions/Get Sessions/Get Sessions.bru b/tests/conformance/Sessions/Get Sessions/Get Sessions.bru new file mode 100644 index 0000000..3cb7692 --- /dev/null +++ b/tests/conformance/Sessions/Get Sessions/Get Sessions.bru @@ -0,0 +1,17 @@ +meta { + name: Get Sessions + type: http + seq: 1 +} + +get { + url: {{host}}/sessions + body: none + auth: none +} + +assert { + res.status: eq 200 + res.body: isJson + res.body.sessions: length 0 +} diff --git a/tests/conformance/Sessions/Has Session.bru b/tests/conformance/Sessions/Has Session.bru new file mode 100644 index 0000000..f578f83 --- /dev/null +++ b/tests/conformance/Sessions/Has Session.bru @@ -0,0 +1,16 @@ +meta { + name: Has Session + type: http + seq: 1 +} + +head { + url: {{host}}/sessions + body: none + auth: none +} + +assert { + res.status: eq 204 + res.body: isEmpty +} diff --git a/tests/conformance/bruno.json b/tests/conformance/bruno.json new file mode 100644 index 0000000..14223d6 --- /dev/null +++ b/tests/conformance/bruno.json @@ -0,0 +1,8 @@ +{ + "version": "1", + "name": "baffao", + "type": "collection", + "ignore": [ + "node_modules" + ] +} \ No newline at end of file diff --git a/tests/conformance/environments/local.bru b/tests/conformance/environments/local.bru new file mode 100644 index 0000000..dd248c3 --- /dev/null +++ b/tests/conformance/environments/local.bru @@ -0,0 +1,4 @@ +vars { + host: http://localhost:3000 + authServerUrl: http://localhost:8080 +}