history_examples.rb 639 B

123456789101112131415161718192021
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. def history_from_json(file, zammad_structure)
  4. expect(History).to receive(:add).with(zammad_structure)
  5. described_class.new(load_history_json(file))
  6. end
  7. def load_history_json(file)
  8. json_fixture("import/otrs/history/#{file}")
  9. end
  10. RSpec.shared_examples 'Import::OTRS::History' do
  11. it 'responds to init_callback' do
  12. expect(History).to receive(:add)
  13. allow(History::Attribute).to receive(:exists?).and_return(true)
  14. blank_instance = described_class.new({})
  15. expect(blank_instance).to respond_to('init_callback')
  16. end
  17. end