Commit cab263df36c3ef7330ef226e105f9f9af3c4e224
1 parent
3d9b6046
Exists in
master
and in
29 other branches
ActionItem519: all URL's without a hostname are relative to the
environment's top url. Since article urls always include a host, there is no problem git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2323 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
7 additions
and
0 deletions
Show diff stats
app/views/layouts/application.rhtml
... | ... | @@ -42,6 +42,7 @@ |
42 | 42 | <%= stylesheet_link_tag '/designs/templates/default/stylesheets/style.css' %> |
43 | 43 | <%= stylesheet_link_tag '/designs/icons/default/style.css' %> |
44 | 44 | |
45 | + <base href="<%= environment.top_url %>"/> | |
45 | 46 | </head> |
46 | 47 | |
47 | 48 | <body class='noosfero category<%= category_color %><%= | ... | ... |
test/functional/application_controller_test.rb
... | ... | @@ -187,4 +187,10 @@ class ApplicationControllerTest < Test::Unit::TestCase |
187 | 187 | assert_no_tag :tag => 'div', :attributes => { :id => 'user_box' }, :descendant => { :tag => 'a', :attributes => { :href => 'http://web.mail/' } } |
188 | 188 | end |
189 | 189 | |
190 | + should 'use environment top_url as base' do | |
191 | + Environment.any_instance.expects(:top_url).returns('http://www.lala.net') | |
192 | + get :index | |
193 | + assert_tag :tag => 'base', :attributes => { :href => 'http://www.lala.net' } | |
194 | + end | |
195 | + | |
190 | 196 | end | ... | ... |