Commit 0c6a47c6 authored by mo khan's avatar mo khan Committed by Ash McKenzie

Apply reviewer feedback

parent afd5cfef
......@@ -30,15 +30,6 @@ describe SoftwareLicensePolicies::CreateService do
end
context 'with a user who is allowed to admin' do
it 'creates one software license policy correctly' do
expect { subject.execute }.to change { project.software_license_policies.count }.from(0).to(1)
software_license_policy = project.software_license_policies.last
expect(software_license_policy).to be_persisted
expect(software_license_policy.name).to eq(params[:name])
expect(software_license_policy.classification).to eq('denied')
end
context 'when valid parameters are specified' do
where(:approval_status, :expected_classification) do
[
......@@ -57,12 +48,15 @@ describe SoftwareLicensePolicies::CreateService do
result
end
specify { expect(result[:status]).to be(:success) }
specify { expect(result[:software_license_policy]).to be_present }
specify { expect(result[:software_license_policy]).to be_persisted }
specify { expect(result[:software_license_policy].name).to eql(params[:name]) }
specify { expect(result[:software_license_policy].classification).to eql(expected_classification) }
specify { expect(RefreshLicenseComplianceChecksWorker).to have_received(:perform_async).with(project.id) }
it 'creates one software license policy correctly' do
expect(project.software_license_policies.count).to be(1)
expect(result[:status]).to be(:success)
expect(result[:software_license_policy]).to be_present
expect(result[:software_license_policy]).to be_persisted
expect(result[:software_license_policy].name).to eql(params[:name])
expect(result[:software_license_policy].classification).to eql(expected_classification)
expect(RefreshLicenseComplianceChecksWorker).to have_received(:perform_async).with(project.id)
end
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