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
Tatuya Kamada
gitlab-ce
Commits
df5223de
Commit
df5223de
authored
Jan 03, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generate u2f frontend fixtures dynamically
parent
8cee3b1d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
5 deletions
+49
-5
spec/javascripts/fixtures/u2f.rb
spec/javascripts/fixtures/u2f.rb
+43
-0
spec/javascripts/fixtures/u2f/authenticate.html.haml
spec/javascripts/fixtures/u2f/authenticate.html.haml
+0
-1
spec/javascripts/fixtures/u2f/register.html.haml
spec/javascripts/fixtures/u2f/register.html.haml
+0
-2
spec/javascripts/u2f/authenticate_spec.js
spec/javascripts/u2f/authenticate_spec.js
+3
-1
spec/javascripts/u2f/register_spec.js
spec/javascripts/u2f/register_spec.js
+3
-1
No files found.
spec/javascripts/fixtures/u2f.rb
0 → 100644
View file @
df5223de
require
'spec_helper'
context
'U2F'
do
include
JavaScriptFixturesHelpers
let
(
:user
)
{
create
(
:user
,
:two_factor_via_u2f
)
}
before
(
:all
)
do
clean_frontend_fixtures
(
'u2f/'
)
end
describe
SessionsController
,
'(JavaScript fixtures)'
,
type: :controller
do
render_views
before
do
@request
.
env
[
'devise.mapping'
]
=
Devise
.
mappings
[
:user
]
end
it
'u2f/authenticate.html.raw'
do
|
example
|
allow
(
controller
).
to
receive
(
:find_user
).
and_return
(
user
)
post
:create
,
user:
{
login:
user
.
username
,
password:
user
.
password
}
expect
(
response
).
to
be_success
store_frontend_fixture
(
response
,
example
.
description
)
end
end
describe
Profiles
::
TwoFactorAuthsController
,
'(JavaScript fixtures)'
,
type: :controller
do
render_views
before
do
sign_in
(
user
)
end
it
'u2f/register.html.raw'
do
|
example
|
get
:show
expect
(
response
).
to
be_success
store_frontend_fixture
(
response
,
example
.
description
)
end
end
end
spec/javascripts/fixtures/u2f/authenticate.html.haml
deleted
100644 → 0
View file @
8cee3b1d
=
render
partial:
"u2f/authenticate"
,
locals:
{
new_user_session_path:
"/users/sign_in"
,
params:
{},
resource_name:
"user"
}
spec/javascripts/fixtures/u2f/register.html.haml
deleted
100644 → 0
View file @
8cee3b1d
-
user
=
FactoryGirl
.
build
(
:user
,
:two_factor_via_otp
)
=
render
partial:
"u2f/register"
,
locals:
{
create_u2f_profile_two_factor_auth_path:
'/profile/two_factor_auth/create_u2f'
,
current_user:
user
}
spec/javascripts/u2f/authenticate_spec.js
View file @
df5223de
...
...
@@ -10,8 +10,10 @@
(
function
()
{
describe
(
'
U2FAuthenticate
'
,
function
()
{
fixture
.
load
(
'
u2f/authenticate
'
);
fixture
.
preload
(
'
u2f/authenticate.html.raw
'
);
beforeEach
(
function
()
{
fixture
.
load
(
'
u2f/authenticate.html.raw
'
);
this
.
u2fDevice
=
new
MockU2FDevice
;
this
.
container
=
$
(
"
#js-authenticate-u2f
"
);
this
.
component
=
new
window
.
gl
.
U2FAuthenticate
(
...
...
spec/javascripts/u2f/register_spec.js
View file @
df5223de
...
...
@@ -10,8 +10,10 @@
(
function
()
{
describe
(
'
U2FRegister
'
,
function
()
{
fixture
.
load
(
'
u2f/register
'
);
fixture
.
preload
(
'
u2f/register.html.raw
'
);
beforeEach
(
function
()
{
fixture
.
load
(
'
u2f/register.html.raw
'
);
this
.
u2fDevice
=
new
MockU2FDevice
;
this
.
container
=
$
(
"
#js-register-u2f
"
);
this
.
component
=
new
U2FRegister
(
this
.
container
,
$
(
"
#js-register-u2f-templates
"
),
{},
"
token
"
);
...
...
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