@@ -111,6 +111,7 @@ class UserAllowListDeleteControllerSpec extends AnyFreeSpec with Matchers with S
111111 " feature" -> " feature" ,
112112 " values" -> " a,b"
113113 )
114+ .withHeaders(" Content-Type" -> " application/x-www-form-urlencoded" )
114115 val result = route(app, request).value
115116 status(result) mustBe SEE_OTHER
116117 redirectLocation(result).value mustEqual routes.ServiceSummaryController .onPageLoad(" service" ).url
@@ -128,6 +129,7 @@ class UserAllowListDeleteControllerSpec extends AnyFreeSpec with Matchers with S
128129 " feature" -> " feature" ,
129130 " values" -> " a"
130131 )
132+ .withHeaders(" Content-Type" -> " application/x-www-form-urlencoded" )
131133 val result = route(app, request).value
132134 status(result) mustBe SEE_OTHER
133135 redirectLocation(result).value mustEqual routes.ServiceSummaryController .onPageLoad(" service" ).url
@@ -140,6 +142,7 @@ class UserAllowListDeleteControllerSpec extends AnyFreeSpec with Matchers with S
140142 val request = FakeRequest (POST , routes.UserAllowListDeleteController .onSubmit(" service" ).url)
141143 .withSession(" authToken" -> " Token some-token" )
142144 .withFormUrlEncodedBody()
145+ .withHeaders(" Content-Type" -> " application/x-www-form-urlencoded" )
143146 val result = route(app, request).value
144147 val view = app.injector.instanceOf[UserAllowListDeleteView ]
145148 status(result) mustBe BAD_REQUEST
@@ -156,12 +159,14 @@ class UserAllowListDeleteControllerSpec extends AnyFreeSpec with Matchers with S
156159 " feature" -> " feature" ,
157160 " values" -> " a,b"
158161 )
162+ .withHeaders(" Content-Type" -> " application/x-www-form-urlencoded" )
159163 route(app, request).value.failed.futureValue
160164 }
161165 }
162166
163167 " must fail when the user is not authenticated" in {
164- val request = FakeRequest (POST , routes.UserAllowListDeleteController .onSubmit(" service" ).url) // no auth token
168+ val request = FakeRequest (POST , routes.UserAllowListDeleteController .onSubmit(" service" ).url)
169+ .withHeaders(" Content-Type" -> " application/x-www-form-urlencoded" )// no auth token
165170 val result = route(app, request).value
166171 status(result) mustBe SEE_OTHER
167172 }
@@ -170,6 +175,7 @@ class UserAllowListDeleteControllerSpec extends AnyFreeSpec with Matchers with S
170175 when(mockStubBehaviour.stubAuth[String ](any(), any())).thenReturn(Future .failed(new RuntimeException ()))
171176 val request = FakeRequest (POST , routes.UserAllowListDeleteController .onSubmit(" service" ).url)
172177 .withSession(" authToken" -> " Token some-token" )
178+ .withHeaders(" Content-Type" -> " application/x-www-form-urlencoded" )
173179 route(app, request).value.failed.futureValue
174180 }
175181 }
0 commit comments