I'm using Rails 6 with Grape and I don't know why my specs without any reason began to return such an error
An error occurred while loading ./spec/controllers/health_check_spec.rb.
Failure/Error: require File.expand_path('../config/environment', __dir__)
ActiveSupport::MessageEncryptor::InvalidMessage:
ActiveSupport::MessageEncryptor::InvalidMessage
Which is super weird because I had no such problem before. I add devise and shoulda-matchers gem but even without these gems I'm getting the same error.
spec_helper:
require 'simplecov'
SimpleCov.start
RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
end
config.mock_with :rspec do |mocks|
mocks.verify_partial_doubles = true
end
config.default_formatter = 'doc' if config.files_to_run.one?
config.shared_context_metadata_behavior = :apply_to_host_groups
config.profile_examples = 10
config.order = :random
Kernel.srand config.seed
end
rails_helper:
require 'spec_helper'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../config/environment', __dir__)
abort('The Rails environment is running in production mode!') if Rails.env.production?
require 'rspec/rails'
begin
ActiveRecord::Migration.maintain_test_schema!
rescue ActiveRecord::PendingMigrationError => e
puts e.to_s.strip
exit 1
end
RSpec.configure do |config|
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.use_transactional_fixtures = true
config.infer_spec_type_from_file_location!
config.filter_rails_from_backtrace!
end
Shoulda::Matchers.configure do |config|
config.integrate do |with|
with.test_framework :rspec
with.library :rails
end
end