Skip to content

Commit

Permalink
Fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Douwe Maan committed Jul 29, 2015
1 parent 76b3e44 commit 72c552c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/models/project.rb
Expand Up @@ -571,7 +571,7 @@ def ssh_url_to_repo
end

def http_url_to_repo
[gitlab_config.url, '/', path_with_namespace, '.git'].join('')
"#{web_url}.git"
end

# Check if current branch name is marked as protected in the system
Expand Down
18 changes: 12 additions & 6 deletions spec/models/project_spec.rb
Expand Up @@ -111,14 +111,20 @@
expect(project.url_to_repo).to eq(Gitlab.config.gitlab_shell.ssh_path_prefix + 'somewhere.git')
end

it 'returns the full web URL for this repo' do
project = Project.new(path: 'somewhere')
expect(project.web_url).to eq("#{Gitlab.config.gitlab.url}/somewhere")
describe "#web_url" do
let(:project) { create(:empty_project, path: "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

it 'returns the web URL without the protocol for this repo' do
project = Project.new(path: 'somewhere')
expect(project.web_url_without_protocol).to eq("#{Gitlab.config.gitlab.url.split('://')[1]}/somewhere")
describe "#web_url_without_protocol" do
let(:project) { create(:empty_project, path: "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

describe 'last_activity methods' do
Expand Down

0 comments on commit 72c552c

Please sign in to comment.