Add basic test to verify the positive context of filtering params
This commit is contained in:
parent
b59f640b19
commit
90815302ea
|
@ -71,4 +71,20 @@ describe ArticlesController do
|
||||||
Impression.last.session_hash.size.should eq 32
|
Impression.last.session_hash.size.should eq 32
|
||||||
Impression.last.referrer.should eq nil
|
Impression.last.referrer.should eq nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "when filtering params" do
|
||||||
|
before do
|
||||||
|
@_filtered_params = Rails.application.config.filter_parameters
|
||||||
|
Rails.application.config.filter_parameters = [:password]
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should FILTER params that are included in filtering {}" do
|
||||||
|
get "index", password: "best-password-ever"
|
||||||
|
Impression.last.params.should eq("password" => "[FILTERED]")
|
||||||
|
end
|
||||||
|
|
||||||
|
after do
|
||||||
|
Rails.application.config.filter_parameters = @_filtered_params
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue