Commit 058b7465 authored by nelbacha's avatar nelbacha

Refactor usage of shared example

parent 81d89101
......@@ -28,19 +28,19 @@ describe 'shared/deploy_tokens/_form.html.haml' do
end
end
where(:shared_examples_name, :packages_enabled, :feature_enabled, :role, :subject, :can) do
'display deploy token settings' | true | true | :owner | :group | true
'display deploy token settings' | true | false | :owner | :group | false
'display deploy token settings' | false | true | :owner | :group | false
'display deploy token settings' | false | false | :owner | :group | false
'display deploy token settings' | true | true | :maintainer | :group | true
'display deploy token settings' | true | false | :maintainer | :group | false
'display deploy token settings' | false | true | :maintainer | :group | false
'display deploy token settings' | false | false | :maintainer | :group | false
'display deploy token settings' | true | true | :maintainer | :project | true
'display deploy token settings' | false | true | :maintainer | :project | false
'display deploy token settings' | true | false | :maintainer | :project | false
'display deploy token settings' | false | false | :maintainer | :project | false
where(:packages_enabled, :feature_enabled, :role, :subject, :can) do
true | true | :owner | :group | true
true | false | :owner | :group | false
false | true | :owner | :group | false
false | false | :owner | :group | false
true | true | :maintainer | :group | true
true | false | :maintainer | :group | false
false | true | :maintainer | :group | false
false | false | :maintainer | :group | false
true | true | :maintainer | :project | true
false | true | :maintainer | :project | false
true | false | :maintainer | :project | false
false | false | :maintainer | :project | false
end
with_them do
......@@ -51,6 +51,6 @@ describe 'shared/deploy_tokens/_form.html.haml' do
stub_licensed_features(packages: feature_enabled)
end
it_behaves_like params[:shared_examples_name], params[:role], params[:subject], params[:can]
it_behaves_like 'display deploy token settings', params[:role], params[:subject], params[:can]
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment