You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
829 B

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