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
37bbdb60
Commit
37bbdb60
authored
Jan 06, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added spec for testing the issuable count
parent
a5759710
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
26 deletions
+32
-26
spec/javascripts/fixtures/issuables.html.haml
spec/javascripts/fixtures/issuables.html.haml
+0
-5
spec/javascripts/milestones_spec.js.es6
spec/javascripts/milestones_spec.js.es6
+0
-21
spec/views/shared/milestones/_issuables.html.haml.rb
spec/views/shared/milestones/_issuables.html.haml.rb
+32
-0
No files found.
spec/javascripts/fixtures/issuables.html.haml
deleted
100644 → 0
View file @
a5759710
.panel.panel-default
.panel-heading
Unstarted Issues (open and unassigned)
.pull-right
1
spec/javascripts/milestones_spec.js.es6
deleted
100644 → 0
View file @
a5759710
/*= require jquery */
(() => {
describe('MilestonePanel', () => {
const issuesCount = '.pull-right';
const fixtureTemplate = 'issuables.html';
function setIssuesCount(newCount) {
$(issuesCount).text(newCount);
}
fixture.preload(fixtureTemplate);
beforeEach(() => {
fixture.load(fixtureTemplate);
});
it('should add delimiter to the issues count', () => {
setIssuesCount(1000);
expect($(issuesCount).text()).toEqual('1,000');
});
});
})();
spec/views/shared/milestones/_issuables.html.haml.rb
0 → 100644
View file @
37bbdb60
require
'spec_helper'
describe
'shared/milestones/_issuables.html.haml'
do
let
(
:issuables_size
)
{
100
}
before
do
allow
(
view
).
to
receive_messages
(
title:
nil
,
id:
nil
,
show_project_name:
nil
,
show_full_project_name:
nil
,
dom_class:
''
,
issuables:
double
(
size:
issuables_size
).
as_null_object
)
stub_template
'shared/milestones/_issuable.html.haml'
=>
''
end
it
'should show the issuables count if show_counter is true'
do
render
'shared/milestones/issuables'
,
show_counter:
true
expect
(
rendered
).
to
have_content
(
'100'
)
end
it
'should not show the issuables count if show_counter is false'
do
render
'shared/milestones/issuables'
,
show_counter:
false
expect
(
rendered
).
not_to
have_content
(
'100'
)
end
describe
'a high issuables count'
do
let
(
:issuables_size
)
{
1000
}
it
'should show a delimited number if show_counter is true'
do
render
'shared/milestones/issuables'
,
show_counter:
true
expect
(
rendered
).
to
have_content
(
'1,000'
)
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