diff options
Diffstat (limited to 'spec/views')
-rw-r--r-- | spec/views/request/list.rhtml_spec.rb | 2 | ||||
-rw-r--r-- | spec/views/request/show.rhtml_spec.rb | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/spec/views/request/list.rhtml_spec.rb b/spec/views/request/list.rhtml_spec.rb index 1f86ec641..c7067294f 100644 --- a/spec/views/request/list.rhtml_spec.rb +++ b/spec/views/request/list.rhtml_spec.rb @@ -33,6 +33,7 @@ describe "when listing recent requests" do it "should be successful" do assigns[:list_results] = [ make_mock_event, make_mock_event ] assigns[:matches_estimated] = 2 + assigns[:show_no_more_than] = 100 render "request/list" response.should have_tag("div.request_listing") response.should_not have_tag("p", /No requests of this sort yet/m) @@ -41,6 +42,7 @@ describe "when listing recent requests" do it "should cope with no results" do assigns[:list_results] = [ ] assigns[:matches_estimated] = 0 + assigns[:show_no_more_than] = 0 render "request/list" response.should have_tag("p", /No requests of this sort yet/m) response.should_not have_tag("div.request_listing") diff --git a/spec/views/request/show.rhtml_spec.rb b/spec/views/request/show.rhtml_spec.rb index adb244f47..ef7d1a47c 100644 --- a/spec/views/request/show.rhtml_spec.rb +++ b/spec/views/request/show.rhtml_spec.rb @@ -84,10 +84,15 @@ describe 'when viewing an information request' do describe 'when there is a last response' do before do - ActionController::Routing::Routes.filters.clear @mock_response = mock_model(IncomingMessage) @mock_request.stub!(:get_last_response).and_return(@mock_response) + @old_filters = ActionController::Routing::Routes.filters + ActionController::Routing::Routes.filters = RoutingFilter::Chain.new end + after do + ActionController::Routing::Routes.filters = @old_filters + end + it 'should show a link to follow up the last response with clarification' do request_page @@ -100,9 +105,14 @@ describe 'when viewing an information request' do describe 'when there is no last response' do before do - ActionController::Routing::Routes.filters.clear @mock_request.stub!(:get_last_response).and_return(nil) + @old_filters = ActionController::Routing::Routes.filters + ActionController::Routing::Routes.filters = RoutingFilter::Chain.new end + after do + ActionController::Routing::Routes.filters = @old_filters + end + it 'should show a link to follow up the request without reference to a specific response' do request_page |