sets_close_time_examples.rb 424 B

123456789101112131415161718
  1. require 'rails_helper'
  2. RSpec.shared_examples 'TicketSetsCloseTime' do
  3. subject { create(described_class.name.underscore) }
  4. it 'can only be loaded for tickets' do
  5. expect(described_class).to eq Ticket
  6. end
  7. before do
  8. travel_to Time.zone.now
  9. end
  10. it 'resets pending_time seconds' do
  11. subject.update(state: Ticket::State.lookup(name: 'closed'))
  12. expect(subject.close_at).to eq(Time.zone.now)
  13. end
  14. end