trabajo-afectivo/spec/lib/import/otrs/history_examples.rb
Thorsten Eckel ca56de3648 Maintenance: Updated to Rails 6.0.4 and the new Zeitwerk autoloader.
This changes the minimum supported version of PostgreSQL to 9.3.
2021-06-23 11:35:27 +00:00

21 lines
642 B
Ruby

# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
require 'rails_helper'
def history_from_json(file, zammad_structure)
expect(History).to receive(:add).with(zammad_structure)
described_class.new(load_history_json(file))
end
def load_history_json(file)
json_fixture("import/otrs/history/#{file}")
end
RSpec.shared_examples 'Import::OTRS::History' do
it 'responds to init_callback' do
expect(::History).to receive(:add)
allow(::History::Attribute).to receive(:exists?).and_return(true)
blank_instance = described_class.new({})
expect(blank_instance).to respond_to('init_callback')
end
end