aboutsummaryrefslogtreecommitdiffstats
path: root/spec/helpers/link_to_helper_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-03-06 17:11:47 -0800
committerLouise Crow <louise.crow@gmail.com>2013-03-06 17:11:47 -0800
commitfc770ee6eb342d4562b6588612f1c9aca46f58e1 (patch)
tree8833be60c0f0cb39d33dbaf4538ceca8d848e57f /spec/helpers/link_to_helper_spec.rb
parent455a1f07f3099d1d94fff2a7efcf99fb8fd6841d (diff)
parent7abb45b0549af892b7f1ec2beeca5a42f8c2ef7a (diff)
Merge remote-tracking branch 'openaustralia_github/make-links-relative' into develop
Conflicts: app/controllers/admin_request_controller.rb app/models/request_mailer.rb app/views/admin_general/index.rhtml app/views/admin_general/stats.rhtml app/views/admin_public_body/_one_list.rhtml app/views/admin_public_body/_tags.rhtml app/views/admin_public_body/show.rhtml app/views/admin_request/show.rhtml app/views/admin_user/show.rhtml app/views/layouts/admin.rhtml app/views/public_body/show.rhtml app/views/request/new.rhtml
Diffstat (limited to 'spec/helpers/link_to_helper_spec.rb')
-rw-r--r--spec/helpers/link_to_helper_spec.rb42
1 files changed, 2 insertions, 40 deletions
diff --git a/spec/helpers/link_to_helper_spec.rb b/spec/helpers/link_to_helper_spec.rb
index 030fd612d..3e997f9f9 100644
--- a/spec/helpers/link_to_helper_spec.rb
+++ b/spec/helpers/link_to_helper_spec.rb
@@ -17,27 +17,15 @@ describe LinkToHelper do
it 'should return a path like /request/test_title' do
- request_url(@mock_request).should == '/request/test_title'
+ request_path(@mock_request).should == '/request/test_title'
end
it 'should return a path including any extra parameters passed' do
- request_url(@mock_request, {:update_status => 1}).should == '/request/test_title?update_status=1'
+ request_path(@mock_request, {:update_status => 1}).should == '/request/test_title?update_status=1'
end
end
- describe "when appending something to a URL" do
- it 'should append to things without query strings' do
- main_url('/a', '.json').should == 'http://test.host/a.json'
- end
- it 'should append to things with query strings' do
- main_url('/a?z=1', '.json').should == 'http://test.host/a.json?z=1'
- end
- it 'should fail silently with invalid URLs' do
- main_url('/a?z=9%', '.json').should == 'http://test.host/a?z=9%'
- end
- end
-
describe 'when displaying a user admin link for a request' do
it 'should return the text "An anonymous user (external)" in the case where there is no external username' do
@@ -48,32 +36,6 @@ 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
-
describe 'simple_date' do
it 'should respect time zones' do
Time.use_zone('Australia/Sydney') do