-
-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Move files to Utils namespace (#898)
- Add spec for context filter - Use context filter for both Sidekiq and DelayedJOb - fixing specs
- Loading branch information
1 parent
e05c8c5
commit f022ca4
Showing
5 changed files
with
49 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
require "spec_helper" | ||
|
||
require "raven/utils/context_filter" | ||
|
||
RSpec.describe Raven::Utils::ContextFilter do | ||
context "filters out ActiveJob keys from context" do | ||
let(:context) do | ||
{ :_aj_globalid => "gid://app/model/id", :key => "value" } | ||
end | ||
let(:expected_context) do | ||
{ "globalid" => "gid://app/model/id", :key => "value" } | ||
end | ||
|
||
it "removes reserved keys" do | ||
new_context = described_class.filter_context(context) | ||
|
||
expect(new_context).to eq(expected_context) | ||
end | ||
end | ||
|
||
context "filters out ActiveJob keys from nested context" do | ||
let(:context) do | ||
{ | ||
:_aj_globalid => "gid://app/model/id", | ||
:arguments => { :key => "value", :_aj_symbol_keys => ["key"] } | ||
} | ||
end | ||
let(:expected_context) do | ||
{ | ||
"globalid" => "gid://app/model/id", | ||
:arguments => { :key => "value", "symbol_keys" => ["key"] } | ||
} | ||
end | ||
|
||
it "removes reserved keys" do | ||
new_context = described_class.filter_context(context) | ||
|
||
expect(new_context).to eq(expected_context) | ||
end | ||
end | ||
end |