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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
0b1c796f
Commit
0b1c796f
authored
Apr 25, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-04-25
parents
67b18509
e6f6f8e7
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
76 additions
and
55 deletions
+76
-55
app/views/projects/registry/repositories/index.html.haml
app/views/projects/registry/repositories/index.html.haml
+1
-1
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+1
-1
config/initializers/2_gitlab.rb
config/initializers/2_gitlab.rb
+1
-0
config/settings.rb
config/settings.rb
+0
-0
lib/gitlab.rb
lib/gitlab.rb
+0
-1
spec/fast_spec_helper.rb
spec/fast_spec_helper.rb
+2
-1
spec/javascripts/activities_spec.js
spec/javascripts/activities_spec.js
+42
-33
spec/javascripts/commits_spec.js
spec/javascripts/commits_spec.js
+8
-4
spec/javascripts/pager_spec.js
spec/javascripts/pager_spec.js
+21
-14
No files found.
app/views/projects/registry/repositories/index.html.haml
View file @
0b1c796f
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
docker login
#{
Gitlab
.
config
.
registry
.
host_port
}
docker login
#{
Gitlab
.
config
.
registry
.
host_port
}
%br
%br
%p
%p
-
deploy_token
=
link_to
(
_
(
'deploy token'
),
help_page_path
(
'user/project
s
/deploy_tokens/index'
,
anchor:
'read-container-registry-images'
),
target:
'_blank'
)
-
deploy_token
=
link_to
(
_
(
'deploy token'
),
help_page_path
(
'user/project/deploy_tokens/index'
,
anchor:
'read-container-registry-images'
),
target:
'_blank'
)
=
s_
(
'ContainerRegistry|You can also %{deploy_token} for read-only access to the registry images.'
).
html_safe
%
{
deploy_token:
deploy_token
}
=
s_
(
'ContainerRegistry|You can also %{deploy_token} for read-only access to the registry images.'
).
html_safe
%
{
deploy_token:
deploy_token
}
%br
%br
%p
%p
...
...
config/initializers/1_settings.rb
View file @
0b1c796f
require_
dependency
File
.
expand_path
(
'../../lib/gitlab'
,
__dir__
)
# Load Gitlab as soon as possible
require_
relative
'../settings'
# Default settings
# Default settings
Settings
[
'ldap'
]
||=
Settingslogic
.
new
({})
Settings
[
'ldap'
]
||=
Settingslogic
.
new
({})
...
...
config/initializers/2_gitlab.rb
0 → 100644
View file @
0b1c796f
require_relative
'../../lib/gitlab'
lib
/settings.rb
→
config
/settings.rb
View file @
0b1c796f
File moved
lib/gitlab.rb
View file @
0b1c796f
require_dependency
'settings'
require_dependency
'gitlab/popen'
require_dependency
'gitlab/popen'
module
Gitlab
module
Gitlab
...
...
spec/fast_spec_helper.rb
View file @
0b1c796f
...
@@ -9,7 +9,8 @@ unless Object.respond_to?(:require_dependency)
...
@@ -9,7 +9,8 @@ unless Object.respond_to?(:require_dependency)
end
end
end
end
# Defines Gitlab and Gitlab.config which are at the center of the app
# Defines Settings and Gitlab.config which are at the center of the app
require_relative
'../config/settings'
require_relative
'../lib/gitlab'
unless
defined?
(
Gitlab
.
config
)
require_relative
'../lib/gitlab'
unless
defined?
(
Gitlab
.
config
)
require_relative
'support/rspec'
require_relative
'support/rspec'
spec/javascripts/activities_spec.js
View file @
0b1c796f
...
@@ -3,24 +3,30 @@
...
@@ -3,24 +3,30 @@
import
$
from
'
jquery
'
;
import
$
from
'
jquery
'
;
import
'
vendor/jquery.endless-scroll
'
;
import
'
vendor/jquery.endless-scroll
'
;
import
Activities
from
'
~/activities
'
;
import
Activities
from
'
~/activities
'
;
import
Pager
from
'
~/pager
'
;
(
()
=>
{
describe
(
'
Activities
'
,
()
=>
{
window
.
gon
||
(
window
.
gon
=
{});
window
.
gon
||
(
window
.
gon
=
{});
const
fixtureTemplate
=
'
static/event_filter.html.raw
'
;
const
fixtureTemplate
=
'
static/event_filter.html.raw
'
;
const
filters
=
[
const
filters
=
[
{
{
id
:
'
all
'
,
id
:
'
all
'
,
},
{
},
{
id
:
'
push
'
,
id
:
'
push
'
,
name
:
'
push events
'
,
name
:
'
push events
'
,
},
{
},
{
id
:
'
merged
'
,
id
:
'
merged
'
,
name
:
'
merge events
'
,
name
:
'
merge events
'
,
},
{
},
{
id
:
'
comments
'
,
id
:
'
comments
'
,
},
{
},
{
id
:
'
team
'
,
id
:
'
team
'
,
}];
},
];
function
getEventName
(
index
)
{
function
getEventName
(
index
)
{
const
filter
=
filters
[
index
];
const
filter
=
filters
[
index
];
...
@@ -32,31 +38,34 @@ import Activities from '~/activities';
...
@@ -32,31 +38,34 @@ import Activities from '~/activities';
return
`#
${
filter
.
id
}
_event_filter`
;
return
`#
${
filter
.
id
}
_event_filter`
;
}
}
describe
(
'
Activities
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
loadFixtures
(
fixtureTemplate
);
loadFixtures
(
fixtureTemplate
);
spyOn
(
Pager
,
'
init
'
).
and
.
stub
();
new
Activities
();
new
Activities
();
});
});
for
(
let
i
=
0
;
i
<
filters
.
length
;
i
+=
1
)
{
for
(
let
i
=
0
;
i
<
filters
.
length
;
i
+=
1
)
{
((
i
)
=>
{
(
i
=>
{
describe
(
`when selecting
${
getEventName
(
i
)}
`
,
()
=>
{
describe
(
`when selecting
${
getEventName
(
i
)}
`
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
$
(
getSelector
(
i
)).
click
();
$
(
getSelector
(
i
)).
click
();
});
});
for
(
let
x
=
0
;
x
<
filters
.
length
;
x
+=
1
)
{
for
(
let
x
=
0
;
x
<
filters
.
length
;
x
+=
1
)
{
((
x
)
=>
{
(
x
=>
{
const
shouldHighlight
=
i
===
x
;
const
shouldHighlight
=
i
===
x
;
const
testName
=
shouldHighlight
?
'
should highlight
'
:
'
should not highlight
'
;
const
testName
=
shouldHighlight
?
'
should highlight
'
:
'
should not highlight
'
;
it
(
`
${
testName
}
${
getEventName
(
x
)}
`
,
()
=>
{
it
(
`
${
testName
}
${
getEventName
(
x
)}
`
,
()
=>
{
expect
(
$
(
getSelector
(
x
)).
parent
().
hasClass
(
'
active
'
)).
toEqual
(
shouldHighlight
);
expect
(
$
(
getSelector
(
x
))
.
parent
()
.
hasClass
(
'
active
'
),
).
toEqual
(
shouldHighlight
);
});
});
})(
x
);
})(
x
);
}
}
});
});
})(
i
);
})(
i
);
}
}
});
});
})();
spec/javascripts/commits_spec.js
View file @
0b1c796f
...
@@ -3,6 +3,7 @@ import 'vendor/jquery.endless-scroll';
...
@@ -3,6 +3,7 @@ import 'vendor/jquery.endless-scroll';
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
CommitsList
from
'
~/commits
'
;
import
CommitsList
from
'
~/commits
'
;
import
Pager
from
'
~/pager
'
;
describe
(
'
Commits List
'
,
()
=>
{
describe
(
'
Commits List
'
,
()
=>
{
let
commitsList
;
let
commitsList
;
...
@@ -14,6 +15,7 @@ describe('Commits List', () => {
...
@@ -14,6 +15,7 @@ describe('Commits List', () => {
</form>
</form>
<ol id="commits-list"></ol>
<ol id="commits-list"></ol>
`
);
`
);
spyOn
(
Pager
,
'
init
'
).
and
.
stub
();
commitsList
=
new
CommitsList
(
25
);
commitsList
=
new
CommitsList
(
25
);
});
});
...
@@ -68,9 +70,10 @@ describe('Commits List', () => {
...
@@ -68,9 +70,10 @@ describe('Commits List', () => {
mock
.
restore
();
mock
.
restore
();
});
});
it
(
'
should save the last search string
'
,
(
done
)
=>
{
it
(
'
should save the last search string
'
,
done
=>
{
commitsList
.
searchField
.
val
(
'
GitLab
'
);
commitsList
.
searchField
.
val
(
'
GitLab
'
);
commitsList
.
filterResults
()
commitsList
.
filterResults
()
.
then
(()
=>
{
.
then
(()
=>
{
expect
(
ajaxSpy
).
toHaveBeenCalled
();
expect
(
ajaxSpy
).
toHaveBeenCalled
();
expect
(
commitsList
.
lastSearch
).
toEqual
(
'
GitLab
'
);
expect
(
commitsList
.
lastSearch
).
toEqual
(
'
GitLab
'
);
...
@@ -80,8 +83,9 @@ describe('Commits List', () => {
...
@@ -80,8 +83,9 @@ describe('Commits List', () => {
.
catch
(
done
.
fail
);
.
catch
(
done
.
fail
);
});
});
it
(
'
should not make ajax call if the input does not change
'
,
(
done
)
=>
{
it
(
'
should not make ajax call if the input does not change
'
,
done
=>
{
commitsList
.
filterResults
()
commitsList
.
filterResults
()
.
then
(()
=>
{
.
then
(()
=>
{
expect
(
ajaxSpy
).
not
.
toHaveBeenCalled
();
expect
(
ajaxSpy
).
not
.
toHaveBeenCalled
();
expect
(
commitsList
.
lastSearch
).
toEqual
(
''
);
expect
(
commitsList
.
lastSearch
).
toEqual
(
''
);
...
...
spec/javascripts/pager_spec.js
View file @
0b1c796f
import
$
from
'
jquery
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
Pager
from
'
~/pager
'
;
import
Pager
from
'
~/pager
'
;
describe
(
'
pager
'
,
()
=>
{
describe
(
'
pager
'
,
()
=>
{
let
axiosMock
;
beforeEach
(()
=>
{
axiosMock
=
new
MockAdapter
(
axios
);
});
afterEach
(()
=>
{
axiosMock
.
restore
();
});
describe
(
'
init
'
,
()
=>
{
describe
(
'
init
'
,
()
=>
{
const
originalHref
=
window
.
location
.
href
;
const
originalHref
=
window
.
location
.
href
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
setFixtures
(
'
<div class="content_list"></div><div class="loading"></div>
'
);
setFixtures
(
'
<div class="content_list"></div><div class="loading"></div>
'
);
spyOn
(
$
.
fn
,
'
endlessScroll
'
).
and
.
stub
();
});
});
afterEach
(()
=>
{
afterEach
(()
=>
{
...
@@ -46,33 +58,28 @@ describe('pager', () => {
...
@@ -46,33 +58,28 @@ describe('pager', () => {
describe
(
'
getOld
'
,
()
=>
{
describe
(
'
getOld
'
,
()
=>
{
const
urlRegex
=
/
(
.*
)
some_list
(
.*
)
$/
;
const
urlRegex
=
/
(
.*
)
some_list
(
.*
)
$/
;
let
mock
;
function
mockSuccess
()
{
function
mockSuccess
()
{
m
ock
.
onGet
(
urlRegex
).
reply
(
200
,
{
axiosM
ock
.
onGet
(
urlRegex
).
reply
(
200
,
{
count
:
0
,
count
:
0
,
html
:
''
,
html
:
''
,
});
});
}
}
function
mockError
()
{
function
mockError
()
{
m
ock
.
onGet
(
urlRegex
).
networkError
();
axiosM
ock
.
onGet
(
urlRegex
).
networkError
();
}
}
beforeEach
(()
=>
{
beforeEach
(()
=>
{
setFixtures
(
'
<div class="content_list" data-href="/some_list"></div><div class="loading"></div>
'
);
setFixtures
(
'
<div class="content_list" data-href="/some_list"></div><div class="loading"></div>
'
,
);
spyOn
(
axios
,
'
get
'
).
and
.
callThrough
();
spyOn
(
axios
,
'
get
'
).
and
.
callThrough
();
mock
=
new
MockAdapter
(
axios
);
Pager
.
init
();
Pager
.
init
();
});
});
afterEach
(()
=>
{
it
(
'
shows loader while loading next page
'
,
done
=>
{
mock
.
restore
();
});
it
(
'
shows loader while loading next page
'
,
(
done
)
=>
{
mockSuccess
();
mockSuccess
();
spyOn
(
Pager
.
loading
,
'
show
'
);
spyOn
(
Pager
.
loading
,
'
show
'
);
...
@@ -85,7 +92,7 @@ describe('pager', () => {
...
@@ -85,7 +92,7 @@ describe('pager', () => {
});
});
});
});
it
(
'
hides loader on success
'
,
(
done
)
=>
{
it
(
'
hides loader on success
'
,
done
=>
{
mockSuccess
();
mockSuccess
();
spyOn
(
Pager
.
loading
,
'
hide
'
);
spyOn
(
Pager
.
loading
,
'
hide
'
);
...
@@ -98,7 +105,7 @@ describe('pager', () => {
...
@@ -98,7 +105,7 @@ describe('pager', () => {
});
});
});
});
it
(
'
hides loader on error
'
,
(
done
)
=>
{
it
(
'
hides loader on error
'
,
done
=>
{
mockError
();
mockError
();
spyOn
(
Pager
.
loading
,
'
hide
'
);
spyOn
(
Pager
.
loading
,
'
hide
'
);
...
@@ -111,7 +118,7 @@ describe('pager', () => {
...
@@ -111,7 +118,7 @@ describe('pager', () => {
});
});
});
});
it
(
'
sends request to url with offset and limit params
'
,
(
done
)
=>
{
it
(
'
sends request to url with offset and limit params
'
,
done
=>
{
Pager
.
offset
=
100
;
Pager
.
offset
=
100
;
Pager
.
limit
=
20
;
Pager
.
limit
=
20
;
Pager
.
getOld
();
Pager
.
getOld
();
...
...
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