aboutsummaryrefslogtreecommitdiffstats
path: root/spec/helpers/link_to_helper_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2012-10-17 15:05:37 +0100
committerLouise Crow <louise.crow@gmail.com>2012-10-17 15:05:37 +0100
commitc8a203e221a55a5653596f5a8e092bd3877df9c4 (patch)
tree3de4ac1214eca2c12a357e5f338b0d3055e79721 /spec/helpers/link_to_helper_spec.rb
parente6dc0f6606b26e13cb0cd16124fdb2aad3c1b5a6 (diff)
parentcc7bc36d5748c9baa0cfd8e44395923cc5792f32 (diff)
Merge branch 'release/0.6.7'
Conflicts: locale/cs/app.po locale/ro_RO/app.po
Diffstat (limited to 'spec/helpers/link_to_helper_spec.rb')
-rw-r--r--spec/helpers/link_to_helper_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/helpers/link_to_helper_spec.rb b/spec/helpers/link_to_helper_spec.rb
index 9ec0afce1..ef89e8bf9 100644
--- a/spec/helpers/link_to_helper_spec.rb
+++ b/spec/helpers/link_to_helper_spec.rb
@@ -48,4 +48,29 @@ describe LinkToHelper do
end
+ 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 == '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 == 'http://test.host/en/admin/request/show/123'
+ end
+ end
+
+ context 'with ADMIN_BASE_URL set' do
+ before(:each) do
+ Configuration::should_receive(:admin_base_url).and_return('https://www.example.com/secure/alaveteli-admin/')
+ end
+
+ it 'should prepend the admin base URL to a simple string' do
+ admin_url('unclassified').should == 'https://www.example.com/secure/alaveteli-admin/unclassified'
+ end
+
+ it 'should prepend the admin base URL to a deeper URL' do
+ admin_url('request/show/123').should == 'https://www.example.com/secure/alaveteli-admin/request/show/123'
+ end
+ end
+ end
end