Commit d583ef5ed5cbc8964961ef642e4c4952999d850d

Don't prepend http:// to empty project urls

Commit diff

TODO.txt

 
11(in no particular order)
22
3two from Yurii:
41) show commits actually merged for merge request after actual merge (I see them on open request, but do not on merged one)
52) provide clone url on every repo browsing page, so I can get url to pull from even if I am reading a commit
6
37* tree browser: deal better with funny characters: http://gitorious.org/projects/avara/repos/mainline/trees/master
48* if you comment on a specific commit, you should get redirected back there
59* graphs should show username (if we have it) for avoiding confusion and for consistency
toggle raw diff

app/models/project.rb

 
144144
145145 # Try our best to guess the url
146146 def clean_url(url)
147 return if url.blank?
147148 begin
148149 url = "http://#{url}" if URI.parse(url).class == URI::Generic
149150 rescue
toggle raw diff

spec/models/project_spec.rb

 
103103 project.send(attr).should == 'http://blah.com'
104104 end
105105 end
106
107 it "should not prepend http:// to empty urls" do
108 project = projects(:johans)
109 [ :home_url, :mailinglist_url, :bugtracker_url ].each do |attr|
110 project.send("#{attr}=", '')
111 project.send(attr).should be_blank
112 project.send("#{attr}=", nil)
113 project.send(attr).should be_blank
114 end
115 end
106116
107117end
toggle raw diff