Retrospring/spec/shared_examples/data_export.rb

18 lines
379 B
Ruby
Raw Normal View History

2022-12-09 18:28:17 -08:00
# frozen_string_literal: true
require "json"
RSpec.shared_context "DataExport" do
let(:user_params) { {} }
let!(:user) { FactoryBot.create(:user, **user_params) }
subject { described_class.call(user:) }
def json_file(filename) = JSON.parse(subject[filename], symbolize_names: true)
end
RSpec.configure do |c|
c.include_context "DataExport", data_export: true
end