spec: fix application_controller_spec

Rails controllers now looks for `media_type` rather than `content_type`.
This commit is contained in:
Pierre de La Morinerie 2020-06-29 15:54:15 +00:00
parent 0a3b4f7476
commit 04a6862fa6
2 changed files with 6 additions and 6 deletions

View file

@ -19,7 +19,7 @@ describe ApplicationController, type: :controller do
let(:payload) { {} }
before do
allow(@controller).to receive(:content_type).and_return('')
allow(@controller).to receive(:media_type).and_return('text/plain')
allow(@controller).to receive(:current_user).and_return(current_user)
expect(@controller).to receive(:current_instructeur).and_return(current_instructeur)
expect(@controller).to receive(:current_administrateur).and_return(current_administrateur)
@ -41,7 +41,7 @@ describe ApplicationController, type: :controller do
payload.delete(key)
end
expect(payload).to eq({
sk_rendered_format: nil,
sk_rendered_format: :text,
sk_variant: [],
user_agent: 'Rails Testing',
user_roles: 'Guest'
@ -62,7 +62,7 @@ describe ApplicationController, type: :controller do
payload.delete(key)
end
expect(payload).to eq({
sk_rendered_format: nil,
sk_rendered_format: :text,
sk_variant: [],
user_agent: 'Rails Testing',
user_id: current_user.id,
@ -88,7 +88,7 @@ describe ApplicationController, type: :controller do
payload.delete(key)
end
expect(payload).to eq({
sk_rendered_format: nil,
sk_rendered_format: :text,
sk_variant: [],
user_agent: 'Rails Testing',
user_id: current_user.id,

View file

@ -4,7 +4,7 @@ describe Manager::ApplicationController, type: :controller do
let(:payload) { {} }
before do
allow(@controller).to receive(:content_type).and_return('')
allow(@controller).to receive(:media_type).and_return('text/plain')
allow(@controller).to receive(:current_user).and_return(current_user)
@controller.send(:append_info_to_payload, payload)
end
@ -14,7 +14,7 @@ describe Manager::ApplicationController, type: :controller do
payload.delete(key)
end
expect(payload).to eq({
sk_rendered_format: nil,
sk_rendered_format: :text,
sk_variant: [],
user_agent: 'Rails Testing',
user_id: current_user.id,