aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenare Degan <henare.degan@gmail.com>2012-10-04 15:13:20 +1000
committerHenare Degan <henare.degan@gmail.com>2012-10-04 15:13:20 +1000
commit2ce05f2d6eb33f5ac4c3a27312f97b79624aa48f (patch)
tree2bb3cd4bb00388a069601cb4941e30d207312172
parent38a64203dd2e875e92c4bf4e5cd48ff59cd49526 (diff)
Change the behaviour of admin_url to always return a full URL
-rwxr-xr-xapp/helpers/link_to_helper.rb2
-rw-r--r--spec/helpers/link_to_helper_spec.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb
index c8ad7bc30..4a73b13de 100755
--- a/app/helpers/link_to_helper.rb
+++ b/app/helpers/link_to_helper.rb
@@ -222,7 +222,7 @@ module LinkToHelper
# Admin pages
def admin_url(relative_path)
admin_url_prefix = Configuration::admin_base_url
- admin_url_prefix = admin_general_index_path+"/" if admin_url_prefix.empty?
+ admin_url_prefix = admin_general_index_url + "/" if admin_url_prefix.empty?
return admin_url_prefix + relative_path
end
diff --git a/spec/helpers/link_to_helper_spec.rb b/spec/helpers/link_to_helper_spec.rb
index 098fba008..ef89e8bf9 100644
--- a/spec/helpers/link_to_helper_spec.rb
+++ b/spec/helpers/link_to_helper_spec.rb
@@ -51,11 +51,11 @@ describe LinkToHelper do
describe 'admin_url' do
context 'with no ADMIN_BASE_URL set' do
it 'should prepend the admin general index path to a simple string' do
- admin_url('unclassified').should == '/en/admin/unclassified'
+ admin_url('unclassified').should == 'http://test.host/en/admin/unclassified'
end
it 'should prepend the admin general index path to a deeper URL' do
- admin_url('request/show/123').should == '/en/admin/request/show/123'
+ admin_url('request/show/123').should == 'http://test.host/en/admin/request/show/123'
end
end