mirror of https://github.com/docusealco/docuseal
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
833 B
27 lines
833 B
# 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, completed_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
|