spec/unit/helpers_spec.rb in gooddata-0.6.51 vs spec/unit/helpers_spec.rb in gooddata-0.6.52

- old
+ new

@@ -60,10 +60,20 @@ } result = GoodData::Helpers.decode_params(params) expect(result).to eq(expected_result) end + it 'should not show reference parameter values when get error' do + params = { + 'secret' => 'you will not see it', + 'gd_encoded_params' => "{\"abc\": \"${secret}\",}" + } + expect { GoodData::Helpers.decode_params(params, resolve_reference_params: true) }.to raise_error do |e| + expect(e.message).not_to include('you will not see it') + end + end + it 'ignore value of encoded params if its value is not collection or String when resolve reference params' do params = { 'param' => 'value', 'number_param' => 5, 'gd_encoded_params' => { "deep" => { "deeper" => "deep value" }, "bool" => true, "int" => 1 } @@ -211,10 +221,17 @@ params = { 'param' => 'value', 'number_param' => 5, 'ads_password' => 'ads_123', 'my_password' => 'login_123', - 'gd_encoded_params' => { "login_username" => "login_user", "login_password" => "${my_password}", "ads_client" => { "username" => "ads_user", "password" => "${ads_password}" } } + 'gd_encoded_params' => { + "login_username" => "login_user", + "login_password" => "${my_password}", + "ads_client" => { + "username" => "ads_user", + "password" => "${ads_password}" + } + } } expected_result = { 'param' => 'value', 'number_param' => 5, 'ads_password' => 'ads_123',