make possible to unarchive completed submission

This commit is contained in:
Alex Turchyn
2026-07-01 18:23:57 +03:00
committed by Pete Matsyburka
parent 65bcbd7737
commit 6314987e69
3 changed files with 59 additions and 20 deletions
+25
View File
@@ -0,0 +1,25 @@
# frozen_string_literal: true
RSpec.describe 'Submission' do
let(:account) { create(:account) }
let(:user) { create(:user, account:) }
let(:template) { create(:template, account:, author: user) }
let(:submission) do
create(:submission, :with_submitters, template:, created_by_user: user, archived_at: Time.current)
end
before do
sign_in(user)
submission.submitters.each { |s| s.update!(completed_at: 1.day.ago) }
end
it 'unarchives a completed submission from the download dropdown' do
visit submission_path(submission)
find('label[aria-label="Download"]').click
click_button 'Unarchive'
expect(page).to have_content('Submission has been unarchived.')
expect(submission.reload.archived_at).to be_nil
end
end