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
59fa8dca
Commit
59fa8dca
authored
Nov 04, 2016
by
Ruben Davila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken specs.
parent
09e1faa8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
14 deletions
+33
-14
app/services/slash_commands/interpret_service.rb
app/services/slash_commands/interpret_service.rb
+1
-1
db/migrate/20161030005533_add_estimate_to_issuables.rb
db/migrate/20161030005533_add_estimate_to_issuables.rb
+2
-2
db/migrate/20161030020610_create_timelogs.rb
db/migrate/20161030020610_create_timelogs.rb
+4
-0
lib/gitlab/import_export/import_export.yml
lib/gitlab/import_export/import_export.yml
+2
-0
spec/lib/gitlab/import_export/all_models.yml
spec/lib/gitlab/import_export/all_models.yml
+4
-0
spec/lib/gitlab/import_export/safe_model_attributes.yml
spec/lib/gitlab/import_export/safe_model_attributes.yml
+10
-1
spec/services/slash_commands/interpret_service_spec.rb
spec/services/slash_commands/interpret_service_spec.rb
+10
-10
No files found.
app/services/slash_commands/interpret_service.rb
View file @
59fa8dca
...
...
@@ -251,7 +251,7 @@ module SlashCommands
desc
'Set estimate'
params
'e.g: 1w 3d 2h 14m'
condition
do
current_user
.
can?
(
:"
admin
_
#{
issuable
.
to_ability_name
}
"
,
project
)
current_user
.
can?
(
:"
update
_
#{
issuable
.
to_ability_name
}
"
,
project
)
end
command
:estimate
do
|
raw_duration
|
@updates
[
:time_estimate
]
=
ChronicDuration
.
parse
(
raw_duration
,
default_unit:
'hours'
)
...
...
db/migrate/20161030005533_add_estimate_to_issuables.rb
View file @
59fa8dca
...
...
@@ -24,7 +24,7 @@ class AddEstimateToIssuables < ActiveRecord::Migration
# disable_ddl_transaction!
def
change
add_column
:issues
,
:time_estimate
,
:integer
,
default:
0
add_column
:merge_requests
,
:time_estimate
,
:integer
,
default:
0
add_column
_with_default
:issues
,
:time_estimate
,
:integer
,
default:
0
add_column
_with_default
:merge_requests
,
:time_estimate
,
:integer
,
default:
0
end
end
db/migrate/20161030020610_create_timelogs.rb
View file @
59fa8dca
class
CreateTimelogs
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
def
change
create_table
:timelogs
do
|
t
|
t
.
integer
:time_spent
,
null:
false
...
...
lib/gitlab/import_export/import_export.yml
View file @
59fa8dca
...
...
@@ -6,6 +6,7 @@ project_tree:
-
:events
-
issues
:
-
:events
-
:timelogs
-
notes
:
-
:author
-
:events
...
...
@@ -27,6 +28,7 @@ project_tree:
-
:events
-
:merge_request_diff
-
:events
-
:timelogs
-
label_links
:
-
label
:
:priorities
...
...
spec/lib/gitlab/import_export/all_models.yml
View file @
59fa8dca
...
...
@@ -15,6 +15,7 @@ issues:
-
events
-
merge_requests_closing_issues
-
metrics
-
timelogs
events
:
-
author
-
project
...
...
@@ -80,6 +81,7 @@ merge_requests:
-
approvals
-
approvers
-
approver_groups
-
timelogs
merge_request_diff
:
-
merge_request
pipelines
:
...
...
@@ -207,3 +209,5 @@ award_emoji:
-
user
priorities
:
-
label
timelogs
:
-
trackable
spec/lib/gitlab/import_export/safe_model_attributes.yml
View file @
59fa8dca
...
...
@@ -20,6 +20,7 @@ Issue:
-
lock_version
-
milestone_id
-
weight
-
time_estimate
Event
:
-
id
-
target_type
...
...
@@ -151,6 +152,7 @@ MergeRequest:
-
milestone_id
-
approvals_before_merge
-
rebase_commit_sha
-
time_estimate
MergeRequestDiff
:
-
id
-
state
...
...
@@ -345,4 +347,11 @@ LabelPriority:
-
label_id
-
priority
-
created_at
-
updated_at
\ No newline at end of file
-
updated_at
Timelog
:
-
id
-
time_spent
-
trackable_id
-
trackable_type
-
created_at
-
updated_at
spec/services/slash_commands/interpret_service_spec.rb
View file @
59fa8dca
...
...
@@ -467,6 +467,16 @@ describe SlashCommands::InterpretService, services: true do
let
(
:issuable
)
{
merge_request
}
end
it_behaves_like
'estimate command'
do
let
(
:content
)
{
'/estimate 1h'
}
let
(
:issuable
)
{
issue
}
end
it_behaves_like
'spend command'
do
let
(
:content
)
{
'/spend 1h'
}
let
(
:issuable
)
{
issue
}
end
context
'when current_user cannot :admin_issue'
do
let
(
:visitor
)
{
create
(
:user
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
author:
visitor
)
}
...
...
@@ -516,16 +526,6 @@ describe SlashCommands::InterpretService, services: true do
let
(
:content
)
{
'/remove_due_date'
}
let
(
:issuable
)
{
issue
}
end
it_behaves_like
'estimate command'
do
let
(
:content
)
{
'/estimate 1h'
}
let
(
:issuable
)
{
issue
}
end
it_behaves_like
'spend command'
do
let
(
:content
)
{
'/spend 1h'
}
let
(
:issuable
)
{
issue
}
end
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