Skip to content

Commit a7353a7

Browse files
committed
chore: minor fixes to tests and schema post merge
1 parent 70ee4c4 commit a7353a7

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

app/models/role.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ def self.find(id)
88
end
99
end
1010

11+
def self.teaching_staff_ids
12+
[self.tutor_id, self.convenor_id, self.admin_id, self.auditor_id]
13+
end
14+
1115
def self.student
1216
Role.find(student_id)
1317
end

db/schema.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema[7.0].define(version: 2024_05_28_223908) do
13+
ActiveRecord::Schema[7.1].define(version: 2024_05_28_223908) do
1414
create_table "activity_types", charset: "utf8", collation: "utf8_unicode_ci", force: :cascade do |t|
1515
t.string "name", null: false
1616
t.string "abbreviation", null: false

test/api/projects_api_test.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ def test_download_portfolio
164164

165165
get "/api/submission/project/#{project.id}/portfolio", data_to_put
166166
assert_equal 200, last_response.status
167-
assert last_response.header['Content-Disposition'].starts_with?('attachment; filename=')
168-
assert last_response.header['Access-Control-Expose-Headers'] == 'Content-Disposition'
169-
assert last_response.header['Content-Type'] == 'application/pdf'
167+
assert last_response.headers['Content-Disposition'].starts_with?('attachment; filename=')
168+
assert last_response.headers['Access-Control-Expose-Headers'] == 'Content-Disposition'
169+
assert last_response.headers['Content-Type'] == 'application/pdf'
170170
assert 10_485_760, last_response.length
171171

172172
`fallocate -l 11M #{project.portfolio_path}`
@@ -184,9 +184,9 @@ def test_download_portfolio
184184
get "/api/submission/project/#{project.id}/portfolio", data_to_put
185185
assert 500, last_response.length
186186
assert_equal 206, last_response.status
187-
assert_nil last_response.header['Content-Disposition']
188-
assert_nil last_response.header['Access-Control-Expose-Headers']
189-
assert last_response.header['Content-Type'] == 'application/pdf'
187+
assert_nil last_response.headers['Content-Disposition']
188+
assert_nil last_response.headers['Access-Control-Expose-Headers']
189+
assert last_response.headers['Content-Type'] == 'application/pdf'
190190

191191
unit.destroy!
192192
ensure

test/models/task_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ def test_ipynb_to_pdf
360360

361361
# Test if latex math was rendered properly
362362
reader = PDF::Reader.new(task.final_pdf_path)
363-
assert reader.pages.last.text.include? "BMI: bmi = weigh2\n height"
363+
assert reader.pages.last.text.include?("weight\n")
364364

365365
# ensure the notice is not included when the notebook doesn't have long lines source code cells
366366
# and no errors

0 commit comments

Comments
 (0)