summaryrefslogtreecommitdiff
path: root/spec/models/project_wiki_spec.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-05-30 14:18:58 +0200
committerRémy Coutable <remy@rymai.me>2017-05-30 14:18:58 +0200
commitbf4cc9e1f3ca6e4d828eb2bc1ca22d4f350c9dc6 (patch)
tree2c402a7f088b7e0b3d3f7dd1903b8420f5dc7cf3 /spec/models/project_wiki_spec.rb
parentfd376b3ed4de310f8e599cbbeb5c18e5a31c188c (diff)
downloadgitlab-ce-bf4cc9e1f3ca6e4d828eb2bc1ca22d4f350c9dc6.tar.gz
Don't allow to pass a user to ProjectWiki#http_url_to_repo
This partially reverts be25bbc4d2c7e3d5cf3da6f51cb7f7355295ef52. Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/models/project_wiki_spec.rb')
-rw-r--r--spec/models/project_wiki_spec.rb18
1 files changed, 4 insertions, 14 deletions
diff --git a/spec/models/project_wiki_spec.rb b/spec/models/project_wiki_spec.rb
index 969e9f7a130..224067f58dd 100644
--- a/spec/models/project_wiki_spec.rb
+++ b/spec/models/project_wiki_spec.rb
@@ -37,21 +37,11 @@ describe ProjectWiki, models: true do
describe "#http_url_to_repo" do
let(:project) { create :empty_project }
- context 'when no user is given' do
- it 'returns the url to the repo without a username' do
- expected_url = "#{Gitlab.config.gitlab.url}/#{subject.path_with_namespace}.git"
+ it 'returns the full http url to the repo' do
+ expected_url = "#{Gitlab.config.gitlab.url}/#{subject.path_with_namespace}.git"
- expect(project_wiki.http_url_to_repo).to eq(expected_url)
- expect(project_wiki.http_url_to_repo).not_to include('@')
- end
- end
-
- context 'when user is given' do
- it 'returns the url to the repo with the username' do
- user = build_stubbed(:user)
-
- expect(project_wiki.http_url_to_repo(user)).to start_with("http://#{user.username}@")
- end
+ expect(project_wiki.http_url_to_repo).to eq(expected_url)
+ expect(project_wiki.http_url_to_repo).not_to include('@')
end
end