Skip to content

Commit 93f8ed8

Browse files
committed
Update test auth to admin for assets
1 parent 66b5b4c commit 93f8ed8

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

test/cadet_web/admin_controllers/admin_assets_controller_test.exs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ defmodule CadetWeb.AdminAssetsControllerTest do
6868
end
6969
end
7070

71-
describe "read-only permission for staff" do
71+
describe "read-only permission for non-admin staff" do
7272
@tag authenticate: :staff
7373
test "GET /assets/:foldername", %{conn: conn} do
7474
course_id = conn.assigns.course_id
@@ -98,22 +98,22 @@ defmodule CadetWeb.AdminAssetsControllerTest do
9898
end
9999

100100
describe "inaccessible folder name" do
101-
@tag authenticate: :staff
101+
@tag authenticate: :admin
102102
test "index files", %{conn: conn} do
103103
course_id = conn.assigns.course_id
104104
conn = get(conn, build_url(course_id, "wrongFolder"))
105105
assert response(conn, 400) =~ "Invalid top-level folder name"
106106
end
107107

108-
@tag authenticate: :staff
108+
@tag authenticate: :admin
109109
test "delete file", %{conn: conn} do
110110
course_id = conn.assigns.course_id
111111
conn = delete(conn, build_url(course_id, "wrongFolder/randomFile"))
112112

113113
assert response(conn, 400) =~ "Invalid top-level folder name"
114114
end
115115

116-
@tag authenticate: :staff
116+
@tag authenticate: :admin
117117
test "upload file", %{conn: conn} do
118118
course_id = conn.assigns.course_id
119119

@@ -127,7 +127,7 @@ defmodule CadetWeb.AdminAssetsControllerTest do
127127
end
128128

129129
describe "ok request" do
130-
@tag authenticate: :staff, course_id: 117
130+
@tag authenticate: :admin, course_id: 117
131131
test "index file", %{conn: conn} do
132132
course_id = conn.assigns.course_id
133133

@@ -139,7 +139,7 @@ defmodule CadetWeb.AdminAssetsControllerTest do
139139
end
140140
end
141141

142-
@tag authenticate: :staff, course_id: 117
142+
@tag authenticate: :admin, course_id: 117
143143
test "delete file", %{conn: conn} do
144144
course_id = conn.assigns.course_id
145145

@@ -150,7 +150,7 @@ defmodule CadetWeb.AdminAssetsControllerTest do
150150
end
151151
end
152152

153-
@tag authenticate: :staff, course_id: 117
153+
@tag authenticate: :admin, course_id: 117
154154
test "upload file", %{conn: conn} do
155155
course_id = conn.assigns.course_id
156156

@@ -167,7 +167,7 @@ defmodule CadetWeb.AdminAssetsControllerTest do
167167
end
168168

169169
describe "wrong file type" do
170-
@tag authenticate: :staff
170+
@tag authenticate: :admin
171171
test "upload file", %{conn: conn} do
172172
course_id = conn.assigns.course_id
173173

@@ -181,7 +181,7 @@ defmodule CadetWeb.AdminAssetsControllerTest do
181181
end
182182

183183
describe "empty file name" do
184-
@tag authenticate: :staff
184+
@tag authenticate: :admin
185185
test "upload file", %{conn: conn} do
186186
course_id = conn.assigns.course_id
187187

@@ -193,7 +193,7 @@ defmodule CadetWeb.AdminAssetsControllerTest do
193193
assert response(conn, 400) =~ "Empty file name"
194194
end
195195

196-
@tag authenticate: :staff
196+
@tag authenticate: :admin
197197
test "delete file", %{conn: conn} do
198198
course_id = conn.assigns.course_id
199199
conn = delete(conn, build_url(course_id, "testFolder"))
@@ -202,7 +202,7 @@ defmodule CadetWeb.AdminAssetsControllerTest do
202202
end
203203

204204
describe "nested filename request" do
205-
@tag authenticate: :staff, course_id: 117
205+
@tag authenticate: :admin, course_id: 117
206206
test "delete file", %{conn: conn} do
207207
course_id = conn.assigns.course_id
208208

@@ -213,7 +213,7 @@ defmodule CadetWeb.AdminAssetsControllerTest do
213213
end
214214
end
215215

216-
@tag authenticate: :staff, course_id: 117
216+
@tag authenticate: :admin, course_id: 117
217217
test "upload file", %{conn: conn} do
218218
course_id = conn.assigns.course_id
219219

@@ -230,7 +230,7 @@ defmodule CadetWeb.AdminAssetsControllerTest do
230230
end
231231

232232
describe "course with custom assets_prefix" do
233-
@tag authenticate: :staff, course_id: 117
233+
@tag authenticate: :admin, course_id: 117
234234
test "index file", %{conn: conn} do
235235
course_id = conn.assigns.course_id
236236

@@ -244,7 +244,7 @@ defmodule CadetWeb.AdminAssetsControllerTest do
244244
end
245245
end
246246

247-
@tag authenticate: :staff, course_id: 117
247+
@tag authenticate: :admin, course_id: 117
248248
test "delete file", %{conn: conn} do
249249
course_id = conn.assigns.course_id
250250

@@ -257,7 +257,7 @@ defmodule CadetWeb.AdminAssetsControllerTest do
257257
end
258258
end
259259

260-
@tag authenticate: :staff, course_id: 117
260+
@tag authenticate: :admin, course_id: 117
261261
test "upload file", %{conn: conn} do
262262
course_id = conn.assigns.course_id
263263

0 commit comments

Comments
 (0)