Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/deploy_tokens_helper_spec.rb')
-rw-r--r--spec/helpers/deploy_tokens_helper_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/helpers/deploy_tokens_helper_spec.rb b/spec/helpers/deploy_tokens_helper_spec.rb
new file mode 100644
index 00000000000..e5dd5ff79a2
--- /dev/null
+++ b/spec/helpers/deploy_tokens_helper_spec.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe DeployTokensHelper do
+ describe '#deploy_token_revoke_button_data' do
+ let_it_be(:token) { build(:deploy_token) }
+ let_it_be(:project) { build(:project) }
+ let_it_be(:revoke_deploy_token_path) { '/foobar/baz/-/deploy_tokens/1/revoke' }
+
+ it 'returns expected hash' do
+ expect(helper).to receive(:revoke_deploy_token_path).with(project, token).and_return(revoke_deploy_token_path)
+
+ expect(helper.deploy_token_revoke_button_data(token: token, group_or_project: project)).to match({
+ token: token.to_json(only: [:id, :name]),
+ revoke_path: revoke_deploy_token_path
+ })
+ end
+ end
+end