闭社主体 forked from https://github.com/tootsuite/mastodon
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.

33 lines
770 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. end
  14. config.before :each do
  15. stub_request(:post, 'https://fcm.googleapis.com/fcm/send').to_return(status: 200, body: '')
  16. end
  17. config.after :suite do
  18. FileUtils.rm_rf(Dir["#{Rails.root}/spec/test_files/"])
  19. end
  20. end
  21. def body_as_json
  22. json_str_to_hash(response.body)
  23. end
  24. def json_str_to_hash(str)
  25. JSON.parse(str, symbolize_names: true)
  26. end