Skip to content

Commit

Permalink
PR Review Update
Browse files Browse the repository at this point in the history
Adding rspec for testing password filtering in config arrays.

https://bugzilla.redhat.com/show_bug.cgi?id=1174458
  • Loading branch information
abellotti committed Aug 21, 2015
1 parent b597127 commit d310224
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/controllers/application_controller/build_audit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
:message => "VMDB config updated (changing_value:[test] to [test2], password:[*] to [*])"}
end

it "tests build_config_audit password filtering" do
edit = {:current => {:user_proxies => [{:ldapport => "389", :bind_pwd => "secret"}]},
:new => {:user_proxies => [{:ldapport => "636", :bind_pwd => "super_secret"}]}}
controller.send(:build_config_audit, edit[:new], edit[:current])
.should == {:event => "vmdb_config_update",
:userid => nil,
:message => 'VMDB config updated (user_proxies:[[{:ldapport=>"389", :bind_pwd=>"[FILTERED]"}]] to [[{:ldapport=>"636", :bind_pwd=>"[FILTERED]"}]])'}
end

it "tests build_created_audit" do
category = FactoryGirl.create(:classification, :name => 'environment', :description => 'Environment')
edit = {:new => {:name => "the-name", :changing_value=>"test2", :static_value=>"same",
Expand Down

0 comments on commit d310224

Please sign in to comment.