spec_helper.rb 557 B

123456789101112131415161718192021222324252627
  1. require 'simplecov'
  2. SimpleCov.start 'rails' do
  3. add_group "Services", "app/services"
  4. end
  5. RSpec.configure do |config|
  6. config.expect_with :rspec do |expectations|
  7. expectations.include_chain_clauses_in_custom_matcher_descriptions = true
  8. end
  9. config.mock_with :rspec do |mocks|
  10. mocks.verify_partial_doubles = true
  11. end
  12. config.after(:suite) do
  13. FileUtils.rm_rf(Dir["#{Rails.root}/spec/test_files/"])
  14. end
  15. end
  16. def body_as_json
  17. json_str_to_hash(response.body)
  18. end
  19. def json_str_to_hash(str)
  20. JSON.parse(str, symbolize_names: true)
  21. end