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
Jérome Perrin
gitlab-ce
Commits
5db15654
Commit
5db15654
authored
Jul 13, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent GitLab issue tracker spec from failing later specs
parent
d0b50e44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
18 deletions
+9
-18
spec/models/project_services/gitlab_issue_tracker_service_spec.rb
...els/project_services/gitlab_issue_tracker_service_spec.rb
+9
-18
No files found.
spec/models/project_services/gitlab_issue_tracker_service_spec.rb
View file @
5db15654
...
...
@@ -23,38 +23,29 @@ describe GitlabIssueTrackerService, models: true do
describe
'project and issue urls'
do
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:service
)
{
project
.
create_gitlab_issue_tracker_service
(
active:
true
)
}
context
'with absolute urls'
do
before
do
GitlabIssueTrackerService
.
default_url_options
[
:script_name
]
=
"/gitlab/root"
@service
=
project
.
create_gitlab_issue_tracker_service
(
active:
true
)
end
after
do
@service
.
destroy!
allow
(
GitlabIssueTrackerService
).
to
receive
(
:default_url_options
).
and_return
(
script_name:
"/gitlab/root"
)
end
it
'gives the correct path'
do
expect
(
@
service
.
project_url
).
to
eq
(
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}
/gitlab/root/
#{
project
.
path_with_namespace
}
/issues"
)
expect
(
@
service
.
new_issue_url
).
to
eq
(
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}
/gitlab/root/
#{
project
.
path_with_namespace
}
/issues/new"
)
expect
(
@
service
.
issue_url
(
432
)).
to
eq
(
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}
/gitlab/root/
#{
project
.
path_with_namespace
}
/issues/432"
)
expect
(
service
.
project_url
).
to
eq
(
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}
/gitlab/root/
#{
project
.
path_with_namespace
}
/issues"
)
expect
(
service
.
new_issue_url
).
to
eq
(
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}
/gitlab/root/
#{
project
.
path_with_namespace
}
/issues/new"
)
expect
(
service
.
issue_url
(
432
)).
to
eq
(
"http://
#{
Gitlab
.
config
.
gitlab
.
host
}
/gitlab/root/
#{
project
.
path_with_namespace
}
/issues/432"
)
end
end
context
'with relative urls'
do
before
do
GitlabIssueTrackerService
.
default_url_options
[
:script_name
]
=
"/gitlab/root"
@service
=
project
.
create_gitlab_issue_tracker_service
(
active:
true
)
end
after
do
@service
.
destroy!
allow
(
GitlabIssueTrackerService
).
to
receive
(
:default_url_options
).
and_return
(
script_name:
"/gitlab/root"
)
end
it
'gives the correct path'
do
expect
(
@
service
.
project_path
).
to
eq
(
"/gitlab/root/
#{
project
.
path_with_namespace
}
/issues"
)
expect
(
@
service
.
new_issue_path
).
to
eq
(
"/gitlab/root/
#{
project
.
path_with_namespace
}
/issues/new"
)
expect
(
@
service
.
issue_path
(
432
)).
to
eq
(
"/gitlab/root/
#{
project
.
path_with_namespace
}
/issues/432"
)
expect
(
service
.
project_path
).
to
eq
(
"/gitlab/root/
#{
project
.
path_with_namespace
}
/issues"
)
expect
(
service
.
new_issue_path
).
to
eq
(
"/gitlab/root/
#{
project
.
path_with_namespace
}
/issues/new"
)
expect
(
service
.
issue_path
(
432
)).
to
eq
(
"/gitlab/root/
#{
project
.
path_with_namespace
}
/issues/432"
)
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