Fix tests for skylight
This commit is contained in:
parent
0a928b2d6b
commit
f7c59cffc0
2 changed files with 10 additions and 0 deletions
|
@ -21,6 +21,7 @@ describe ApplicationController, type: :controller do
|
||||||
let(:payload) { {} }
|
let(:payload) { {} }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
allow(@controller).to receive(:content_type).and_return('')
|
||||||
allow(@controller).to receive(:current_user).and_return(current_user)
|
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_instructeur).and_return(current_instructeur)
|
||||||
expect(@controller).to receive(:current_administrateur).and_return(current_administrateur)
|
expect(@controller).to receive(:current_administrateur).and_return(current_administrateur)
|
||||||
|
@ -42,6 +43,8 @@ describe ApplicationController, type: :controller do
|
||||||
payload.delete(key)
|
payload.delete(key)
|
||||||
end
|
end
|
||||||
expect(payload).to eq({
|
expect(payload).to eq({
|
||||||
|
sk_rendered_format: nil,
|
||||||
|
sk_variant: [],
|
||||||
user_agent: 'Rails Testing',
|
user_agent: 'Rails Testing',
|
||||||
user_roles: 'Guest'
|
user_roles: 'Guest'
|
||||||
})
|
})
|
||||||
|
@ -61,6 +64,8 @@ describe ApplicationController, type: :controller do
|
||||||
payload.delete(key)
|
payload.delete(key)
|
||||||
end
|
end
|
||||||
expect(payload).to eq({
|
expect(payload).to eq({
|
||||||
|
sk_rendered_format: nil,
|
||||||
|
sk_variant: [],
|
||||||
user_agent: 'Rails Testing',
|
user_agent: 'Rails Testing',
|
||||||
user_id: current_user.id,
|
user_id: current_user.id,
|
||||||
user_email: current_user.email,
|
user_email: current_user.email,
|
||||||
|
@ -85,6 +90,8 @@ describe ApplicationController, type: :controller do
|
||||||
payload.delete(key)
|
payload.delete(key)
|
||||||
end
|
end
|
||||||
expect(payload).to eq({
|
expect(payload).to eq({
|
||||||
|
sk_rendered_format: nil,
|
||||||
|
sk_variant: [],
|
||||||
user_agent: 'Rails Testing',
|
user_agent: 'Rails Testing',
|
||||||
user_id: current_user.id,
|
user_id: current_user.id,
|
||||||
user_email: current_user.email,
|
user_email: current_user.email,
|
||||||
|
|
|
@ -4,6 +4,7 @@ describe Manager::ApplicationController, type: :controller do
|
||||||
let(:payload) { {} }
|
let(:payload) { {} }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
allow(@controller).to receive(:content_type).and_return('')
|
||||||
allow(@controller).to receive(:current_user).and_return(current_user)
|
allow(@controller).to receive(:current_user).and_return(current_user)
|
||||||
@controller.send(:append_info_to_payload, payload)
|
@controller.send(:append_info_to_payload, payload)
|
||||||
end
|
end
|
||||||
|
@ -13,6 +14,8 @@ describe Manager::ApplicationController, type: :controller do
|
||||||
payload.delete(key)
|
payload.delete(key)
|
||||||
end
|
end
|
||||||
expect(payload).to eq({
|
expect(payload).to eq({
|
||||||
|
sk_rendered_format: nil,
|
||||||
|
sk_variant: [],
|
||||||
user_agent: 'Rails Testing',
|
user_agent: 'Rails Testing',
|
||||||
user_id: current_user.id,
|
user_id: current_user.id,
|
||||||
user_email: current_user.email
|
user_email: current_user.email
|
||||||
|
|
Loading…
Add table
Reference in a new issue