trabajo-afectivo/spec/models/ticket/sets_close_time_examples.rb

21 lines
501 B
Ruby
Raw Normal View History

2022-01-01 13:38:12 +00:00
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
require 'rails_helper'
RSpec.shared_examples 'TicketSetsCloseTime' do
subject { create(described_class.name.underscore) }
it 'can only be loaded for tickets' do
expect(described_class).to eq Ticket
end
before do
travel_to Time.zone.now
end
it 'resets pending_time seconds' do
subject.update(state: Ticket::State.lookup(name: 'closed'))
expect(subject.close_at).to eq(Time.zone.now)
end
end