Skip to content

Commit

Permalink
chore: minor fixes to tests and schema post merge
Browse files Browse the repository at this point in the history
  • Loading branch information
macite committed Jun 6, 2024
1 parent 70ee4c4 commit a7353a7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions app/models/role.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ def self.find(id)
end
end

def self.teaching_staff_ids
[self.tutor_id, self.convenor_id, self.admin_id, self.auditor_id]
end

def self.student
Role.find(student_id)
end
Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2024_05_28_223908) do
ActiveRecord::Schema[7.1].define(version: 2024_05_28_223908) do
create_table "activity_types", charset: "utf8", collation: "utf8_unicode_ci", force: :cascade do |t|
t.string "name", null: false
t.string "abbreviation", null: false
Expand Down
12 changes: 6 additions & 6 deletions test/api/projects_api_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ def test_download_portfolio

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

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

unit.destroy!
ensure
Expand Down
2 changes: 1 addition & 1 deletion test/models/task_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def test_ipynb_to_pdf

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

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

0 comments on commit a7353a7

Please sign in to comment.