sets_close_time_examples.rb 489 B

1234567891011121314151617181920
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.shared_examples 'TicketSetsCloseTime' do
  4. subject { create(described_class.name.underscore) }
  5. it 'can only be loaded for tickets' do
  6. expect(described_class).to eq Ticket
  7. end
  8. before do
  9. freeze_time
  10. end
  11. it 'resets pending_time seconds' do
  12. subject.update(state: Ticket::State.lookup(name: 'closed'))
  13. expect(subject.close_at).to eq(Time.zone.now)
  14. end
  15. end