aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/general_controller_spec.rb2
-rw-r--r--spec/controllers/request_controller_spec.rb6
-rw-r--r--spec/controllers/track_controller_spec.rb11
-rw-r--r--spec/fixtures/comments.yml11
-rw-r--r--spec/fixtures/info_request_events.yml14
5 files changed, 35 insertions, 9 deletions
diff --git a/spec/controllers/general_controller_spec.rb b/spec/controllers/general_controller_spec.rb
index abc63c290..f0ab38f38 100644
--- a/spec/controllers/general_controller_spec.rb
+++ b/spec/controllers/general_controller_spec.rb
@@ -7,7 +7,7 @@ end
describe GeneralController, "when searching" do
integrate_views
- fixtures :users, :outgoing_messages, :incoming_messages, :info_requests, :info_request_events, :public_bodies
+ fixtures :users, :outgoing_messages, :incoming_messages, :info_requests, :info_request_events, :public_bodies, :comments
before do
# XXX - what is proper way to do this only once?
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 59ce51efa..cd6183fe7 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -212,7 +212,7 @@ end
describe RequestController, "when viewing an individual response" do
integrate_views
- fixtures :info_requests, :info_request_events, :public_bodies, :users, :incoming_messages, :outgoing_messages # all needed as integrating views
+ fixtures :info_requests, :info_request_events, :public_bodies, :users, :incoming_messages, :outgoing_messages, :comments # all needed as integrating views
it "should show the response" do
get :show_response, :id => info_requests(:fancy_dog_request).id, :incoming_message_id => incoming_messages(:useless_incoming_message)
@@ -222,7 +222,7 @@ end
describe RequestController, "when classifying an individual response" do
integrate_views
- fixtures :info_requests, :info_request_events, :public_bodies, :users, :incoming_messages, :outgoing_messages # all needed as integrating views
+ fixtures :info_requests, :info_request_events, :public_bodies, :users, :incoming_messages, :outgoing_messages, :comments # all needed as integrating views
it "should require login" do
post :describe_state, :incoming_message => { :described_state => "rejected" }, :id => info_requests(:fancy_dog_request).id, :incoming_message_id => incoming_messages(:useless_incoming_message), :last_info_request_event_id => info_request_events(:useless_incoming_message_event).id, :submitted_describe_state => 1
@@ -333,7 +333,7 @@ end
describe RequestController, "sending unclassified new response reminder alerts" do
integrate_views
- fixtures :info_requests, :info_request_events, :public_bodies, :users, :incoming_messages, :outgoing_messages # all needed as integrating views
+ fixtures :info_requests, :info_request_events, :public_bodies, :users, :incoming_messages, :outgoing_messages, :comments # all needed as integrating views
it "should send an alert" do
RequestMailer.alert_new_response_reminders
diff --git a/spec/controllers/track_controller_spec.rb b/spec/controllers/track_controller_spec.rb
index 21b9c2e7c..ce3528812 100644
--- a/spec/controllers/track_controller_spec.rb
+++ b/spec/controllers/track_controller_spec.rb
@@ -58,7 +58,7 @@ end
describe TrackController, "when viewing RSS feed for a track" do
integrate_views
- fixtures :info_requests, :outgoing_messages, :incoming_messages, :info_request_events, :users, :track_things
+ fixtures :info_requests, :outgoing_messages, :incoming_messages, :info_request_events, :users, :track_things, :comments, :public_bodies
it "should get the RSS feed" do
track_thing = track_things(:track_fancy_dog_request)
@@ -67,10 +67,11 @@ describe TrackController, "when viewing RSS feed for a track" do
response.should render_template('track/atom_feed')
# XXX should check it is an atom.builder type being rendered, not sure how to
- assigns[:xapian_object].matches_estimated.should == 2
- assigns[:xapian_object].results.size.should == 2
- assigns[:xapian_object].results[0][:model].should == info_request_events(:useless_incoming_message_event)
- assigns[:xapian_object].results[1][:model].should == info_request_events(:useless_outgoing_message_event)
+ assigns[:xapian_object].matches_estimated.should == 3
+ assigns[:xapian_object].results.size.should == 3
+ assigns[:xapian_object].results[0][:model].should == info_request_events(:silly_comment_event)
+ assigns[:xapian_object].results[1][:model].should == info_request_events(:useless_incoming_message_event)
+ assigns[:xapian_object].results[2][:model].should == info_request_events(:useless_outgoing_message_event)
end
end
diff --git a/spec/fixtures/comments.yml b/spec/fixtures/comments.yml
new file mode 100644
index 000000000..ed1925bfa
--- /dev/null
+++ b/spec/fixtures/comments.yml
@@ -0,0 +1,11 @@
+silly_comment:
+ visible: t
+ updated_at: 2008-08-13 01:25:17.486939
+ body: This a the daftest comment the world has ever seen.
+ id: "1"
+ info_request_id: "101"
+ comment_type: request
+ user_id: "2"
+ created_at: 2008-08-13 01:25:17.486939
+
+
diff --git a/spec/fixtures/info_request_events.yml b/spec/fixtures/info_request_events.yml
index 894e9cc7a..5e3c13083 100644
--- a/spec/fixtures/info_request_events.yml
+++ b/spec/fixtures/info_request_events.yml
@@ -25,3 +25,17 @@ useless_incoming_message_event:
created_at: 2007-11-13 18:09:20.042061
described_state:
incoming_message_id: 1
+silly_comment_event:
+ params_yaml: "--- \n\
+ :comment_id: 1\n"
+ incoming_message_id:
+ last_described_at:
+ described_state:
+ id: "903"
+ info_request_id: "101"
+ comment_id: "1"
+ calculated_state:
+ event_type: comment
+ outgoing_message_id:
+ created_at: 2008-08-12 23:05:12.500942
+