diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-31 21:08:05 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-31 21:08:05 +0000 |
commit | abae8f34f377519946a91101ef7abf504454531c (patch) | |
tree | 359fab0082860b6850d4a0a492b8f12eb3d4eb0b /spec/rubocop/cop | |
parent | 580622bdb3c762a8e89facd8a3946881ee480442 (diff) | |
download | gitlab-ce-abae8f34f377519946a91101ef7abf504454531c.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/rubocop/cop')
-rw-r--r-- | spec/rubocop/cop/rspec/have_gitlab_http_status_spec.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/spec/rubocop/cop/rspec/have_gitlab_http_status_spec.rb b/spec/rubocop/cop/rspec/have_gitlab_http_status_spec.rb index 12bdacdee3c..4aa45e66ca7 100644 --- a/spec/rubocop/cop/rspec/have_gitlab_http_status_spec.rb +++ b/spec/rubocop/cop/rspec/have_gitlab_http_status_spec.rb @@ -59,6 +59,8 @@ describe RuboCop::Cop::RSpec::HaveGitlabHttpStatus do 'have_http_status(var)' | 'have_gitlab_http_status(var)' 'have_http_status(:success)' | 'have_gitlab_http_status(:success)' 'have_http_status(:invalid)' | 'have_gitlab_http_status(:invalid)' + 'expect(response.status).to eq(200)' | 'expect(response).to have_gitlab_http_status(:ok)' + 'expect(response.status).not_to eq(200)' | 'expect(response).not_to have_gitlab_http_status(:ok)' end with_them do @@ -90,7 +92,23 @@ describe RuboCop::Cop::RSpec::HaveGitlabHttpStatus do 'have_http_status(200, arg)', 'have_gitlab_http_status', 'have_gitlab_http_status { }', - 'have_gitlab_http_status(200, arg)' + 'have_gitlab_http_status(200, arg)', + 'expect(response.status).to eq(arg)', + 'expect(response.status).to eq(:ok)', + 'expect(response.status).to some_matcher(200)', + 'expect(response.status).not_to eq(arg)', + 'expect(response.status).not_to eq(:ok)', + 'expect(response.status).not_to some_matcher(200)', + 'expect(result.status).to eq(200)', + 'expect(result.status).not_to eq(200)', + <<~CODE, + response = some_assignment + expect(response.status).to eq(200) + CODE + <<~CODE + response = some_assignment + expect(response.status).not_to eq(200) + CODE ] end |