Skip to content

Commit

Permalink
added test and test zip file
Browse files Browse the repository at this point in the history
  • Loading branch information
DevAdm committed Aug 7, 2024
1 parent 832ffb8 commit 3fffc73
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Binary file added test/fixtures/files/zip-file.zip
Binary file not shown.
11 changes: 11 additions & 0 deletions test/system/theses_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,17 @@ class ThesesTest < ApplicationSystemTestCase
assert_selector(".invalid-feedback", text: "Primary file must be a PDF")
end

should "not upload supplmentary document with incorrect file format" do
visit root_url
click_link(@thesis_01.title)

click_on("Upload Supplementary Files")
attach_file("document_file", Rails.root.join('test/fixtures/files/zip-file.zip'))
click_button('Upload')

assert_selector(".invalid-feedback", text: "Supplementary file be valid format")
end

should "be able to upload supplementary document by admin/staff" do
visit root_url
click_link(@thesis_01.title)
Expand Down

0 comments on commit 3fffc73

Please sign in to comment.