Skip to content
Snippets Groups Projects
Commit eb1f5a3e authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent b304a723
No related branches found
No related tags found
No related merge requests found
Showing
with 656 additions and 599 deletions
Loading
Loading
@@ -58,7 +58,7 @@ describe 'Projects > Settings > For a forked project', :js do
end
 
def click_expand_incident_management_button
within '.js-incident-management-settings' do
within '.qa-incident-management-settings' do
click_button('Expand')
end
end
Loading
Loading
Loading
Loading
@@ -36,10 +36,8 @@ describe Projects::MergeRequestsController, '(JavaScript fixtures)', type: :cont
end
let(:path) { "files/ruby/popen.rb" }
let(:position) do
Gitlab::Diff::Position.new(
old_path: path,
new_path: path,
old_line: nil,
build(:text_diff_position, :added,
file: path,
new_line: 14,
diff_refs: merge_request.diff_refs
)
Loading
Loading
@@ -112,14 +110,8 @@ describe Projects::MergeRequestsController, '(JavaScript fixtures)', type: :cont
let(:merge_request2) { create(:merge_request_with_diffs, :with_image_diffs, source_project: project, title: "Added images") }
let(:image_path) { "files/images/ee_repo_logo.png" }
let(:image_position) do
Gitlab::Diff::Position.new(
old_path: image_path,
new_path: image_path,
width: 100,
height: 100,
x: 1,
y: 1,
position_type: "image",
build(:image_diff_position,
file: image_path,
diff_refs: merge_request2.diff_refs
)
end
Loading
Loading
Loading
Loading
@@ -12,10 +12,8 @@ describe Projects::MergeRequests::DiffsController, '(JavaScript fixtures)', type
let(:path) { "files/ruby/popen.rb" }
let(:selected_commit) { merge_request.all_commits[0] }
let(:position) do
Gitlab::Diff::Position.new(
old_path: path,
new_path: path,
old_line: nil,
build(:text_diff_position, :added,
file: path,
new_line: 14,
diff_refs: merge_request.diff_refs
)
Loading
Loading
Loading
Loading
@@ -4,7 +4,7 @@ exports[`Expiration Policy Form renders 1`] = `
<div
class="lh-2"
>
<glformgroup-stub
<gl-form-group-stub
id="expiration-policy-toggle-group"
label="Expiration policy:"
label-align="right"
Loading
Loading
@@ -14,7 +14,7 @@ exports[`Expiration Policy Form renders 1`] = `
<div
class="d-flex align-items-start"
>
<gltoggle-stub
<gl-toggle-stub
id="expiration-policy-toggle"
labeloff="Toggle Status: OFF"
labelon="Toggle Status: ON"
Loading
Loading
@@ -30,16 +30,16 @@ exports[`Expiration Policy Form renders 1`] = `
</strong>
</span>
</div>
</glformgroup-stub>
</gl-form-group-stub>
<glformgroup-stub
<gl-form-group-stub
id="expiration-policy-interval-group"
label="Expiration interval:"
label-align="right"
label-cols="3"
label-for="expiration-policy-interval"
>
<glformselect-stub
<gl-form-select-stub
disabled="true"
id="expiration-policy-interval"
>
Loading
Loading
@@ -57,16 +57,16 @@ exports[`Expiration Policy Form renders 1`] = `
Bar
</option>
</glformselect-stub>
</glformgroup-stub>
<glformgroup-stub
</gl-form-select-stub>
</gl-form-group-stub>
<gl-form-group-stub
id="expiration-policy-schedule-group"
label="Expiration schedule:"
label-align="right"
label-cols="3"
label-for="expiration-policy-schedule"
>
<glformselect-stub
<gl-form-select-stub
disabled="true"
id="expiration-policy-schedule"
>
Loading
Loading
@@ -84,16 +84,16 @@ exports[`Expiration Policy Form renders 1`] = `
Bar
</option>
</glformselect-stub>
</glformgroup-stub>
<glformgroup-stub
</gl-form-select-stub>
</gl-form-group-stub>
<gl-form-group-stub
id="expiration-policy-latest-group"
label="Number of tags to retain:"
label-align="right"
label-cols="3"
label-for="expiration-policy-latest"
>
<glformselect-stub
<gl-form-select-stub
disabled="true"
id="expiration-policy-latest"
>
Loading
Loading
@@ -111,10 +111,10 @@ exports[`Expiration Policy Form renders 1`] = `
Bar
</option>
</glformselect-stub>
</glformgroup-stub>
</gl-form-select-stub>
</gl-form-group-stub>
<glformgroup-stub
<gl-form-group-stub
id="expiration-policy-name-matching-group"
invalid-feedback="The value of this input should be less than 255 characters"
label="Docker tags with names matching this regex pattern will expire:"
Loading
Loading
@@ -122,13 +122,13 @@ exports[`Expiration Policy Form renders 1`] = `
label-cols="3"
label-for="expiration-policy-name-matching"
>
<glformtextarea-stub
<gl-form-textarea-stub
disabled="true"
id="expiration-policy-name-matching"
placeholder=".*"
trim=""
value=""
/>
</glformgroup-stub>
</gl-form-group-stub>
</div>
`;
import { mount } from '@vue/test-utils';
import stubChildren from 'helpers/stub_children';
import { shallowMount } from '@vue/test-utils';
import { GlSprintf } from '@gitlab/ui';
import component from '~/registry/shared/components/expiration_policy_fields.vue';
 
import { NAME_REGEX_LENGTH } from '~/registry/shared/constants';
Loading
Loading
@@ -15,9 +15,9 @@ describe('Expiration Policy Form', () => {
parent.find(`${FORM_ELEMENTS_ID_PREFIX}-${name}`);
 
const mountComponent = props => {
wrapper = mount(component, {
wrapper = shallowMount(component, {
stubs: {
...stubChildren(component),
GlSprintf,
},
propsData: {
formOptions,
Loading
Loading
Loading
Loading
@@ -62,10 +62,8 @@ describe NotesHelper do
 
context 'when the discussion is on an older merge request version' do
let(:position) do
Gitlab::Diff::Position.new(
old_path: ".gitmodules",
new_path: ".gitmodules",
old_line: nil,
build(:text_diff_position, :added,
file: ".gitmodules",
new_line: 4,
diff_refs: merge_request_diff1.diff_refs
)
Loading
Loading
@@ -86,9 +84,8 @@ describe NotesHelper do
 
context 'when the discussion is on a comparison between merge request versions' do
let(:position) do
Gitlab::Diff::Position.new(
old_path: ".gitmodules",
new_path: ".gitmodules",
build(:text_diff_position,
file: ".gitmodules",
old_line: 4,
new_line: 4,
diff_refs: merge_request_diff3.compare_with(merge_request_diff1.head_commit_sha).diff_refs
Loading
Loading
Loading
Loading
@@ -120,17 +120,13 @@ describe Gitlab::CurrentSettings do
end
 
context 'with pending migrations' do
let(:current_settings) { described_class.current_application_settings }
before do
expect_any_instance_of(ActiveRecord::MigrationContext).to receive(:needs_migration?).and_return(true)
allow(Gitlab::Runtime).to receive(:rake?).and_return(false)
end
 
shared_examples 'a non-persisted ApplicationSetting object' do
let(:current_settings) { described_class.current_application_settings }
it 'returns a FakeApplicationSettings object' do
expect(current_settings).to be_a(Gitlab::FakeApplicationSettings)
end
it 'uses the default value from ApplicationSetting.defaults' do
expect(current_settings.signup_enabled).to eq(ApplicationSetting.defaults[:signup_enabled])
end
Loading
Loading
@@ -144,18 +140,16 @@ describe Gitlab::CurrentSettings do
end
end
 
context 'with no ApplicationSetting DB record' do
it_behaves_like 'a non-persisted ApplicationSetting object'
end
context 'with an existing ApplicationSetting DB record' do
let!(:db_settings) { ApplicationSetting.build_from_defaults(home_page_url: 'http://mydomain.com').save! && ApplicationSetting.last }
let(:current_settings) { described_class.current_application_settings }
context 'in a Rake task' do
before do
allow(Gitlab::Runtime).to receive(:rake?).and_return(true)
expect_any_instance_of(ActiveRecord::MigrationContext).to receive(:needs_migration?).and_return(true)
end
 
it_behaves_like 'a non-persisted ApplicationSetting object'
 
it 'uses the value from the DB attribute if present and not overridden by an accessor' do
expect(current_settings.home_page_url).to eq(db_settings.home_page_url)
it 'returns a FakeApplicationSettings object' do
expect(current_settings).to be_a(Gitlab::FakeApplicationSettings)
end
 
context 'when a new column is used before being migrated' do
Loading
Loading
@@ -168,6 +162,20 @@ describe Gitlab::CurrentSettings do
end
end
end
context 'with no ApplicationSetting DB record' do
it_behaves_like 'a non-persisted ApplicationSetting object'
end
context 'with an existing ApplicationSetting DB record' do
let!(:db_settings) { ApplicationSetting.build_from_defaults(home_page_url: 'http://mydomain.com').save! && ApplicationSetting.last }
it_behaves_like 'a non-persisted ApplicationSetting object'
it 'uses the value from the DB attribute if present and not overridden by an accessor' do
expect(current_settings.home_page_url).to eq(db_settings.home_page_url)
end
end
end
 
context 'when ApplicationSettings.current is present' do
Loading
Loading
# frozen_string_literal: true
require 'spec_helper'
describe Gitlab::Database::BatchCount do
let(:model) { Issue }
let(:column) { :author_id }
let(:in_transaction) { false }
let(:user) { create(:user) }
let(:another_user) { create(:user) }
before do
create_list(:issue, 3, author: user )
create_list(:issue, 2, author: another_user )
allow(ActiveRecord::Base.connection).to receive(:transaction_open?).and_return(in_transaction)
end
describe '#batch_count' do
it 'counts table' do
expect(described_class.batch_count(model)).to eq(5)
end
it 'counts with :id field' do
expect(described_class.batch_count(model, :id)).to eq(5)
end
it 'counts with "id" field' do
expect(described_class.batch_count(model, 'id')).to eq(5)
end
it 'counts with table.id field' do
expect(described_class.batch_count(model, "#{model.table_name}.id")).to eq(5)
end
it 'counts table with batch_size 50K' do
expect(described_class.batch_count(model, batch_size: 50_000)).to eq(5)
end
it 'will not count table with batch_size 1K' do
fallback = ::Gitlab::Database::BatchCounter::FALLBACK
expect(described_class.batch_count(model, batch_size: fallback / 2)).to eq(fallback)
end
it 'counts with a small edge case batch_sizes than result' do
stub_const('Gitlab::Database::BatchCounter::MIN_REQUIRED_BATCH_SIZE', 0)
[1, 2, 4, 5, 6].each { |i| expect(described_class.batch_count(model, batch_size: i)).to eq(5) }
end
context 'in a transaction' do
let(:in_transaction) { true }
it 'cannot count' do
expect do
described_class.batch_count(model)
end.to raise_error 'BatchCount can not be run inside a transaction'
end
end
end
describe '#batch_distinct_count' do
it 'counts with :id field' do
expect(described_class.batch_distinct_count(model, :id)).to eq(5)
end
it 'counts with column field' do
expect(described_class.batch_distinct_count(model, column)).to eq(2)
end
it 'counts with "id" field' do
expect(described_class.batch_distinct_count(model, "#{column}")).to eq(2)
end
it 'counts with table.column field' do
expect(described_class.batch_distinct_count(model, "#{model.table_name}.#{column}")).to eq(2)
end
it 'counts with :column field with batch_size of 50K' do
expect(described_class.batch_distinct_count(model, column, batch_size: 50_000)).to eq(2)
end
it 'will not count table with batch_size 1K' do
fallback = ::Gitlab::Database::BatchCounter::FALLBACK
expect(described_class.batch_distinct_count(model, column, batch_size: fallback / 2)).to eq(fallback)
end
it 'counts with a small edge case batch_sizes than result' do
stub_const('Gitlab::Database::BatchCounter::MIN_REQUIRED_BATCH_SIZE', 0)
[1, 2, 4, 5, 6].each { |i| expect(described_class.batch_distinct_count(model, column, batch_size: i)).to eq(2) }
end
end
end
Loading
Loading
@@ -212,14 +212,7 @@ describe Gitlab::Diff::LinesUnfolder do
 
context 'position requires a middle expansion and new match lines' do
let(:position) do
Gitlab::Diff::Position.new(base_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
start_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
head_sha: "1487062132228de836236c522fe52fed4980a46c",
old_path: "build-aux/flatpak/org.gnome.Nautilus.json",
new_path: "build-aux/flatpak/org.gnome.Nautilus.json",
position_type: "text",
old_line: 43,
new_line: 40)
build(:text_diff_position, old_line: 43, new_line: 40)
end
 
context 'blob lines' do
Loading
Loading
@@ -321,14 +314,7 @@ describe Gitlab::Diff::LinesUnfolder do
 
context 'position requires a middle expansion and no top match line' do
let(:position) do
Gitlab::Diff::Position.new(base_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
start_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
head_sha: "1487062132228de836236c522fe52fed4980a46c",
old_path: "build-aux/flatpak/org.gnome.Nautilus.json",
new_path: "build-aux/flatpak/org.gnome.Nautilus.json",
position_type: "text",
old_line: 16,
new_line: 17)
build(:text_diff_position, old_line: 16, new_line: 17)
end
 
context 'blob lines' do
Loading
Loading
@@ -422,14 +408,7 @@ describe Gitlab::Diff::LinesUnfolder do
 
context 'position requires a middle expansion and no bottom match line' do
let(:position) do
Gitlab::Diff::Position.new(base_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
start_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
head_sha: "1487062132228de836236c522fe52fed4980a46c",
old_path: "build-aux/flatpak/org.gnome.Nautilus.json",
new_path: "build-aux/flatpak/org.gnome.Nautilus.json",
position_type: "text",
old_line: 82,
new_line: 79)
build(:text_diff_position, old_line: 82, new_line: 79)
end
 
context 'blob lines' do
Loading
Loading
@@ -523,14 +502,7 @@ describe Gitlab::Diff::LinesUnfolder do
 
context 'position requires a short top expansion' do
let(:position) do
Gitlab::Diff::Position.new(base_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
start_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
head_sha: "1487062132228de836236c522fe52fed4980a46c",
old_path: "build-aux/flatpak/org.gnome.Nautilus.json",
new_path: "build-aux/flatpak/org.gnome.Nautilus.json",
position_type: "text",
old_line: 6,
new_line: 6)
build(:text_diff_position, old_line: 6, new_line: 6)
end
 
context 'blob lines' do
Loading
Loading
@@ -621,14 +593,7 @@ describe Gitlab::Diff::LinesUnfolder do
 
context 'position sits between two match lines (no expasion needed)' do
let(:position) do
Gitlab::Diff::Position.new(base_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
start_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
head_sha: "1487062132228de836236c522fe52fed4980a46c",
old_path: "build-aux/flatpak/org.gnome.Nautilus.json",
new_path: "build-aux/flatpak/org.gnome.Nautilus.json",
position_type: "text",
old_line: 64,
new_line: 61)
build(:text_diff_position, old_line: 64, new_line: 61)
end
 
context 'diff lines' do
Loading
Loading
@@ -640,14 +605,7 @@ describe Gitlab::Diff::LinesUnfolder do
 
context 'position requires bottom expansion and new match lines' do
let(:position) do
Gitlab::Diff::Position.new(base_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
start_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
head_sha: "1487062132228de836236c522fe52fed4980a46c",
old_path: "build-aux/flatpak/org.gnome.Nautilus.json",
new_path: "build-aux/flatpak/org.gnome.Nautilus.json",
position_type: "text",
old_line: 107,
new_line: 99)
build(:text_diff_position, old_line: 107, new_line: 99)
end
 
context 'blob lines' do
Loading
Loading
@@ -744,14 +702,7 @@ describe Gitlab::Diff::LinesUnfolder do
 
context 'position requires bottom expansion and no new match line' do
let(:position) do
Gitlab::Diff::Position.new(base_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
start_sha: "1c59dfa64afbea8c721bb09a06a9d326c952ea19",
head_sha: "1487062132228de836236c522fe52fed4980a46c",
old_path: "build-aux/flatpak/org.gnome.Nautilus.json",
new_path: "build-aux/flatpak/org.gnome.Nautilus.json",
position_type: "text",
old_line: 95,
new_line: 87)
build(:text_diff_position, old_line: 95, new_line: 87)
end
 
context 'blob lines' do
Loading
Loading
@@ -844,16 +795,7 @@ describe Gitlab::Diff::LinesUnfolder do
end
 
context 'positioned on an image' do
let(:position) do
Gitlab::Diff::Position.new(
base_sha: '1c59dfa64afbea8c721bb09a06a9d326c952ea19',
start_sha: '1c59dfa64afbea8c721bb09a06a9d326c952ea19',
head_sha: '1487062132228de836236c522fe52fed4980a46c',
old_path: 'image.jpg',
new_path: 'image.jpg',
position_type: 'image'
)
end
let(:position) { build(:image_diff_position) }
 
before do
allow(old_blob).to receive(:binary?).and_return(binary?)
Loading
Loading
Loading
Loading
@@ -5,36 +5,17 @@ require 'spec_helper'
describe Gitlab::Diff::PositionCollection do
let(:merge_request) { build(:merge_request) }
 
def build_text_position(attrs = {})
attributes = {
old_path: "files/ruby/popen.rb",
new_path: "files/ruby/popen.rb",
old_line: nil,
new_line: 14,
diff_refs: merge_request.diff_refs
}.merge(attrs)
Gitlab::Diff::Position.new(attributes)
let(:text_position) do
build(:text_diff_position, :added, diff_refs: diff_refs)
end
def build_image_position(attrs = {})
attributes = {
old_path: "files/images/any_image.png",
new_path: "files/images/any_image.png",
width: 10,
height: 10,
x: 1,
y: 1,
diff_refs: merge_request.diff_refs,
position_type: "image"
}.merge(attrs)
Gitlab::Diff::Position.new(attributes)
let(:folded_text_position) do
build(:text_diff_position, diff_refs: diff_refs, old_line: 1, new_line: 1)
end
let(:image_position) do
build(:image_diff_position, diff_refs: diff_refs)
end
 
let(:text_position) { build_text_position }
let(:folded_text_position) { build_text_position(old_line: 1, new_line: 1) }
let(:image_position) { build_image_position }
let(:diff_refs) { merge_request.diff_refs }
let(:invalid_position) { 'a position' }
let(:head_sha) { merge_request.diff_head_sha }
 
Loading
Loading
@@ -71,7 +52,9 @@ describe Gitlab::Diff::PositionCollection do
end
 
describe '#concat' do
let(:new_text_position) { build_text_position(old_line: 1, new_line: 1) }
let(:new_text_position) do
build(:text_diff_position, diff_refs: diff_refs, old_line: 1, new_line: 1)
end
 
it 'returns a Gitlab::Diff::Position' do
expect(collection.concat([new_text_position])).to be_a(described_class)
Loading
Loading
Loading
Loading
@@ -35,6 +35,32 @@ describe Gitlab::Diff::Position do
}
end
 
describe 'factory' do
it 'produces a complete text position' do
position = build(:text_diff_position)
expect(position).to be_complete
expect(position).to have_attributes(position_type: 'text')
end
it 'produces a complete image position' do
position = build(:image_diff_position)
expect(position).to be_complete
expect(position).to have_attributes(position_type: 'image')
end
it 'allows the diff_refs to be passed as a single object' do
head_sha = Digest::SHA1.hexdigest(SecureRandom.hex)
base_sha = Digest::SHA1.hexdigest(SecureRandom.hex)
start_sha = Digest::SHA1.hexdigest(SecureRandom.hex)
refs = ::Gitlab::Diff::DiffRefs.new(base_sha: base_sha, start_sha: start_sha, head_sha: head_sha)
expect(build(:diff_position, diff_refs: refs).diff_refs).to eq(refs)
end
end
describe "position for an added text file" do
let(:commit) { project.commit("2ea1f3dec713d940208fb5ce4a38765ecb5d3f73") }
 
Loading
Loading
This diff is collapsed.
Loading
Loading
@@ -35,6 +35,7 @@ describe ChatNotificationService do
let(:user) { create(:user) }
let(:project) { create(:project, :repository) }
let(:webhook_url) { 'https://example.gitlab.com/' }
let(:data) { Gitlab::DataBuilder::Push.build_sample(subject.project, user) }
 
before do
allow(chat_service).to receive_messages(
Loading
Loading
@@ -51,9 +52,6 @@ describe ChatNotificationService do
 
context 'with a repository' do
it 'returns true' do
subject.project = project
data = Gitlab::DataBuilder::Push.build_sample(project, user)
expect(chat_service).to receive(:notify).and_return(true)
expect(chat_service.execute(data)).to be true
end
Loading
Loading
@@ -62,11 +60,19 @@ describe ChatNotificationService do
context 'with an empty repository' do
it 'returns true' do
subject.project = create(:project, :empty_repo)
data = Gitlab::DataBuilder::Push.build_sample(subject.project, user)
 
expect(chat_service).to receive(:notify).and_return(true)
expect(chat_service.execute(data)).to be true
end
end
context 'with a project with name containing spaces' do
it 'does not remove spaces' do
allow(project).to receive(:full_name).and_return('Project Name')
expect(chat_service).to receive(:get_message).with(any_args, hash_including(project_name: 'Project Name'))
chat_service.execute(data)
end
end
end
end
Loading
Loading
@@ -29,7 +29,7 @@ describe 'Milestones through GroupQuery' do
it_behaves_like 'a working graphql query'
 
it 'returns milestones successfully' do
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(graphql_errors).to be_nil
expect_array_response(milestone_1.to_global_id.to_s, milestone_2.to_global_id.to_s, milestone_3.to_global_id.to_s, milestone_4.to_global_id.to_s)
end
Loading
Loading
Loading
Loading
@@ -55,7 +55,7 @@ describe 'getting group information' do
 
post_graphql(group_query(group1), current_user: user1)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(graphql_data['group']['id']).to eq(group1.to_global_id.to_s)
expect(graphql_data['group']['name']).to eq(group1.name)
expect(graphql_data['group']['path']).to eq(group1.path)
Loading
Loading
Loading
Loading
@@ -33,7 +33,7 @@ describe 'getting task completion status information' do
it 'returns the expected task completion status' do
post_graphql(create_task_completion_status_query_for(type, item.iid), current_user: user1)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
 
task_completion_status = graphql_data.dig('project', type, 'taskCompletionStatus')
expect(task_completion_status).not_to be_nil
Loading
Loading
Loading
Loading
@@ -16,7 +16,7 @@ describe API::Internal::Base do
 
get api("/internal/check"), params: { secret_token: secret_token }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['api_version']).to eq(API::API.version)
expect(json_response['redis']).to be(true)
end
Loading
Loading
@@ -34,13 +34,13 @@ describe API::Internal::Base do
get api("/internal/check"),
headers: { API::Helpers::GITLAB_SHARED_SECRET_HEADER => Base64.encode64(secret_token) }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
 
it 'returns 401 when no credentials provided' do
get(api("/internal/check"))
 
expect(response).to have_gitlab_http_status(401)
expect(response).to have_gitlab_http_status(:unauthorized)
end
end
end
Loading
Loading
@@ -126,7 +126,7 @@ describe API::Internal::Base do
it 'returns the correct information about the key' do
lfs_auth_key(key.id, project)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['username']).to eq(user.username)
expect(json_response['repository_http_path']).to eq(project.http_url_to_repo)
expect(json_response['expires_in']).to eq(Gitlab::LfsToken::DEFAULT_EXPIRE_TIME)
Loading
Loading
@@ -136,7 +136,7 @@ describe API::Internal::Base do
it 'returns the correct information about the user' do
lfs_auth_user(user.id, project)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['username']).to eq(user.username)
expect(json_response['repository_http_path']).to eq(project.http_url_to_repo)
expect(Gitlab::LfsToken.new(user).token_valid?(json_response['lfs_token'])).to be_truthy
Loading
Loading
@@ -145,19 +145,19 @@ describe API::Internal::Base do
it 'returns a 404 when no key or user is provided' do
lfs_auth_project(project)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it 'returns a 404 when the wrong key is provided' do
lfs_auth_key(key.id + 12345, project)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it 'returns a 404 when the wrong user is provided' do
lfs_auth_user(user.id + 12345, project)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
@@ -167,7 +167,7 @@ describe API::Internal::Base do
it 'returns the correct information about the key' do
lfs_auth_key(key.id, project)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['username']).to eq("lfs+deploy-key-#{key.id}")
expect(json_response['repository_http_path']).to eq(project.http_url_to_repo)
expect(Gitlab::LfsToken.new(key).token_valid?(json_response['lfs_token'])).to be_truthy
Loading
Loading
@@ -179,7 +179,7 @@ describe API::Internal::Base do
it "finds a user by key id" do
get(api("/internal/discover"), params: { key_id: key.id, secret_token: secret_token })
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
 
expect(json_response['name']).to eq(user.name)
end
Loading
Loading
@@ -187,7 +187,7 @@ describe API::Internal::Base do
it "finds a user by username" do
get(api("/internal/discover"), params: { username: user.username, secret_token: secret_token })
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
 
expect(json_response['name']).to eq(user.name)
end
Loading
Loading
@@ -195,7 +195,7 @@ describe API::Internal::Base do
it 'responds successfully when a user is not found' do
get(api('/internal/discover'), params: { username: 'noone', secret_token: secret_token })
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
 
expect(response.body).to eq('null')
end
Loading
Loading
@@ -203,7 +203,7 @@ describe API::Internal::Base do
it 'response successfully when passing invalid params' do
get(api('/internal/discover'), params: { nothing: 'to find a user', secret_token: secret_token })
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
 
expect(response.body).to eq('null')
end
Loading
Loading
@@ -284,7 +284,7 @@ describe API::Internal::Base do
GIT_ALTERNATE_OBJECT_DIRECTORIES_RELATIVE: alt_obj_dirs_relative
}.to_json)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
 
Loading
Loading
@@ -292,7 +292,7 @@ describe API::Internal::Base do
it 'responds with success' do
push(key, project.wiki)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response["status"]).to be_truthy
expect(json_response["gl_project_path"]).to eq(project.wiki.full_path)
expect(json_response["gl_repository"]).to eq("wiki-#{project.id}")
Loading
Loading
@@ -304,7 +304,7 @@ describe API::Internal::Base do
it 'responds with success' do
pull(key, project.wiki)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response["status"]).to be_truthy
expect(json_response["gl_project_path"]).to eq(project.wiki.full_path)
expect(json_response["gl_repository"]).to eq("wiki-#{project.id}")
Loading
Loading
@@ -320,7 +320,7 @@ describe API::Internal::Base do
it "has the correct payload" do
pull(key, project)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response["status"]).to be_truthy
expect(json_response["gl_repository"]).to eq("project-#{project.id}")
expect(json_response["gl_project_path"]).to eq(project.full_path)
Loading
Loading
@@ -340,7 +340,7 @@ describe API::Internal::Base do
it do
push(key, project)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response["status"]).to be_truthy
expect(json_response["gl_repository"]).to eq("project-#{project.id}")
expect(json_response["gl_project_path"]).to eq(project.full_path)
Loading
Loading
@@ -409,7 +409,7 @@ describe API::Internal::Base do
it do
pull(key, project)
 
expect(response).to have_gitlab_http_status(401)
expect(response).to have_gitlab_http_status(:unauthorized)
expect(json_response["status"]).to be_falsey
expect(user.reload.last_activity_on).to be_nil
end
Loading
Loading
@@ -419,7 +419,7 @@ describe API::Internal::Base do
it do
push(key, project)
 
expect(response).to have_gitlab_http_status(401)
expect(response).to have_gitlab_http_status(:unauthorized)
expect(json_response["status"]).to be_falsey
expect(user.reload.last_activity_on).to be_nil
end
Loading
Loading
@@ -464,7 +464,7 @@ describe API::Internal::Base do
it do
push(key, project)
 
expect(response).to have_gitlab_http_status(300)
expect(response).to have_gitlab_http_status(:multiple_choices)
expect(json_response['status']).to be_truthy
expect(json_response['payload']).to eql(payload)
expect(json_response['gl_console_messages']).to eql(console_messages)
Loading
Loading
@@ -483,7 +483,7 @@ describe API::Internal::Base do
it "has the correct payload" do
pull(key, project)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['gl_console_messages']).to eq([])
end
end
Loading
Loading
@@ -500,7 +500,7 @@ describe API::Internal::Base do
 
pull(key, project)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['gl_console_messages']).to eq(console_messages)
end
end
Loading
Loading
@@ -518,7 +518,7 @@ describe API::Internal::Base do
it do
pull(key, personal_project)
 
expect(response).to have_gitlab_http_status(401)
expect(response).to have_gitlab_http_status(:unauthorized)
expect(json_response["status"]).to be_falsey
expect(user.reload.last_activity_on).to be_nil
end
Loading
Loading
@@ -528,7 +528,7 @@ describe API::Internal::Base do
it do
push(key, personal_project)
 
expect(response).to have_gitlab_http_status(401)
expect(response).to have_gitlab_http_status(:unauthorized)
expect(json_response["status"]).to be_falsey
expect(user.reload.last_activity_on).to be_nil
end
Loading
Loading
@@ -545,7 +545,7 @@ describe API::Internal::Base do
end
push(key, personal_project)
 
expect(response).to have_gitlab_http_status(503)
expect(response).to have_gitlab_http_status(:service_unavailable)
expect(json_response['status']).to be_falsey
expect(json_response['message']).to eq("Foo")
expect(user.reload.last_activity_on).to be_nil
Loading
Loading
@@ -563,7 +563,7 @@ describe API::Internal::Base do
it do
pull(key, project)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response["status"]).to be_truthy
end
end
Loading
Loading
@@ -572,7 +572,7 @@ describe API::Internal::Base do
it do
push(key, project)
 
expect(response).to have_gitlab_http_status(401)
expect(response).to have_gitlab_http_status(:unauthorized)
expect(json_response["status"]).to be_falsey
end
end
Loading
Loading
@@ -589,7 +589,7 @@ describe API::Internal::Base do
it do
archive(key, project)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response["status"]).to be_truthy
expect(json_response["gitaly"]).not_to be_nil
expect(json_response["gitaly"]["repository"]).not_to be_nil
Loading
Loading
@@ -604,7 +604,7 @@ describe API::Internal::Base do
it do
archive(key, project)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response["status"]).to be_falsey
end
end
Loading
Loading
@@ -616,7 +616,7 @@ describe API::Internal::Base do
 
pull(key, project)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response["status"]).to be_falsey
end
 
Loading
Loading
@@ -632,7 +632,7 @@ describe API::Internal::Base do
}
)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response["status"]).to be_falsey
end
end
Loading
Loading
@@ -641,7 +641,7 @@ describe API::Internal::Base do
it do
pull(OpenStruct.new(id: 0), project)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response["status"]).to be_falsey
end
end
Loading
Loading
@@ -714,14 +714,14 @@ describe API::Internal::Base do
it 'rejects the push' do
push(key, project)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['status']).to be_falsy
end
 
it 'rejects the SSH pull' do
pull(key, project)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['status']).to be_falsy
end
end
Loading
Loading
@@ -750,7 +750,7 @@ describe API::Internal::Base do
#
# post api("/internal/notify_post_receive"), valid_params
#
# expect(response).to have_gitlab_http_status(200)
# expect(response).to have_gitlab_http_status(:ok)
# end
#
# it "calls the Gitaly client with the wiki's repository if it's a wiki" do
Loading
Loading
@@ -762,7 +762,7 @@ describe API::Internal::Base do
#
# post api("/internal/notify_post_receive"), valid_wiki_params
#
# expect(response).to have_gitlab_http_status(200)
# expect(response).to have_gitlab_http_status(:ok)
# end
#
# it "returns 500 if the gitaly call fails" do
Loading
Loading
@@ -771,7 +771,7 @@ describe API::Internal::Base do
#
# post api("/internal/notify_post_receive"), valid_params
#
# expect(response).to have_gitlab_http_status(500)
# expect(response).to have_gitlab_http_status(:internal_server_error)
# end
#
# context 'with a gl_repository parameter' do
Loading
Loading
@@ -792,7 +792,7 @@ describe API::Internal::Base do
#
# post api("/internal/notify_post_receive"), valid_params
#
# expect(response).to have_gitlab_http_status(200)
# expect(response).to have_gitlab_http_status(:ok)
# end
#
# it "calls the Gitaly client with the wiki's repository if it's a wiki" do
Loading
Loading
@@ -804,7 +804,7 @@ describe API::Internal::Base do
#
# post api("/internal/notify_post_receive"), valid_wiki_params
#
# expect(response).to have_gitlab_http_status(200)
# expect(response).to have_gitlab_http_status(:ok)
# end
# end
# end
Loading
Loading
@@ -961,7 +961,7 @@ describe API::Internal::Base do
it 'outputs a broadcast message' do
post api('/internal/post_receive'), params: valid_params
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['messages']).to include(build_alert_message(broadcast_message.message))
end
end
Loading
Loading
@@ -970,7 +970,7 @@ describe API::Internal::Base do
it 'does not output a broadcast message' do
post api('/internal/post_receive'), params: valid_params
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(has_alert_messages?(json_response['messages'])).to be_falsey
end
end
Loading
Loading
@@ -981,7 +981,7 @@ describe API::Internal::Base do
 
post api('/internal/post_receive'), params: valid_params
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(has_alert_messages?(json_response['messages'])).to be_falsey
end
end
Loading
Loading
@@ -993,7 +993,7 @@ describe API::Internal::Base do
 
post api('/internal/post_receive'), params: valid_params
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['messages']).to include(build_basic_message(project_moved.message))
end
end
Loading
Loading
@@ -1005,7 +1005,7 @@ describe API::Internal::Base do
 
post api('/internal/post_receive'), params: valid_params
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['messages']).to include(build_basic_message(project_created.message))
end
end
Loading
Loading
@@ -1018,7 +1018,7 @@ describe API::Internal::Base do
 
post api('/internal/post_receive'), params: valid_params
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
 
Loading
Loading
@@ -1032,7 +1032,7 @@ describe API::Internal::Base do
 
post api('/internal/post_receive'), params: valid_params
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
end
Loading
Loading
Loading
Loading
@@ -22,7 +22,7 @@ describe API::Internal::Pages do
it 'responds with 404 Not Found' do
query_host('pages.gitlab.io')
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
@@ -31,7 +31,7 @@ describe API::Internal::Pages do
it 'responds with 401 Unauthorized' do
query_host('pages.gitlab.io')
 
expect(response).to have_gitlab_http_status(401)
expect(response).to have_gitlab_http_status(:unauthorized)
end
end
 
Loading
Loading
@@ -51,7 +51,7 @@ describe API::Internal::Pages do
it 'responds with 204 no content' do
query_host('pages.gitlab.io')
 
expect(response).to have_gitlab_http_status(204)
expect(response).to have_gitlab_http_status(:no_content)
expect(response.body).to be_empty
end
end
Loading
Loading
@@ -65,7 +65,7 @@ describe API::Internal::Pages do
it 'responds with 204 No Content' do
query_host('pages.gitlab.io')
 
expect(response).to have_gitlab_http_status(204)
expect(response).to have_gitlab_http_status(:no_content)
end
end
 
Loading
Loading
@@ -75,7 +75,7 @@ describe API::Internal::Pages do
 
query_host('pages.gitlab.io')
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(response).to match_response_schema('internal/pages/virtual_domain')
 
expect(json_response['certificate']).to eq(pages_domain.certificate)
Loading
Loading
@@ -114,7 +114,7 @@ describe API::Internal::Pages do
 
query_host('mygroup.gitlab-pages.io')
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(response).to match_response_schema('internal/pages/virtual_domain')
 
expect(json_response['lookup_paths']).to eq(
Loading
Loading
@@ -141,7 +141,7 @@ describe API::Internal::Pages do
 
query_host('mygroup.gitlab-pages.io')
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(response).to match_response_schema('internal/pages/virtual_domain')
 
expect(json_response['lookup_paths']).to eq(
Loading
Loading
Loading
Loading
@@ -72,7 +72,7 @@ describe API::Issues do
it 'returns issues statistics' do
get api("/groups/#{group.id}/issues_statistics", user), params: params
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['statistics']).not_to be_nil
expect(json_response['statistics']['counts']['all']).to eq counts[:all]
expect(json_response['statistics']['counts']['closed']).to eq counts[:closed]
Loading
Loading
@@ -343,7 +343,7 @@ describe API::Issues do
it 'exposes known attributes' do
get api(base_url, admin)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response.last.keys).to include(*%w(id iid project_id title description))
expect(json_response.last).not_to have_key('subscribed')
end
Loading
Loading
@@ -527,7 +527,7 @@ describe API::Issues do
it 'returns an array of issues with no milestone' do
get api(base_url, user), params: { milestone: no_milestone_title }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
 
expect_paginated_array_response(group_confidential_issue.id)
end
Loading
Loading
@@ -674,14 +674,14 @@ describe API::Issues do
it 'returns error when multiple assignees are passed' do
get api(base_url, user), params: { assignee_username: [assignee.username, another_assignee.username], scope: 'all' }
 
expect(response).to have_gitlab_http_status(400)
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response["error"]).to include("allows one value, but found 2")
end
 
it 'returns error when assignee_username and assignee_id are passed together' do
get api(base_url, user), params: { assignee_username: [assignee.username], assignee_id: another_assignee.id, scope: 'all' }
 
expect(response).to have_gitlab_http_status(400)
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response["error"]).to include("mutually exclusive")
end
end
Loading
Loading
Loading
Loading
@@ -93,7 +93,7 @@ describe API::Issues do
it 'returns project issues statistics' do
get api("/issues_statistics", user), params: params
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['statistics']).not_to be_nil
expect(json_response['statistics']['counts']['all']).to eq counts[:all]
expect(json_response['statistics']['counts']['closed']).to eq counts[:closed]
Loading
Loading
@@ -196,7 +196,7 @@ describe API::Issues do
 
get api("/projects/#{max_project_id + 1}/issues", non_member)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it 'returns 404 on private projects for other users' do
Loading
Loading
@@ -205,7 +205,7 @@ describe API::Issues do
 
get api("/projects/#{private_project.id}/issues", non_member)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it 'returns no issues when user has access to project but not issues' do
Loading
Loading
@@ -472,7 +472,7 @@ describe API::Issues do
it 'exposes known attributes' do
get api("#{base_url}/issues", user)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response.last.keys).to include(*%w(id iid project_id title description))
expect(json_response.last).not_to have_key('subscribed')
end
Loading
Loading
@@ -565,14 +565,14 @@ describe API::Issues do
it 'returns error when multiple assignees are passed' do
get api("/issues", user), params: { assignee_username: [assignee.username, another_assignee.username], scope: 'all' }
 
expect(response).to have_gitlab_http_status(400)
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response["error"]).to include("allows one value, but found 2")
end
 
it 'returns error when assignee_username and assignee_id are passed together' do
get api("/issues", user), params: { assignee_username: [assignee.username], assignee_id: another_assignee.id, scope: 'all' }
 
expect(response).to have_gitlab_http_status(400)
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response["error"]).to include("mutually exclusive")
end
end
Loading
Loading
@@ -583,14 +583,14 @@ describe API::Issues do
it 'returns public issues' do
get api("/projects/#{project.id}/issues/#{issue.iid}")
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
 
it 'exposes known attributes' do
get api("/projects/#{project.id}/issues/#{issue.iid}", user)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['id']).to eq(issue.id)
expect(json_response['iid']).to eq(issue.iid)
expect(json_response['project_id']).to eq(issue.project.id)
Loading
Loading
@@ -630,7 +630,7 @@ describe API::Issues do
it 'exposes the closed_at attribute' do
get api("/projects/#{project.id}/issues/#{closed_issue.iid}", user)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['closed_at']).to be_present
end
 
Loading
Loading
@@ -650,39 +650,39 @@ describe API::Issues do
it 'returns a project issue by internal id' do
get api("/projects/#{project.id}/issues/#{issue.iid}", user)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['title']).to eq(issue.title)
expect(json_response['iid']).to eq(issue.iid)
end
 
it 'returns 404 if issue id not found' do
get api("/projects/#{project.id}/issues/54321", user)
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it 'returns 404 if the issue ID is used' do
get api("/projects/#{project.id}/issues/#{issue.id}", user)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
context 'confidential issues' do
it 'returns 404 for non project members' do
get api("/projects/#{project.id}/issues/#{confidential_issue.iid}", non_member)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it 'returns 404 for project members with guest role' do
get api("/projects/#{project.id}/issues/#{confidential_issue.iid}", guest)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it 'returns confidential issue for project members' do
get api("/projects/#{project.id}/issues/#{confidential_issue.iid}", user)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['title']).to eq(confidential_issue.title)
expect(json_response['iid']).to eq(confidential_issue.iid)
end
Loading
Loading
@@ -690,7 +690,7 @@ describe API::Issues do
it 'returns confidential issue for author' do
get api("/projects/#{project.id}/issues/#{confidential_issue.iid}", author)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['title']).to eq(confidential_issue.title)
expect(json_response['iid']).to eq(confidential_issue.iid)
end
Loading
Loading
@@ -698,7 +698,7 @@ describe API::Issues do
it 'returns confidential issue for assignee' do
get api("/projects/#{project.id}/issues/#{confidential_issue.iid}", assignee)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['title']).to eq(confidential_issue.title)
expect(json_response['iid']).to eq(confidential_issue.iid)
end
Loading
Loading
@@ -706,7 +706,7 @@ describe API::Issues do
it 'returns confidential issue for admin' do
get api("/projects/#{project.id}/issues/#{confidential_issue.iid}", admin)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['title']).to eq(confidential_issue.title)
expect(json_response['iid']).to eq(confidential_issue.iid)
end
Loading
Loading
@@ -744,7 +744,7 @@ describe API::Issues do
it "returns 404 when issue doesn't exists" do
get api("/projects/#{project.id}/issues/0/closed_by", user)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
@@ -774,7 +774,7 @@ describe API::Issues do
get_related_merge_requests(project.id, issue.iid)
 
expect_paginated_array_response(related_mr.id)
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response.last).not_to have_key('subscribed')
end
 
Loading
Loading
@@ -785,7 +785,7 @@ describe API::Issues do
 
get_related_merge_requests(private_project.id, private_issue.iid)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
@@ -824,7 +824,7 @@ describe API::Issues do
it "returns 404 when issue doesn't exists" do
get_related_merge_requests(project.id, 0, user)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
@@ -835,14 +835,14 @@ describe API::Issues do
it 'returns unauthorized' do
get api("/projects/#{project.id}/issues/#{issue.iid}/user_agent_detail")
 
expect(response).to have_gitlab_http_status(401)
expect(response).to have_gitlab_http_status(:unauthorized)
end
end
 
it 'exposes known attributes' do
get api("/projects/#{project.id}/issues/#{issue.iid}/user_agent_detail", admin)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['user_agent']).to eq(user_agent_detail.user_agent)
expect(json_response['ip_address']).to eq(user_agent_detail.ip_address)
expect(json_response['akismet_submitted']).to eq(user_agent_detail.submitted)
Loading
Loading
@@ -851,7 +851,7 @@ describe API::Issues do
it 'returns unauthorized for non-admin users' do
get api("/projects/#{project.id}/issues/#{issue.iid}/user_agent_detail", user)
 
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
end
end
 
Loading
Loading
@@ -863,7 +863,7 @@ describe API::Issues do
it 'returns 404 if the issue is confidential' do
post api("/projects/#{project.id}/issues/#{confidential_issue.iid}/participants", non_member)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment