From 8ab884f0da68b17f33577a197ebd0e7d412a28ed Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Fri, 25 Jan 2013 11:23:43 +1100 Subject: Disable routing filter in tests by using RoutingFilter.active rather than writing to ActionController::Routing::Routes.filters --- spec/helpers/link_to_helper_spec.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'spec/helpers/link_to_helper_spec.rb') diff --git a/spec/helpers/link_to_helper_spec.rb b/spec/helpers/link_to_helper_spec.rb index 030fd612d..f525c9819 100644 --- a/spec/helpers/link_to_helper_spec.rb +++ b/spec/helpers/link_to_helper_spec.rb @@ -8,11 +8,10 @@ describe LinkToHelper do before do @mock_request = mock_model(InfoRequest, :url_title => 'test_title') - @old_filters = ActionController::Routing::Routes.filters - ActionController::Routing::Routes.filters = RoutingFilter::Chain.new + RoutingFilter.active = false end after do - ActionController::Routing::Routes.filters = @old_filters + RoutingFilter.active = true end -- cgit v1.2.3 From cbdff06aa95a7987b54c712dc6729e138f608eca Mon Sep 17 00:00:00 2001 From: Henare Degan Date: Sun, 3 Mar 2013 14:52:30 +1100 Subject: Rename Configuration class to avoid conflict with ActiveSupport::Configurable --- spec/helpers/link_to_helper_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/helpers/link_to_helper_spec.rb') diff --git a/spec/helpers/link_to_helper_spec.rb b/spec/helpers/link_to_helper_spec.rb index f525c9819..63daf1a75 100644 --- a/spec/helpers/link_to_helper_spec.rb +++ b/spec/helpers/link_to_helper_spec.rb @@ -60,7 +60,7 @@ describe LinkToHelper do 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/') + AlaveteliConfiguration::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 -- cgit v1.2.3 From b9fb43758d9a3f918fad78ff7d868e3f3c7e50a2 Mon Sep 17 00:00:00 2001 From: Henare Degan Date: Fri, 15 Mar 2013 15:09:24 +1100 Subject: main_url was removed in 4c9f7f7f12a47b516137bf000c3f36120033a077 --- spec/helpers/link_to_helper_spec.rb | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'spec/helpers/link_to_helper_spec.rb') diff --git a/spec/helpers/link_to_helper_spec.rb b/spec/helpers/link_to_helper_spec.rb index 5233f3f7f..3d494dcda 100644 --- a/spec/helpers/link_to_helper_spec.rb +++ b/spec/helpers/link_to_helper_spec.rb @@ -25,18 +25,6 @@ describe LinkToHelper do 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 -- cgit v1.2.3 From 5401d07ae95fdd47f346ad05100fd49a410265cd Mon Sep 17 00:00:00 2001 From: Henare Degan Date: Fri, 15 Mar 2013 17:24:33 +1100 Subject: admin_url was removed in 902631ec4f5e1a16b8f08a2ed0ccc86ad2b72c6c --- spec/helpers/link_to_helper_spec.rb | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'spec/helpers/link_to_helper_spec.rb') diff --git a/spec/helpers/link_to_helper_spec.rb b/spec/helpers/link_to_helper_spec.rb index 3d494dcda..4cc1d415b 100644 --- a/spec/helpers/link_to_helper_spec.rb +++ b/spec/helpers/link_to_helper_spec.rb @@ -35,32 +35,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 - AlaveteliConfiguration::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 -- cgit v1.2.3