history_examples.rb 584 B

1234567891011121314151617181920
  1. require 'rails_helper'
  2. require 'history'
  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(:find_by).and_return(true)
  14. blank_instance = described_class.new({})
  15. expect(blank_instance).to respond_to('init_callback')
  16. end
  17. end