Skip to content

Commit

Permalink
Merge pull request #34 from ydah/fix-deprecation-warning-in-test
Browse files Browse the repository at this point in the history
Fix some deprecation warning
  • Loading branch information
willnet authored Feb 9, 2024
2 parents a041cdc + e58e964 commit 3dbfbde
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/committee/rails/test/methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def committee_options
if defined?(RSpec) && (options = RSpec.try(:configuration).try(:committee_options))
options
else
{ schema_path: default_schema }
{ schema_path: default_schema, strict_reference_validation: false }
end
end

Expand Down
1 change: 1 addition & 0 deletions spec/fake_app/rails_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
FakeApp.config.hosts << 'www.example.com' if FakeApp.config.respond_to?(:hosts)
FakeApp.config.root = File.dirname(__FILE__)
FakeApp.config.secret_key_base = 'secret'
FakeApp.config.active_support.cache_format_version = 7.0
FakeApp.initialize!

FakeApp.routes.draw do
Expand Down
6 changes: 3 additions & 3 deletions spec/lib/methods_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
context 'when set option' do
before do
RSpec.configuration.add_setting :committee_options
RSpec.configuration.committee_options = { schema_path: Rails.root.join('schema', 'schema.yml').to_s, old_assert_behavior: false, query_hash_key: 'rack.request.query_hash', parse_response_by_content_type: false, strict_reference_validation: true }
RSpec.configuration.committee_options = { schema_path: Rails.root.join('schema', 'schema.yml').to_s, old_assert_behavior: false, query_hash_key: 'rack.request.query_hash', parse_response_by_content_type: false }
end

context 'and when response conform YAML Schema' do
Expand Down Expand Up @@ -57,7 +57,7 @@ def response
original_show_detailed_exceptions = Rails.application.env_config['action_dispatch.show_detailed_exceptions']
original_show_exceptions = Rails.application.env_config['action_dispatch.show_exceptions']
Rails.application.env_config['action_dispatch.show_detailed_exceptions'] = false
Rails.application.env_config['action_dispatch.show_exceptions'] = true
Rails.application.env_config['action_dispatch.show_exceptions'] = :all
begin
example.run
ensure
Expand Down Expand Up @@ -87,7 +87,7 @@ def response

context 'when override default setting' do
def committee_options
{ schema_path: Rails.root.join('schema', 'schema.yml').to_s, old_assert_behavior: false, query_hash_key: 'rack.request.query_hash', parse_response_by_content_type: false }
{ schema_path: Rails.root.join('schema', 'schema.yml').to_s, old_assert_behavior: false, query_hash_key: 'rack.request.query_hash', parse_response_by_content_type: false, strict_reference_validation: true}
end

it 'use the setting' do
Expand Down

0 comments on commit 3dbfbde

Please sign in to comment.