Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
ef77fcf9
Commit
ef77fcf9
authored
Jun 11, 2017
by
Jonas Kalderstam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for u2f helper and changelog entry
parent
f22d7680
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
0 deletions
+53
-0
changelogs/unreleased/fix-u2f-for-opera.yml
changelogs/unreleased/fix-u2f-for-opera.yml
+4
-0
spec/helpers/u2f_helper_spec.rb
spec/helpers/u2f_helper_spec.rb
+49
-0
No files found.
changelogs/unreleased/fix-u2f-for-opera.yml
0 → 100644
View file @
ef77fcf9
---
title
:
Fix FIDO U2F for Opera browser
merge_request
:
12082
author
:
Jakub Kramarz and Jonas Kalderstam
spec/helpers/u2f_helper_spec.rb
0 → 100644
View file @
ef77fcf9
require
'spec_helper'
describe
U2fHelper
do
describe
'when not on mobile'
do
it
'does not inject u2f on chrome 40'
do
device
=
double
(
mobile?:
false
)
browser
=
double
(
chrome?:
true
,
opera?:
false
,
version:
40
,
device:
device
)
allow
(
helper
).
to
receive
(
:browser
).
and_return
(
browser
)
expect
(
helper
.
inject_u2f_api?
).
to
eq
false
end
it
'injects u2f on chrome 41'
do
device
=
double
(
mobile?:
false
)
browser
=
double
(
chrome?:
true
,
opera?:
false
,
version:
41
,
device:
device
)
allow
(
helper
).
to
receive
(
:browser
).
and_return
(
browser
)
expect
(
helper
.
inject_u2f_api?
).
to
eq
true
end
it
'does not inject u2f on opera 39'
do
device
=
double
(
mobile?:
false
)
browser
=
double
(
chrome?:
false
,
opera?:
true
,
version:
39
,
device:
device
)
allow
(
helper
).
to
receive
(
:browser
).
and_return
(
browser
)
expect
(
helper
.
inject_u2f_api?
).
to
eq
false
end
it
'injects u2f on opera 40'
do
device
=
double
(
mobile?:
false
)
browser
=
double
(
chrome?:
false
,
opera?:
true
,
version:
40
,
device:
device
)
allow
(
helper
).
to
receive
(
:browser
).
and_return
(
browser
)
expect
(
helper
.
inject_u2f_api?
).
to
eq
true
end
end
describe
'when on mobile'
do
it
'does not inject u2f on chrome 41'
do
device
=
double
(
mobile?:
true
)
browser
=
double
(
chrome?:
true
,
opera?:
false
,
version:
41
,
device:
device
)
allow
(
helper
).
to
receive
(
:browser
).
and_return
(
browser
)
expect
(
helper
.
inject_u2f_api?
).
to
eq
false
end
it
'does not inject u2f on opera 40'
do
device
=
double
(
mobile?:
true
)
browser
=
double
(
chrome?:
false
,
opera?:
true
,
version:
40
,
device:
device
)
allow
(
helper
).
to
receive
(
:browser
).
and_return
(
browser
)
expect
(
helper
.
inject_u2f_api?
).
to
eq
false
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment