Commit 72c552c2 authored by Douwe Maan's avatar Douwe Maan

Fix specs

parent 76b3e44c
...@@ -571,7 +571,7 @@ class Project < ActiveRecord::Base ...@@ -571,7 +571,7 @@ class Project < ActiveRecord::Base
end end
def http_url_to_repo def http_url_to_repo
[gitlab_config.url, '/', path_with_namespace, '.git'].join('') "#{web_url}.git"
end end
# Check if current branch name is marked as protected in the system # Check if current branch name is marked as protected in the system
......
...@@ -111,14 +111,20 @@ describe Project do ...@@ -111,14 +111,20 @@ describe Project do
expect(project.url_to_repo).to eq(Gitlab.config.gitlab_shell.ssh_path_prefix + 'somewhere.git') expect(project.url_to_repo).to eq(Gitlab.config.gitlab_shell.ssh_path_prefix + 'somewhere.git')
end end
it 'returns the full web URL for this repo' do describe "#web_url" do
project = Project.new(path: 'somewhere') let(:project) { create(:empty_project, path: "somewhere") }
expect(project.web_url).to eq("#{Gitlab.config.gitlab.url}/somewhere")
it 'returns the full web URL for this repo' do
expect(project.web_url).to eq("#{Gitlab.config.gitlab.url}/#{project.namespace.path}/somewhere")
end
end end
it 'returns the web URL without the protocol for this repo' do describe "#web_url_without_protocol" do
project = Project.new(path: 'somewhere') let(:project) { create(:empty_project, path: "somewhere") }
expect(project.web_url_without_protocol).to eq("#{Gitlab.config.gitlab.url.split('://')[1]}/somewhere")
it 'returns the web URL without the protocol for this repo' do
expect(project.web_url_without_protocol).to eq("#{Gitlab.config.gitlab.url.split('://')[1]}/#{project.namespace.path}/somewhere")
end
end end
describe 'last_activity methods' do describe 'last_activity methods' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment