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
Boxiang Sun
gitlab-ce
Commits
6fad5640
Commit
6fad5640
authored
May 29, 2017
by
Jarka Kadlecova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix failing specs
parent
b71025c0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
41 deletions
+6
-41
spec/controllers/projects/services_controller_spec.rb
spec/controllers/projects/services_controller_spec.rb
+2
-2
spec/features/projects/services/jira_service_spec.rb
spec/features/projects/services/jira_service_spec.rb
+4
-4
spec/models/project_services/jira_service_spec.rb
spec/models/project_services/jira_service_spec.rb
+0
-35
No files found.
spec/controllers/projects/services_controller_spec.rb
View file @
6fad5640
...
...
@@ -64,14 +64,14 @@ describe Projects::ServicesController do
end
context
'failure'
do
it
'returns
500
status code and the error message'
do
it
'returns
success
status code and the error message'
do
expect
(
HipChat
::
Client
).
to
receive
(
:new
).
with
(
'hipchat_token_p'
,
anything
).
and_raise
(
'Bad test'
)
put
:test
,
namespace_id:
project
.
namespace
.
id
,
project_id:
project
.
id
,
id:
service
.
id
,
service:
service_params
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
JSON
.
parse
(
response
.
body
)).
to
eq
(
'error'
=>
true
,
'message'
=>
'Test failed'
,
'service_response'
=>
'Bad test'
)
to
eq
(
'error'
=>
true
,
'message'
=>
'Test failed
.
'
,
'service_response'
=>
'Bad test'
)
end
end
end
...
...
spec/features/projects/services/jira_service_spec.rb
View file @
6fad5640
...
...
@@ -35,7 +35,7 @@ feature 'Setup Jira service', :feature, :js do
click_link
(
'JIRA'
)
fill_form
click_button
(
'Test settings and save changes'
)
wait_for_
ajax
wait_for_
requests
expect
(
page
).
to
have_content
(
'JIRA activated.'
)
expect
(
current_path
).
to
eq
(
namespace_project_settings_integrations_path
(
project
.
namespace
,
project
))
...
...
@@ -51,12 +51,12 @@ feature 'Setup Jira service', :feature, :js do
click_link
(
'JIRA'
)
fill_form
click_button
(
'Test settings and save changes'
)
wait_for_
ajax
wait_for_
requests
expect
(
page
).
to
have_content
(
'Test failed.Save anyway'
)
click_on
(
'Save anyway
'
)
wait_for_
ajax
find
(
'.flash-alert .flash-action'
).
trigger
(
'click
'
)
wait_for_
requests
expect
(
page
).
to
have_content
(
'JIRA activated.'
)
expect
(
current_path
).
to
eq
(
namespace_project_settings_integrations_path
(
project
.
namespace
,
project
))
...
...
spec/models/project_services/jira_service_spec.rb
View file @
6fad5640
...
...
@@ -69,41 +69,6 @@ describe JiraService, models: true do
end
end
describe
'#can_test?'
do
let
(
:jira_service
)
{
described_class
.
new
}
it
'returns false if username is blank'
do
allow
(
jira_service
).
to
receive_messages
(
url:
'http://jira.example.com'
,
username:
''
,
password:
'12345678'
)
expect
(
jira_service
.
can_test?
).
to
be_falsy
end
it
'returns false if password is blank'
do
allow
(
jira_service
).
to
receive_messages
(
url:
'http://jira.example.com'
,
username:
'tester'
,
password:
''
)
expect
(
jira_service
.
can_test?
).
to
be_falsy
end
it
'returns true if password and username are present'
do
jira_service
=
described_class
.
new
allow
(
jira_service
).
to
receive_messages
(
url:
'http://jira.example.com'
,
username:
'tester'
,
password:
'12345678'
)
expect
(
jira_service
.
can_test?
).
to
be_truthy
end
end
describe
'#close_issue'
do
let
(
:custom_base_url
)
{
'http://custom_url'
}
let
(
:user
)
{
create
(
:user
)
}
...
...
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