Skip to content

Commit

Permalink
fix: validation access to attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasleger committed Dec 10, 2024
1 parent 64707ff commit 4040ab6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tracking_hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def initialize(constructor = {})

def [](key)
@keys_accessed.add(key)
super
super || super(key.to_s)
end

def keys_accessed
Expand Down
3 changes: 3 additions & 0 deletions spec/requests/api/v1/quote_checks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
post api_v1_quote_checks_url, params: { quote_check: quote_check_params }

expect(json.fetch("status")).to eq("invalid")

expect(json.fetch("validation_errors")).to include("devis_manquant")
expect(json.fetch("validation_errors")).not_to include("siret_manquant")

expect(json.dig("read_attributes", "pro", "siret")).to eq("12345678900000")
end
# rubocop:enable RSpec/MultipleExpectations
Expand Down

0 comments on commit 4040ab6

Please sign in to comment.