闭社主体 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.

31 lines
684 B

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