summaryrefslogtreecommitdiff
path: root/spec/requests/api/appearance_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-21 12:09:07 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-21 12:09:07 +0000
commit2a040e2655fe0a99df61ad0a7bd0c27e68af0c38 (patch)
treea245cd0d6dd10f185e2fd098e371adc1ea03b72b /spec/requests/api/appearance_spec.rb
parenta53d2c37c4934f564caa94543dd4cf5af1703e2d (diff)
downloadgitlab-ce-2a040e2655fe0a99df61ad0a7bd0c27e68af0c38.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api/appearance_spec.rb')
-rw-r--r--spec/requests/api/appearance_spec.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/requests/api/appearance_spec.rb b/spec/requests/api/appearance_spec.rb
index 40fd216f32d..70be3adf723 100644
--- a/spec/requests/api/appearance_spec.rb
+++ b/spec/requests/api/appearance_spec.rb
@@ -11,7 +11,7 @@ describe API::Appearance, 'Appearance' do
it "returns 403" do
get api("/application/appearance", user)
- expect(response).to have_gitlab_http_status(403)
+ expect(response).to have_gitlab_http_status(:forbidden)
end
end
@@ -19,7 +19,7 @@ describe API::Appearance, 'Appearance' do
it "returns appearance" do
get api("/application/appearance", admin)
- expect(response).to have_gitlab_http_status(200)
+ expect(response).to have_gitlab_http_status(:ok)
expect(json_response).to be_an Hash
expect(json_response['description']).to eq('')
expect(json_response['email_header_and_footer_enabled']).to be(false)
@@ -41,7 +41,7 @@ describe API::Appearance, 'Appearance' do
it "returns 403" do
put api("/application/appearance", user), params: { title: "Test" }
- expect(response).to have_gitlab_http_status(403)
+ expect(response).to have_gitlab_http_status(:forbidden)
end
end
@@ -54,7 +54,7 @@ describe API::Appearance, 'Appearance' do
new_project_guidelines: "Please read the FAQs for help."
}
- expect(response).to have_gitlab_http_status(200)
+ expect(response).to have_gitlab_http_status(:ok)
expect(json_response).to be_an Hash
expect(json_response['description']).to eq('gitlab-test.example.com')
expect(json_response['email_header_and_footer_enabled']).to be(false)
@@ -82,7 +82,7 @@ describe API::Appearance, 'Appearance' do
put api("/application/appearance", admin), params: settings
- expect(response).to have_gitlab_http_status(200)
+ expect(response).to have_gitlab_http_status(:ok)
settings.each do |attribute, value|
expect(Appearance.current.public_send(attribute)).to eq(value)
end
@@ -92,14 +92,14 @@ describe API::Appearance, 'Appearance' do
it "with message_font_color" do
put api("/application/appearance", admin), params: { message_font_color: "No Color" }
- expect(response).to have_gitlab_http_status(400)
+ expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response['message']['message_font_color']).to contain_exactly('must be a valid color code')
end
it "with message_background_color" do
put api("/application/appearance", admin), params: { message_background_color: "#1" }
- expect(response).to have_gitlab_http_status(400)
+ expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response['message']['message_background_color']).to contain_exactly('must be a valid color code')
end
end
@@ -115,7 +115,7 @@ describe API::Appearance, 'Appearance' do
favicon: fixture_file_upload("spec/fixtures/dk.png", "image/png")
}
- expect(response).to have_gitlab_http_status(200)
+ expect(response).to have_gitlab_http_status(:ok)
expect(json_response['logo']).to eq("/uploads/-/system/appearance/logo/#{appearance.id}/dk.png")
expect(json_response['header_logo']).to eq("/uploads/-/system/appearance/header_logo/#{appearance.id}/dk.png")
expect(json_response['favicon']).to eq("/uploads/-/system/appearance/favicon/#{appearance.id}/dk.png")
@@ -125,14 +125,14 @@ describe API::Appearance, 'Appearance' do
it "with string instead of file" do
put api("/application/appearance", admin), params: { logo: 'not-a-file.png' }
- expect(response).to have_gitlab_http_status(400)
+ expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response['error']).to eq("logo is invalid")
end
it "with .svg file instead of .png" do
put api("/application/appearance", admin), params: { favicon: fixture_file_upload("spec/fixtures/logo_sample.svg", "image/svg") }
- expect(response).to have_gitlab_http_status(400)
+ expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response['message']['favicon']).to contain_exactly("You are not allowed to upload \"svg\" files, allowed types: png, ico")
end
end