From b4733e8526a9d611a260a3c79948adc916bb380c Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Mon, 23 Jan 2012 22:12:43 +0000 Subject: Add missing fixtures Without this addition, the "shows a user" test would fail unless run in a context where the public body fixtures had already been loaded, with an error like this: ActionView::TemplateError in 'AdminUserController when administering users shows a user' undefined method `name' for nil:NilClass On line #14 of app/views/admin_request/_some_requests.rhtml 11: <% for info_request in info_requests %> 12: 13: <%= request_both_links(info_request) %> 14: <%= public_body_both_links(info_request.public_body) %> 15: <%= user_both_links(info_request.user) %> 16: <% for column in InfoRequest.content_columns.map { |c| c.name } - [ "title", "url_title" ] %> 17: <%=h info_request.send(column) %> --- spec/controllers/admin_user_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/controllers/admin_user_controller_spec.rb') diff --git a/spec/controllers/admin_user_controller_spec.rb b/spec/controllers/admin_user_controller_spec.rb index b2b2d0626..55b49f9da 100644 --- a/spec/controllers/admin_user_controller_spec.rb +++ b/spec/controllers/admin_user_controller_spec.rb @@ -2,7 +2,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe AdminUserController, "when administering users" do integrate_views - fixtures :users, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things + fixtures :users, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things, :public_bodies, :public_body_versions, :public_body_translations before { basic_auth_login @request } it "shows the index/list page" do -- cgit v1.2.3 From ac4587afff81177a0bf86fc0064b81538811cb29 Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Tue, 31 Jan 2012 16:29:04 +0000 Subject: Load all fixtures for all tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ad hoc specification of fixtures has been an ongoing source of bugs in the tests. The straw that broke the camel’s back is that 7c6eb09 requires the fixtures to be loaded in order (i.e. children before their parents), and it would have been a painful process to reorder all the dozens of different fixture lists, but the test system ought to be more reliable this way. --- spec/controllers/admin_user_controller_spec.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'spec/controllers/admin_user_controller_spec.rb') diff --git a/spec/controllers/admin_user_controller_spec.rb b/spec/controllers/admin_user_controller_spec.rb index 55b49f9da..65ecbc37d 100644 --- a/spec/controllers/admin_user_controller_spec.rb +++ b/spec/controllers/admin_user_controller_spec.rb @@ -2,7 +2,6 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe AdminUserController, "when administering users" do integrate_views - fixtures :users, :info_requests, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things, :public_bodies, :public_body_versions, :public_body_translations before { basic_auth_login @request } it "shows the index/list page" do -- cgit v1.2.3