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
3d22029c
Commit
3d22029c
authored
Mar 28, 2019
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[EE] Reduce the diff with CE in spec/helpers/issuables_helper_spec.rb
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
ee02b520
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
ee/spec/helpers/issuables_helper_spec.rb
ee/spec/helpers/issuables_helper_spec.rb
+22
-0
spec/helpers/issuables_helper_spec.rb
spec/helpers/issuables_helper_spec.rb
+3
-2
No files found.
ee/spec/helpers/issuables_helper_spec.rb
0 → 100644
View file @
3d22029c
# frozen_string_literal: true
require
'spec_helper'
describe
IssuablesHelper
do
describe
'#issuable_initial_data'
do
let
(
:user
)
{
create
(
:user
)
}
before
do
allow
(
helper
).
to
receive
(
:current_user
).
and_return
(
user
)
allow
(
helper
).
to
receive
(
:can?
).
and_return
(
true
)
stub_commonmark_sourcepos_disabled
end
it
'returns the correct data that includes canAdmin: true'
do
issue
=
create
(
:issue
,
author:
user
,
description:
'issue text'
)
@project
=
issue
.
project
expect
(
helper
.
issuable_initial_data
(
issue
)).
to
include
(
canAdmin:
true
)
end
end
end
spec/helpers/issuables_helper_spec.rb
View file @
3d22029c
# frozen_string_literal: true
require
'spec_helper'
require
'spec_helper'
describe
IssuablesHelper
do
describe
IssuablesHelper
do
...
@@ -185,7 +187,6 @@ describe IssuablesHelper do
...
@@ -185,7 +187,6 @@ describe IssuablesHelper do
updateEndpoint:
"/
#{
@project
.
full_path
}
/issues/
#{
issue
.
iid
}
.json"
,
updateEndpoint:
"/
#{
@project
.
full_path
}
/issues/
#{
issue
.
iid
}
.json"
,
canUpdate:
true
,
canUpdate:
true
,
canDestroy:
true
,
canDestroy:
true
,
canAdmin:
true
,
issuableRef:
"#
#{
issue
.
iid
}
"
,
issuableRef:
"#
#{
issue
.
iid
}
"
,
markdownPreviewPath:
"/
#{
@project
.
full_path
}
/preview_markdown"
,
markdownPreviewPath:
"/
#{
@project
.
full_path
}
/preview_markdown"
,
markdownDocsPath:
'/help/user/markdown'
,
markdownDocsPath:
'/help/user/markdown'
,
...
@@ -199,7 +200,7 @@ describe IssuablesHelper do
...
@@ -199,7 +200,7 @@ describe IssuablesHelper do
initialDescriptionText:
'issue text'
,
initialDescriptionText:
'issue text'
,
initialTaskStatus:
'0 of 0 tasks completed'
initialTaskStatus:
'0 of 0 tasks completed'
}
}
expect
(
helper
.
issuable_initial_data
(
issue
)).
to
eq
(
expected_data
)
expect
(
helper
.
issuable_initial_data
(
issue
)).
to
match
(
hash_including
(
expected_data
)
)
end
end
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