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
578cf898
Commit
578cf898
authored
Nov 14, 2012
by
Riyad Preukschas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs
parent
a85e11fa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
36 deletions
+39
-36
app/assets/javascripts/issues.js
app/assets/javascripts/issues.js
+2
-6
app/models/milestone.rb
app/models/milestone.rb
+1
-0
features/steps/project/project_browse_commits.rb
features/steps/project/project_browse_commits.rb
+2
-1
spec/models/issue_spec.rb
spec/models/issue_spec.rb
+0
-1
spec/requests/issues_spec.rb
spec/requests/issues_spec.rb
+33
-28
spec/roles/issue_commonality_spec.rb
spec/roles/issue_commonality_spec.rb
+1
-0
No files found.
app/assets/javascripts/issues.js
View file @
578cf898
...
@@ -39,10 +39,10 @@ function backToIssues(){
...
@@ -39,10 +39,10 @@ function backToIssues(){
}
}
function
initIssuesSearch
()
{
function
initIssuesSearch
()
{
var
href
=
$
(
'
.issue_search
'
).
parent
(
).
attr
(
'
action
'
);
var
href
=
$
(
'
#issue_search_form
'
).
attr
(
'
action
'
);
var
last_terms
=
''
;
var
last_terms
=
''
;
$
(
'
.
issue_search
'
).
keyup
(
function
()
{
$
(
'
#
issue_search
'
).
keyup
(
function
()
{
var
terms
=
$
(
this
).
val
();
var
terms
=
$
(
this
).
val
();
var
milestone_id
=
$
(
'
#milestone_id
'
).
val
();
var
milestone_id
=
$
(
'
#milestone_id
'
).
val
();
var
status
=
$
(
'
#status
'
).
val
();
var
status
=
$
(
'
#status
'
).
val
();
...
@@ -57,10 +57,6 @@ function initIssuesSearch() {
...
@@ -57,10 +57,6 @@ function initIssuesSearch() {
}
}
}
}
});
});
$
(
'
.delete-issue
'
).
live
(
'
ajax:success
'
,
function
()
{
$
(
this
).
closest
(
'
tr
'
).
fadeOut
();
updatePage
();
});
}
}
/**
/**
...
...
app/models/milestone.rb
View file @
578cf898
...
@@ -7,6 +7,7 @@ class Milestone < ActiveRecord::Base
...
@@ -7,6 +7,7 @@ class Milestone < ActiveRecord::Base
validates
:title
,
presence:
true
validates
:title
,
presence:
true
validates
:project
,
presence:
true
validates
:project
,
presence:
true
validates
:closed
,
inclusion:
{
in:
[
true
,
false
]
}
def
self
.
active
def
self
.
active
where
(
"due_date > ? OR due_date IS NULL"
,
Date
.
today
)
where
(
"due_date > ? OR due_date IS NULL"
,
Date
.
today
)
...
...
features/steps/project/project_browse_commits.rb
View file @
578cf898
...
@@ -53,8 +53,9 @@ class ProjectBrowseCommits < Spinach::FeatureSteps
...
@@ -53,8 +53,9 @@ class ProjectBrowseCommits < Spinach::FeatureSteps
end
end
Then
'I see commits stats'
do
Then
'I see commits stats'
do
page
.
should
have_content
'Stats
for master
'
page
.
should
have_content
'Stats'
page
.
should
have_content
'Committers'
page
.
should
have_content
'Committers'
page
.
should
have_content
'Total commits'
page
.
should
have_content
'Total commits'
page
.
should
have_content
'Authors'
end
end
end
end
spec/models/issue_spec.rb
View file @
578cf898
...
@@ -30,7 +30,6 @@ describe Issue do
...
@@ -30,7 +30,6 @@ describe Issue do
describe
"Validation"
do
describe
"Validation"
do
it
{
should
ensure_length_of
(
:description
).
is_within
(
0
..
2000
)
}
it
{
should
ensure_length_of
(
:description
).
is_within
(
0
..
2000
)
}
it
{
should
ensure_inclusion_of
(
:closed
).
in_array
([
true
,
false
])
}
end
end
describe
'modules'
do
describe
'modules'
do
...
...
spec/requests/issues_spec.rb
View file @
578cf898
...
@@ -5,24 +5,27 @@ describe "Issues" do
...
@@ -5,24 +5,27 @@ describe "Issues" do
before
do
before
do
login_as
:user
login_as
:user
@
user2
=
create
(
:user
)
user2
=
create
(
:user
)
project
.
add_access
(
@user
,
:read
,
:write
)
project
.
add_access
(
@user
,
:read
,
:write
)
project
.
add_access
(
@
user2
,
:read
,
:write
)
project
.
add_access
(
user2
,
:read
,
:write
)
end
end
describe
"Edit issue"
,
js:
true
do
describe
"Edit issue"
,
js:
true
do
let!
(
:issue
)
do
create
(
:issue
,
author:
@user
,
assignee:
@user
,
project:
project
)
end
before
do
before
do
@issue
=
create
(
:issue
,
author:
@user
,
assignee:
@user
,
project:
project
)
visit
project_issues_path
(
project
)
visit
project_issues_path
(
project
)
click_link
"Edit"
click_link
"Edit"
end
end
it
"should open new issue popup"
do
it
"should open new issue popup"
do
page
.
should
have_content
(
"Issue #
#{
@
issue
.
id
}
"
)
page
.
should
have_content
(
"Issue #
#{
issue
.
id
}
"
)
end
end
describe
"fill in"
do
describe
"fill in"
do
...
@@ -46,19 +49,18 @@ describe "Issues" do
...
@@ -46,19 +49,18 @@ describe "Issues" do
describe
"Search issue"
,
js:
true
do
describe
"Search issue"
,
js:
true
do
before
do
before
do
[
'foobar'
,
'foobar2'
,
'gitlab'
].
each
do
|
title
|
[
'foobar'
,
'foobar2'
,
'gitlab'
].
each
do
|
title
|
@issue
=
create
(
:issue
,
create
(
:issue
,
author:
@user
,
author:
@user
,
assignee:
@user
,
assignee:
@user
,
project:
project
,
project:
project
,
title:
title
)
title:
title
)
@issue
.
save
end
end
end
end
it
"should be able to search on different statuses"
do
it
"should be able to search on different statuses"
do
@issue
=
Issue
.
first
issue
=
Issue
.
first
# with title 'foobar'
@
issue
.
closed
=
true
issue
.
closed
=
true
@
issue
.
save
issue
.
save
visit
project_issues_path
(
project
)
visit
project_issues_path
(
project
)
click_link
'Closed'
click_link
'Closed'
...
@@ -81,8 +83,9 @@ describe "Issues" do
...
@@ -81,8 +83,9 @@ describe "Issues" do
it
"should return all results if term has been cleared"
do
it
"should return all results if term has been cleared"
do
visit
project_issues_path
(
project
)
visit
project_issues_path
(
project
)
fill_in
"issue_search"
,
with:
"foobar"
fill_in
"issue_search"
,
with:
"foobar"
# Because fill_in, with: "" triggers nothing we need to trigger a keyup event
# Reset the search field and trigger loading the issues
page
.
execute_script
(
"$('.issue_search').val('').keyup();"
);
fill_in
"issue_search"
,
with:
""
page
.
execute_script
(
"$('#issue_search').keyup();"
);
page
.
should
have_content
'foobar'
page
.
should
have_content
'foobar'
page
.
should
have_content
'foobar2'
page
.
should
have_content
'foobar2'
...
@@ -93,19 +96,21 @@ describe "Issues" do
...
@@ -93,19 +96,21 @@ describe "Issues" do
describe
"Filter issue"
do
describe
"Filter issue"
do
before
do
before
do
[
'foobar'
,
'barbaz'
,
'gitlab'
].
each
do
|
title
|
[
'foobar'
,
'barbaz'
,
'gitlab'
].
each
do
|
title
|
@issue
=
create
(
:issue
,
create
(
:issue
,
author:
@user
,
author:
@user
,
assignee:
@user
,
assignee:
@user
,
project:
project
,
project:
project
,
title:
title
)
title:
title
)
end
end
@issue
=
Issue
.
first
issue
=
Issue
.
first
# with title 'foobar'
@
issue
.
milestone
=
create
(
:milestone
,
project:
project
)
issue
.
milestone
=
create
(
:milestone
,
project:
project
)
@
issue
.
assignee
=
nil
issue
.
assignee
=
nil
@
issue
.
save
issue
.
save
end
end
let
(
:issue
)
{
Issue
.
first
}
it
"should allow filtering by issues with no specified milestone"
do
it
"should allow filtering by issues with no specified milestone"
do
visit
project_issues_path
(
project
,
milestone_id:
'0'
)
visit
project_issues_path
(
project
,
milestone_id:
'0'
)
...
@@ -115,7 +120,7 @@ describe "Issues" do
...
@@ -115,7 +120,7 @@ describe "Issues" do
end
end
it
"should allow filtering by a specified milestone"
do
it
"should allow filtering by a specified milestone"
do
visit
project_issues_path
(
project
,
milestone_id:
@
issue
.
milestone
.
id
)
visit
project_issues_path
(
project
,
milestone_id:
issue
.
milestone
.
id
)
page
.
should
have_content
'foobar'
page
.
should
have_content
'foobar'
page
.
should_not
have_content
'barbaz'
page
.
should_not
have_content
'barbaz'
...
...
spec/roles/issue_commonality_spec.rb
View file @
578cf898
...
@@ -15,6 +15,7 @@ describe Issue, "IssueCommonality" do
...
@@ -15,6 +15,7 @@ describe Issue, "IssueCommonality" do
it
{
should
validate_presence_of
(
:author
)
}
it
{
should
validate_presence_of
(
:author
)
}
it
{
should
validate_presence_of
(
:title
)
}
it
{
should
validate_presence_of
(
:title
)
}
it
{
should
ensure_length_of
(
:title
).
is_at_least
(
0
).
is_at_most
(
255
)
}
it
{
should
ensure_length_of
(
:title
).
is_at_least
(
0
).
is_at_most
(
255
)
}
it
{
should
ensure_inclusion_of
(
:closed
).
in_array
([
true
,
false
])
}
end
end
describe
"Scope"
do
describe
"Scope"
do
...
...
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