diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-05-25 16:46:29 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-05-25 16:46:29 +0000 |
commit | c04f85a3338c415bde094a04d0d027bcd396dfdf (patch) | |
tree | 3c4035fb6daca7fd0f57ec7436c55f6bd4ba6a38 /spec/models | |
parent | f68f837d87de8f2d90a7f6f5ab835cfadfb901d9 (diff) | |
parent | 75739e54be0fca389c05d3d9d3de69737c0ff3ab (diff) | |
download | gitlab-ce-c04f85a3338c415bde094a04d0d027bcd396dfdf.tar.gz |
Merge branch 'rs-rubocop-nottonot' into 'master'
Enable RSpec/NotToNot cop and auto-correct offenses
Ref: https://gitlab.com/gitlab-org/gitlab-ce/issues/17761
See merge request !4267
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/build_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/ci/commit_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/ci/runner_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/concerns/issuable_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/concerns/token_authenticatable_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/generic_commit_status_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/issue_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/project_services/hipchat_service_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/repository_spec.rb | 10 |
10 files changed, 20 insertions, 20 deletions
diff --git a/spec/models/build_spec.rb b/spec/models/build_spec.rb index abae3271a5c..55b7af441d6 100644 --- a/spec/models/build_spec.rb +++ b/spec/models/build_spec.rb @@ -90,7 +90,7 @@ describe Ci::Build, models: true do build.update_attributes(trace: token) end - it { is_expected.to_not include(token) } + it { is_expected.not_to include(token) } end end @@ -317,7 +317,7 @@ describe Ci::Build, models: true do context 'when build does not have tags' do subject { create(:ci_build, tag_list: []) } - it { is_expected.to_not have_tags } + it { is_expected.not_to have_tags } end end @@ -534,7 +534,7 @@ describe Ci::Build, models: true do end it 'should set erase date' do - expect(build.erased_at).to_not be_falsy + expect(build.erased_at).not_to be_falsy end end @@ -606,7 +606,7 @@ describe Ci::Build, models: true do describe '#erase' do it 'should not raise error' do - expect { build.erase }.to_not raise_error + expect { build.erase }.not_to raise_error end end end diff --git a/spec/models/ci/commit_spec.rb b/spec/models/ci/commit_spec.rb index 1b5940ad5a8..22f8639e5ab 100644 --- a/spec/models/ci/commit_spec.rb +++ b/spec/models/ci/commit_spec.rb @@ -247,7 +247,7 @@ describe Ci::Commit, models: true do expect(commit.builds.pluck(:status)).to contain_exactly('pending') commit.builds.running_or_pending.each(&:success) - expect(commit.builds.running_or_pending).to_not be_empty + expect(commit.builds.running_or_pending).not_to be_empty expect(commit.builds.pluck(:name)).to contain_exactly('build', 'test') expect(commit.builds.pluck(:status)).to contain_exactly('success', 'pending') diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index 7c6e39419ed..5d04d8ffcff 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -140,7 +140,7 @@ describe Ci::Runner, models: true do context 'when runner does not have tags' do subject { create(:ci_runner, tag_list: []) } - it { is_expected.to_not have_tags } + it { is_expected.not_to have_tags } end end diff --git a/spec/models/concerns/issuable_spec.rb b/spec/models/concerns/issuable_spec.rb index c7e98e8309b..583827cdf42 100644 --- a/spec/models/concerns/issuable_spec.rb +++ b/spec/models/concerns/issuable_spec.rb @@ -194,7 +194,7 @@ describe Issue, "Issuable" do expect(data[:object_kind]).to eq("issue") expect(data[:user]).to eq(user.hook_attrs) expect(data[:object_attributes]).to eq(issue.hook_attrs) - expect(data).to_not have_key(:assignee) + expect(data).not_to have_key(:assignee) end context "issue is assigned" do diff --git a/spec/models/concerns/token_authenticatable_spec.rb b/spec/models/concerns/token_authenticatable_spec.rb index b6adc2bf247..9e8ebc56a31 100644 --- a/spec/models/concerns/token_authenticatable_spec.rb +++ b/spec/models/concerns/token_authenticatable_spec.rb @@ -28,14 +28,14 @@ describe ApplicationSetting, 'TokenAuthenticatable' do context 'token is not generated yet' do describe 'token field accessor' do subject { described_class.new.send(token_field) } - it { is_expected.to_not be_blank } + it { is_expected.not_to be_blank } end describe 'ensured token' do subject { described_class.new.send("ensure_#{token_field}") } it { is_expected.to be_a String } - it { is_expected.to_not be_blank } + it { is_expected.not_to be_blank } end describe 'ensured! token' do diff --git a/spec/models/generic_commit_status_spec.rb b/spec/models/generic_commit_status_spec.rb index 0caf5869c24..d0e02618b6b 100644 --- a/spec/models/generic_commit_status_spec.rb +++ b/spec/models/generic_commit_status_spec.rb @@ -27,13 +27,13 @@ describe GenericCommitStatus, models: true do describe :context do subject { generic_commit_status.context } - it { is_expected.to_not be_nil } + it { is_expected.not_to be_nil } end describe :stage do subject { generic_commit_status.stage } - it { is_expected.to_not be_nil } + it { is_expected.not_to be_nil } end end end diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index 8ab00c70f9d..6540d77fbc0 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -192,7 +192,7 @@ describe Issue, models: true do source_project: subject.project, source_branch: "#{subject.iid}-branch" }) merge_request.create_cross_references!(user) - expect(subject.referenced_merge_requests).to_not be_empty + expect(subject.referenced_merge_requests).not_to be_empty expect(subject.related_branches(user)).to eq([subject.to_branch_name]) end diff --git a/spec/models/project_services/hipchat_service_spec.rb b/spec/models/project_services/hipchat_service_spec.rb index 6fb5cad5011..f887ed4bafc 100644 --- a/spec/models/project_services/hipchat_service_spec.rb +++ b/spec/models/project_services/hipchat_service_spec.rb @@ -303,7 +303,7 @@ describe HipchatService, models: true do it "should notify only broken" do hipchat.notify_only_broken_builds = true hipchat.execute(data) - expect(WebMock).to_not have_requested(:post, api_url).once + expect(WebMock).not_to have_requested(:post, api_url).once end end end diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 60e1ec43f2b..4d36a539a69 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -791,7 +791,7 @@ describe Project, models: true do subject { project.container_registry_repository } - it { is_expected.to_not be_nil } + it { is_expected.not_to be_nil } end describe '#container_registry_repository_url' do @@ -809,7 +809,7 @@ describe Project, models: true do } end - it { is_expected.to_not be_nil } + it { is_expected.not_to be_nil } end context 'for disabled registry' do diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index 583151023b6..92ec51eabd4 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -443,7 +443,7 @@ describe Repository, models: true do end it 'does nothing' do - expect(repository.raw_repository).to_not receive(:autocrlf=). + expect(repository.raw_repository).not_to receive(:autocrlf=). with(:input) repository.update_autocrlf_option @@ -511,7 +511,7 @@ describe Repository, models: true do it 'does not expire the emptiness caches for a non-empty repository' do expect(repository).to receive(:empty?).and_return(false) - expect(repository).to_not receive(:expire_emptiness_caches) + expect(repository).not_to receive(:expire_emptiness_caches) repository.expire_cache end @@ -674,7 +674,7 @@ describe Repository, models: true do end it 'does not flush caches that depend on repository data' do - expect(repository).to_not receive(:expire_cache) + expect(repository).not_to receive(:expire_cache) repository.before_delete end @@ -951,7 +951,7 @@ describe Repository, models: true do expect(repository.avatar).to eq('logo.png') - expect(repository).to_not receive(:blob_at_branch) + expect(repository).not_to receive(:blob_at_branch) expect(repository.avatar).to eq('logo.png') end end @@ -1045,7 +1045,7 @@ describe Repository, models: true do and_return(true) repository.cache_keys.each do |key| - expect(repository).to_not receive(key) + expect(repository).not_to receive(key) end repository.build_cache |