diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-10-04 12:37:53 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-10-04 12:37:53 +0100 |
commit | 33cf36a3dfafe64bd721e0627e2a99b56a94238c (patch) | |
tree | ad203ab96bdaa537ec44b6874b359aad4adcdc08 /spec/helpers | |
parent | b6231086aa895c83bfeb1cc7067725a9b96e8d0d (diff) | |
parent | 772af44350723936778abe45e888b2fac36da726 (diff) |
Merge remote-tracking branch 'henare_github/full-url-in-admin-emails' into develop
Diffstat (limited to 'spec/helpers')
-rw-r--r-- | spec/helpers/link_to_helper_spec.rb | 25 |
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 |