@@ -38,6 +38,7 @@ func TestListEnvironments(t *testing.T) {
3838 {
3939 "id": 1,
4040 "name": "review/fix-foo",
41+ "description": "test",
4142 "slug": "review-fix-foo-dfjre3",
4243 "external_url": "https://review-fix-foo-dfjre3.example.gitlab.com",
4344 "state": "stopped",
@@ -75,6 +76,7 @@ func TestListEnvironments(t *testing.T) {
7576 ID : 1 ,
7677 Name : "review/fix-foo" ,
7778 Slug : "review-fix-foo-dfjre3" ,
79+ Description : "test" ,
7880 ExternalURL : "https://review-fix-foo-dfjre3.example.gitlab.com" ,
7981 State : "stopped" ,
8082 CreatedAt : & createdAtWant ,
@@ -109,6 +111,7 @@ func TestGetEnvironment(t *testing.T) {
109111 fmt .Fprint (w , `{
110112 "id": 1,
111113 "name": "review/fix-foo",
114+ "description": "test",
112115 "slug": "review-fix-foo-dfjre3",
113116 "external_url": "https://review-fix-foo-dfjre3.example.gitlab.com",
114117 "state": "stopped",
@@ -145,6 +148,7 @@ func TestGetEnvironment(t *testing.T) {
145148 ID : 1 ,
146149 Name : "review/fix-foo" ,
147150 Slug : "review-fix-foo-dfjre3" ,
151+ Description : "test" ,
148152 ExternalURL : "https://review-fix-foo-dfjre3.example.gitlab.com" ,
149153 State : "stopped" ,
150154 CreatedAt : & createdAtWant ,
@@ -180,6 +184,7 @@ func TestCreateEnvironment(t *testing.T) {
180184 fmt .Fprint (w , `{
181185 "id": 1,
182186 "name": "deploy",
187+ "description": "test",
183188 "slug": "deploy",
184189 "external_url": "https://deploy.example.gitlab.com",
185190 "tier": "production",
@@ -205,6 +210,7 @@ func TestCreateEnvironment(t *testing.T) {
205210
206211 envs , _ , err := client .Environments .CreateEnvironment (1 , & CreateEnvironmentOptions {
207212 Name : Ptr ("deploy" ),
213+ Description : Ptr ("test" ),
208214 ExternalURL : Ptr ("https://deploy.example.gitlab.com" ),
209215 Tier : Ptr ("production" ),
210216 ClusterAgentID : Ptr (1 ),
@@ -220,6 +226,7 @@ func TestCreateEnvironment(t *testing.T) {
220226 ID : 1 ,
221227 Name : "deploy" ,
222228 Slug : "deploy" ,
229+ Description : "test" ,
223230 ExternalURL : "https://deploy.example.gitlab.com" ,
224231 Tier : "production" ,
225232 ClusterAgent : & Agent {
@@ -253,6 +260,7 @@ func TestEditEnvironment(t *testing.T) {
253260 fmt .Fprint (w , `{
254261 "id": 1,
255262 "name": "staging",
263+ "description": "test",
256264 "slug": "staging",
257265 "external_url": "https://staging.example.gitlab.com",
258266 "tier": "staging",
@@ -278,6 +286,7 @@ func TestEditEnvironment(t *testing.T) {
278286
279287 envs , _ , err := client .Environments .EditEnvironment (1 , 1 , & EditEnvironmentOptions {
280288 Name : Ptr ("staging" ),
289+ Description : Ptr ("test" ),
281290 ExternalURL : Ptr ("https://staging.example.gitlab.com" ),
282291 Tier : Ptr ("staging" ),
283292 ClusterAgentID : Ptr (1 ),
@@ -293,6 +302,7 @@ func TestEditEnvironment(t *testing.T) {
293302 ID : 1 ,
294303 Name : "staging" ,
295304 Slug : "staging" ,
305+ Description : "test" ,
296306 ExternalURL : "https://staging.example.gitlab.com" ,
297307 Tier : "staging" ,
298308 ClusterAgent : & Agent {
@@ -356,6 +366,7 @@ func TestUnmarshal(t *testing.T) {
356366 {
357367 "id": 10,
358368 "name": "production",
369+ "description": "test",
359370 "slug": "production",
360371 "external_url": "https://example.com",
361372 "project": {
@@ -396,6 +407,7 @@ func TestUnmarshal(t *testing.T) {
396407 if assert .NoError (t , err ) {
397408 assert .Equal (t , 10 , env .ID )
398409 assert .Equal (t , "production" , env .Name )
410+ assert .Equal (t , "test" , env .Description )
399411 assert .Equal (t , "https://example.com" , env .ExternalURL )
400412 assert .Equal (t , "available" , env .State )
401413 if assert .NotNil (t , env .Project ) {
0 commit comments