File size: 2,359 Bytes
36b3cb8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
diff --git a/api/tests/unit/application/organizations/index_test.js b/api/tests/unit/application/organizations/index_test.js
index 7617d3b3ca3..070ae31847e 100644
--- a/api/tests/unit/application/organizations/index_test.js
+++ b/api/tests/unit/application/organizations/index_test.js
@@ -26,10 +26,10 @@ describe('Unit | Router | organization-router', () => {
 
   describe('GET /api/organizations', () => {
 
-    it('should exist', async () => {
+    it('should return OK (200) when request is valid', async () => {
       // given
       const method = 'GET';
-      const url = '/api/organizations?filter[name]=DRA&filter[type]=AZ&filter[type]=SCO&page[number]=3&page[size]=25';
+      const url = '/api/organizations?filter[id]=&filter[name]=DRA&filter[type]=SCO&page[number]=3&page[size]=25';
 
       // when
       const response = await httpTestServer.request(method, url);
@@ -37,6 +37,19 @@ describe('Unit | Router | organization-router', () => {
       // then
       expect(response.statusCode).to.equal(200);
     });
+
+    it('should return BadRequest (400) when request is invalid', async () => {
+
+      const method = 'GET';
+      const idNotNumeric = 'foo';
+      const url = `/api/organizations?filter[id]=${idNotNumeric}`;
+
+
+      const response = await httpTestServer.request(method, url);
+
+
+      expect(response.statusCode).to.equal(400);
+    });
   });
 
   describe('POST /api/organizations/{id}/invitations', () => {
diff --git a/mimo_build_env.tar.gz.b64 b/mimo_build_env.tar.gz.b64
new file mode 100644
--- /dev/null
+++ b/mimo_build_env.tar.gz.b64
@@ -0,0 +1,6 @@
+H4sIAAAAAAAAA+3SQU+DMBgGYM77FTWeRweBceKAGTczE4dem0Ibqdla0haz+OvtOKgx0V22LIvv
+c/kK/Voa3sbtqLaCSf1Go3NZBEWeTzX4WadxkqdJssyyrAh9YZSkEcnPdqJvRue5JSSyxvi/+o7N
+X6n4K38vnWed2e24FrHrT/eNY/mnafGZ/yLNQv7ZMskjsjjdEX73z/O/vaGt0rTlrp91gkyXoJWC
+8kHN1g+rmtXr5/LwkjT1pmGrqqnuqk3Nnh7vy5YLNtot0cOe7EzXczKfy73yoVg5GOulLYXx5LDc
+0VErH7YdtqrjXhlNjX3hWr1PD44qLeSeHVrjVze79G8BAAAAAAAAAAAAAAAAAAAAALgKH3/Xkb4A
+KAAA
diff --git a/mimo_test_command.sh b/mimo_test_command.sh
new file mode 100755
--- /dev/null
+++ b/mimo_test_command.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+set -uo pipefail
+cd /testbed || exit 1
+base64 -d mimo_build_env.tar.gz.b64 | tar -xzf - -C /testbed || exit 1
+exec bash -lc 'cd /testbed && bash -eo pipefail /testbed/.build_env/test_command.sh'