Commit c5e882ff authored by Bob Van Landuyt's avatar Bob Van Landuyt

Use the `stub_licensed_features` helper in specs

Reuse an existing helper to enable and disable licensed features
parent cb78be1a
......@@ -8,8 +8,8 @@ describe 'Protected Environments' do
let(:environments) { %w(production development staging test) }
before do
allow(License).to receive(:feature_available?).and_call_original
allow(License).to receive(:feature_available?).with(:protected_environments).and_return(true)
stub_licensed_features(protected_environments: true)
environments.each do |environment_name|
create(:environment, name: environment_name, project: project)
end
......
......@@ -29,8 +29,7 @@ describe Environment do
subject { environment.protected? }
before do
allow(project).to receive(:feature_available?)
.with(:protected_environments).and_return(feature_available)
stub_licensed_features(protected_environments: feature_available)
end
context 'when Protected Environments feature is not available on the project' do
......@@ -63,8 +62,7 @@ describe Environment do
subject { environment.protected_deployable_by_user?(user) }
before do
allow(project).to receive(:feature_available?)
.with(:protected_environments).and_return(feature_available)
stub_licensed_features(protected_environments: true)
end
context 'when Protected Environments feature is not available on the project' do
......
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