Skip to content

Commit

Permalink
test sync
Browse files Browse the repository at this point in the history
  • Loading branch information
MGibson1 committed Sep 26, 2024
1 parent f02cae2 commit 94cfc7b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions languages/ruby/spec/e2e_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 94cfc7b

Please sign in to comment.