Log In
Log In
Places
All Projects
Status Monitor
Collapse sidebar
obs:server:fedora:2.10:testing
obs-server
obs-server-2.10-0108-Switch-to-media_type-inste...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File obs-server-2.10-0108-Switch-to-media_type-instead-of-content_type-in-rspe.patch of Package obs-server
From 3d374b5d80a455732b88334817cf0598345c7b9e Mon Sep 17 00:00:00 2001 From: Lukas Krause <lkrause@suse.de> Date: Thu, 13 Feb 2020 13:52:42 +0100 Subject: [PATCH] Switch to media_type instead of content_type in rspec tests In Rails 6, the return value of "ActionDispatch::Response#content_type" contains the charset as well. --- src/api/spec/controllers/webui/apidocs_controller_spec.rb | 2 +- src/api/spec/controllers/webui/kiwi/images_controller_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/spec/controllers/webui/apidocs_controller_spec.rb b/src/api/spec/controllers/webui/apidocs_controller_spec.rb index dc4a3d2a25..e146226c96 100644 --- a/src/api/spec/controllers/webui/apidocs_controller_spec.rb +++ b/src/api/spec/controllers/webui/apidocs_controller_spec.rb @@ -22,7 +22,7 @@ RSpec.describe Webui::ApidocsController, type: :controller do it 'responses without error' do expect(response).to have_http_status(:ok) - expect(response.content_type).to eq('text/html') + expect(response.media_type).to eq('text/html') end end diff --git a/src/api/spec/controllers/webui/kiwi/images_controller_spec.rb b/src/api/spec/controllers/webui/kiwi/images_controller_spec.rb index 5aa8c5152f..e750c8beab 100644 --- a/src/api/spec/controllers/webui/kiwi/images_controller_spec.rb +++ b/src/api/spec/controllers/webui/kiwi/images_controller_spec.rb @@ -150,7 +150,7 @@ RSpec.describe Webui::Kiwi::ImagesController, type: :controller, vcr: true do context 'json' do subject { get :show, params: { format: :json, id: kiwi_image_with_package_with_kiwi_file.id } } - it { expect(subject.content_type).to eq('application/json') } + it { expect(subject.media_type).to eq('application/json') } it { expect(subject).to have_http_status(:success) } end @@ -345,7 +345,7 @@ RSpec.describe Webui::Kiwi::ImagesController, type: :controller, vcr: true do get :autocomplete_binaries, params: { format: :json, id: kiwi_image_with_package_with_kiwi_file.id, term: term } end - it { expect(subject.content_type).to eq('application/json') } + it { expect(subject.media_type).to eq('application/json') } it { expect(subject).to have_http_status(:success) } it do expect(JSON.parse(subject.body)).to eq([{ 'id' => 'apache', 'label' => 'apache', 'value' => 'apache' }, -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Contact
Support
@OBShq
The Open Build Service is an
openSUSE project
.
Log In
Places
Places
All Projects
Status Monitor