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
1b3bb52a
Commit
1b3bb52a
authored
Sep 05, 2017
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix feature spec contexts.
parent
a2a17e0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
46 deletions
+50
-46
spec/ee/spec/features/issues/service_desk_spec.rb
spec/ee/spec/features/issues/service_desk_spec.rb
+50
-46
No files found.
spec/ee/spec/features/issues/service_desk_spec.rb
View file @
1b3bb52a
...
...
@@ -2,15 +2,11 @@ require 'spec_helper'
describe
'Service Desk Issue Tracker'
,
focus:
true
do
let
(
:project
)
{
create
(
:project
,
:private
,
service_desk_enabled:
true
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:regular_issue
)
{
create
(
:issue
,
project:
project
,
title:
'My invisible issue'
,
author:
user
)
}
let
(
:service_desk_issue
)
{
create
(
:issue
,
project:
project
,
title:
'My visible issue'
,
author:
User
.
support_bot
)
}
let
(
:user
)
{
create
(
:user
)
}
before
do
allow
(
License
).
to
receive
(
:feature_available?
).
and_call_original
allow
(
License
).
to
receive
(
:feature_available?
).
with
(
:service_desk
)
{
true
}
allow
(
Gitlab
::
IncomingEmail
).
to
receive
(
:enabled?
)
{
true
}
allow
(
Gitlab
::
IncomingEmail
).
to
receive
(
:supports_wildcard?
)
{
true
}
project
.
add_master
(
user
)
sign_in
(
user
)
...
...
@@ -30,7 +26,6 @@ describe 'Service Desk Issue Tracker', focus: true do
describe
'issues list'
,
js:
true
do
before
do
puts
service_desk_project_issues_path
(
project
)
visit
service_desk_project_issues_path
(
project
)
end
...
...
@@ -50,61 +45,70 @@ describe 'Service Desk Issue Tracker', focus: true do
end
end
context
'when
there are no issues
'
do
describe
'service desk info content'
do
it
'displays the large info box'
do
expect
(
page
).
to
have_css
(
'.empty-state'
)
end
context
'when
service desk has been activated
'
do
before
do
allow
(
Gitlab
::
IncomingEmail
).
to
receive
(
:enabled?
)
{
true
}
allow
(
Gitlab
::
IncomingEmail
).
to
receive
(
:supports_wildcard?
)
{
true
}
end
it
'has a link to the documentation'
do
expect
(
page
).
to
have_link
(
'Read more'
,
href:
help_page_path
(
'user/project/service_desk'
))
end
context
'when there are no issues'
do
describe
'service desk info content'
do
it
'displays the large info box'
do
expect
(
page
).
to
have_css
(
'.empty-state'
)
end
it
'does not show a button configure service desk'
do
expect
(
page
).
not_to
have_link
(
'Turn on Service Desk'
)
end
it
'has a link to the documentation'
do
expect
(
page
).
to
have_link
(
'Read more'
,
href:
help_page_path
(
'user/project/service_desk'
))
end
it
'does not show a button configure service desk'
do
expect
(
page
).
not_to
have_link
(
'Turn on Service Desk'
)
end
it
'shows the service desk email address'
do
expect
(
page
).
to
have_content
(
project
.
service_desk_address
)
it
'shows the service desk email address'
do
expect
(
page
).
to
have_content
(
project
.
service_desk_address
)
end
end
end
end
context
'when there are issues'
do
context
'when there are issues'
do
let
(
:regular_issue
)
{
create
(
:issue
,
project:
project
,
title:
'My invisible issue'
,
author:
user
)
}
let
(
:service_desk_issue
)
{
create
(
:issue
,
project:
project
,
title:
'My visible issue'
,
author:
User
.
support_bot
)
}
describe
'service desk info content'
do
it
'displays the small info box'
do
expect
(
page
).
to
have_css
(
'.non-empty-state'
)
end
describe
'service desk info content'
do
it
'displays the small info box'
do
expect
(
page
).
to
have_css
(
'.non-empty-state'
)
end
it
'has a link to the documentation'
do
expect
(
page
).
to
have_link
(
'Read more'
,
href:
help_page_path
(
'user/project/service_desk'
))
end
it
'has a link to the documentation'
do
expect
(
page
).
to
have_link
(
'Read more'
,
href:
help_page_path
(
'user/project/service_desk'
))
end
it
'does not show a button configure service desk'
do
expect
(
page
).
not_to
have_link
(
'Turn on Service Desk'
)
end
it
'does not show a button configure service desk'
do
expect
(
page
).
not_to
have_link
(
'Turn on Service Desk'
)
end
it
'shows the service desk email address'
do
expect
(
page
).
to
have_content
(
project
.
service_desk_address
)
it
'shows the service desk email address'
do
expect
(
page
).
to
have_content
(
project
.
service_desk_address
)
end
end
end
describe
'issues list'
do
it
'only displays issues created by support bot'
do
expect
(
page
).
to
have_selector
(
'.issues-list .issue'
,
count:
1
)
describe
'issues list'
do
it
'only displays issues created by support bot'
do
expect
(
page
).
to
have_selector
(
'.issues-list .issue'
,
count:
1
)
end
end
end
describe
'search box'
do
it
'displays the support bot author token'
do
author_token
=
find
(
'.filtered-search-token .value'
)
expect
(
author_token
).
to
have_content
(
'Support Bot'
)
end
describe
'search box'
do
it
'displays the support bot author token'
do
author_token
=
find
(
'.filtered-search-token .value'
)
expect
(
author_token
).
to
have_content
(
'Support Bot'
)
end
it
'support bot author token cannot be deleted'
do
find
(
'.input-token .filtered-search'
).
native
.
send_key
(
:backspace
)
expect
(
page
).
to
have_selector
(
'.js-visual-token'
,
count:
1
)
it
'support bot author token cannot be deleted'
do
find
(
'.input-token .filtered-search'
).
native
.
send_key
(
:backspace
)
expect
(
page
).
to
have_selector
(
'.js-visual-token'
,
count:
1
)
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