Commit 10b2f594 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'rspec-matchers' into 'master'

Extract and reuse RSpec matchers

See merge request gitlab-org/gitlab!29257
parents 7ba071b2 95dbc7a7
...@@ -41,8 +41,6 @@ describe API::Epics do ...@@ -41,8 +41,6 @@ describe API::Epics do
let(:extra_date_fields) { %w[start_date_is_fixed start_date_fixed due_date_is_fixed due_date_fixed] } let(:extra_date_fields) { %w[start_date_is_fixed start_date_fixed due_date_is_fixed due_date_fixed] }
context 'when permission is absent' do context 'when permission is absent' do
RSpec::Matchers.define_negated_matcher :exclude, :include
it 'returns epic with extra date fields' do it 'returns epic with extra date fields' do
get api(url, user), params: params get api(url, user), params: params
......
...@@ -312,8 +312,6 @@ describe API::MergeRequestApprovals do ...@@ -312,8 +312,6 @@ describe API::MergeRequestApprovals do
end end
describe 'PUT :id/merge_requests/:merge_request_iid/approvers' do describe 'PUT :id/merge_requests/:merge_request_iid/approvers' do
RSpec::Matchers.define_negated_matcher :not_change, :change
shared_examples_for 'user allowed to change approvers' do shared_examples_for 'user allowed to change approvers' do
context 'when disable_overriding_approvers_per_merge_request is true on the project' do context 'when disable_overriding_approvers_per_merge_request is true on the project' do
before do before do
......
...@@ -170,8 +170,6 @@ describe FeatureFlags::UpdateService do ...@@ -170,8 +170,6 @@ describe FeatureFlags::UpdateService do
end end
context 'when scope can not be deleted' do context 'when scope can not be deleted' do
RSpec::Matchers.define_negated_matcher :not_change, :change
before do before do
allow(deleted_scope).to receive(:destroy).and_return(false) allow(deleted_scope).to receive(:destroy).and_return(false)
end end
......
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
require "spec_helper" require "spec_helper"
describe API::Markdown do describe API::Markdown do
RSpec::Matchers.define_negated_matcher :exclude, :include
describe "POST /markdown" do describe "POST /markdown" do
let(:user) {} # No-op. It gets overwritten in the contexts below. let(:user) {} # No-op. It gets overwritten in the contexts below.
......
...@@ -24,8 +24,6 @@ describe X509CertificateRevokeService do ...@@ -24,8 +24,6 @@ describe X509CertificateRevokeService do
end end
context 'for good certificates' do context 'for good certificates' do
RSpec::Matchers.define_negated_matcher :not_change, :change
let(:x509_certificate) { create(:x509_certificate) } let(:x509_certificate) { create(:x509_certificate) }
it 'do not update any commit signature' do it 'do not update any commit signature' do
......
# frozen_string_literal: true
RSpec::Matchers.define_negated_matcher :exclude, :include
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