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
e3becb82
Commit
e3becb82
authored
Jun 17, 2021
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for configured?
parent
7207d9dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
spec/models/integrations/jira_spec.rb
spec/models/integrations/jira_spec.rb
+46
-0
No files found.
spec/models/integrations/jira_spec.rb
View file @
e3becb82
...
...
@@ -1078,4 +1078,50 @@ RSpec.describe Integrations::Jira do
expect
(
jira_integration
.
issue_transition_enabled?
).
to
be
(
false
)
end
end
describe
'valid_connection? and configured?'
do
before
do
allow
(
jira_integration
).
to
receive
(
:test
).
with
(
nil
).
and_return
(
test_result
)
end
context
'when the test fails'
do
let
(
:test_result
)
{
{
success:
false
}
}
it
'is falsey'
do
expect
(
jira_integration
).
not_to
be_valid_connection
end
it
'implies that configured? is also falsey'
do
expect
(
jira_integration
).
not_to
be_configured
end
end
context
'when the test succeeds'
do
let
(
:test_result
)
{
{
success:
true
}
}
it
'is truthy'
do
expect
(
jira_integration
).
to
be_valid_connection
end
context
'when the integration is active'
do
before
do
jira_integration
.
active
=
true
end
it
'implies that configured? is also truthy'
do
expect
(
jira_integration
).
to
be_configured
end
end
context
'when the integration is inactive'
do
before
do
jira_integration
.
active
=
false
end
it
'implies that configured? is falsey'
do
expect
(
jira_integration
).
not_to
be_configured
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