Commit 81e84425 authored by Nicolas Dular's avatar Nicolas Dular

Use aggregate_failures for protected branch spec

parent 1f43bfa3
...@@ -33,7 +33,7 @@ RSpec.describe ProtectedBranches::CreateService do ...@@ -33,7 +33,7 @@ RSpec.describe ProtectedBranches::CreateService do
params[:code_owner_approval_required] = true params[:code_owner_approval_required] = true
end end
it "ignores incoming params and sets code_owner_approval_required to false" do it "ignores incoming params and sets code_owner_approval_required to false", :aggregate_failures do
expect { service.execute }.to change(ProtectedBranch, :count).by(1) expect { service.execute }.to change(ProtectedBranch, :count).by(1)
expect(ProtectedBranch.last.code_owner_approval_required).to be_falsy expect(ProtectedBranch.last.code_owner_approval_required).to be_falsy
end end
...@@ -48,7 +48,7 @@ RSpec.describe ProtectedBranches::CreateService do ...@@ -48,7 +48,7 @@ RSpec.describe ProtectedBranches::CreateService do
context "when code_owner_approval_required param is true" do context "when code_owner_approval_required param is true" do
let(:code_owner_approval_required) { true } let(:code_owner_approval_required) { true }
it "sets code_owner_approval_required to true" do it "sets code_owner_approval_required to true", :aggregate_failures do
expect { service.execute }.to change(ProtectedBranch, :count).by(1) expect { service.execute }.to change(ProtectedBranch, :count).by(1)
expect(ProtectedBranch.last.code_owner_approval_required).to be_truthy expect(ProtectedBranch.last.code_owner_approval_required).to be_truthy
end end
...@@ -63,7 +63,7 @@ RSpec.describe ProtectedBranches::CreateService do ...@@ -63,7 +63,7 @@ RSpec.describe ProtectedBranches::CreateService do
context "when code_owner_approval_required param is false" do context "when code_owner_approval_required param is false" do
let(:code_owner_approval_required) { false } let(:code_owner_approval_required) { false }
it "sets code_owner_approval_required to false" do it "sets code_owner_approval_required to false", :aggregate_failures do
expect { service.execute }.to change(ProtectedBranch, :count).by(1) expect { service.execute }.to change(ProtectedBranch, :count).by(1)
expect(ProtectedBranch.last.code_owner_approval_required).to be_falsy expect(ProtectedBranch.last.code_owner_approval_required).to be_falsy
end end
...@@ -82,7 +82,7 @@ RSpec.describe ProtectedBranches::CreateService do ...@@ -82,7 +82,7 @@ RSpec.describe ProtectedBranches::CreateService do
) )
end end
it "calls MergeRequest::SyncCodeOwnerApprovalRules to update open MRs" do it "calls MergeRequest::SyncCodeOwnerApprovalRules to update open MRs", :aggregate_failures do
expect(::MergeRequests::SyncCodeOwnerApprovalRules).to receive(:new).with(merge_request).and_call_original expect(::MergeRequests::SyncCodeOwnerApprovalRules).to receive(:new).with(merge_request).and_call_original
expect { service.execute }.to change(ProtectedBranch, :count).by(1) expect { service.execute }.to change(ProtectedBranch, :count).by(1)
end end
...@@ -93,7 +93,7 @@ RSpec.describe ProtectedBranches::CreateService do ...@@ -93,7 +93,7 @@ RSpec.describe ProtectedBranches::CreateService do
params[:name] = wildcard params[:name] = wildcard
end end
it "calls MergeRequest::SyncCodeOwnerApprovalRules to update open MRs for #{wildcard}" do it "calls MergeRequest::SyncCodeOwnerApprovalRules to update open MRs for #{wildcard}", :aggregate_failures do
expect(::MergeRequests::SyncCodeOwnerApprovalRules).to receive(:new).with(merge_request).and_call_original expect(::MergeRequests::SyncCodeOwnerApprovalRules).to receive(:new).with(merge_request).and_call_original
expect { service.execute }.to change(ProtectedBranch, :count).by(1) expect { service.execute }.to change(ProtectedBranch, :count).by(1)
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