From b5e2593896360f5b9ae91cce3aa9f7fc0b6dac2f Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Thu, 26 Sep 2024 08:35:59 -0700 Subject: [PATCH] test sync --- languages/ruby/spec/e2e_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/languages/ruby/spec/e2e_spec.rb b/languages/ruby/spec/e2e_spec.rb index 05d036d51..752c3f50c 100644 --- a/languages/ruby/spec/e2e_spec.rb +++ b/languages/ruby/spec/e2e_spec.rb @@ -82,6 +82,24 @@ expect(response).to equal_secret(expected_secret) end + it 'should sync secrets' do + response = @client.secrets.sync(organization_id, nil) + expect(response).to be_an_instance_of(Hash) + expect(response['hasChanges']).to be_truthy + secrets = filter_secrets_to_this_run(response['secrets']) + secrets.each do |secret| + expected_secret = expected_secrets.find { |s| s['key'] == secret['key'] } + expect(secret).to equal_secret(expected_secret) + end + end + + it 'should not have new sync changes' do + response = @client.secrets.sync(organization_id, Time.now.utc.strftime('%Y-%m-%dT%H:%M:%S.%6NZ')) + expect(response).to be_an_instance_of(Hash) + expect(response['hasChanges']).to be_falsey + expect(response['secrets']).to be_nil + end + after(:all) do File.delete(@state_file) if File.exist?(@state_file) end