aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/request_controller_spec.rb
diff options
context:
space:
mode:
authorfrancis <francis>2008-01-09 19:34:07 +0000
committerfrancis <francis>2008-01-09 19:34:07 +0000
commit99c0aa09bbd3629aff96c02d07296ec50cefc552 (patch)
treed3c3b3196f9463431fc628095e8b904d7080d1b5 /spec/controllers/request_controller_spec.rb
parentc660cd2855c33fbe079b80ad644caf8964d23c65 (diff)
Change /classify URL to /request/ID/response/ID
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r--spec/controllers/request_controller_spec.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 1e20ca8ab..22d451611 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -148,21 +148,21 @@ describe RequestController, "when viewing an individual response" do
fixtures :info_requests, :public_bodies, :users, :incoming_messages, :outgoing_messages # all needed as integrating views
it "should require login if not logged in" do
- get :classify, :incoming_message_id => 1
+ get :show_response, :id => info_requests(:fancy_dog_request).id, :incoming_message_id => incoming_messages(:useless_incoming_message)
post_redirect = PostRedirect.get_last_post_redirect
response.should redirect_to(:controller => 'user', :action => 'signin', :token => post_redirect.token)
end
it "should say you are the wrong user if logged in as wrong user" do
session[:user_id] = users(:silly_name_user).id
- get :classify, :incoming_message_id => 1
+ get :show_response, :id => info_requests(:fancy_dog_request).id, :incoming_message_id => incoming_messages(:useless_incoming_message)
response.should render_template('user/wrong_user')
end
it "should show classification page if logged in as user controlling request" do
session[:user_id] = users(:bob_smith_user).id
- get :classify, :incoming_message_id => 1
- response.should render_template('classify')
+ get :show_response, :id => info_requests(:fancy_dog_request).id, :incoming_message_id => incoming_messages(:useless_incoming_message)
+ response.should render_template('show_response')
end
end
@@ -171,21 +171,21 @@ describe RequestController, "when classifying an individual response" do
fixtures :info_requests, :public_bodies, :users, :incoming_messages, :outgoing_messages # all needed as integrating views
it "should require login" do
- post :classify, :incoming_message => { :contains_information => true }, :incoming_message_id => incoming_messages(:useless_incoming_message)
+ post :show_response, :incoming_message => { :contains_information => true }, :id => info_requests(:fancy_dog_request).id, :incoming_message_id => incoming_messages(:useless_incoming_message)
post_redirect = PostRedirect.get_last_post_redirect
response.should redirect_to(:controller => 'user', :action => 'signin', :token => post_redirect.token)
end
it "should not classify response if logged in as wrong user" do
session[:user_id] = users(:silly_name_user).id
- post :classify, :incoming_message => { :contains_information => true }, :incoming_message_id => incoming_messages(:useless_incoming_message)
+ post :show_response, :incoming_message => { :contains_information => true }, :id => info_requests(:fancy_dog_request).id, :incoming_message_id => incoming_messages(:useless_incoming_message)
response.should render_template('user/wrong_user')
end
it "should successfully classify response if logged in as user controlling request" do
incoming_messages(:useless_incoming_message).user_classified.should == false
session[:user_id] = users(:bob_smith_user).id
- post :classify, :incoming_message => { :contains_information => true }, :incoming_message_id => incoming_messages(:useless_incoming_message)
+ post :show_response, :incoming_message => { :contains_information => true }, :id => info_requests(:fancy_dog_request).id, :incoming_message_id => incoming_messages(:useless_incoming_message)
response.should redirect_to(:controller => 'request', :action => 'show', :id => info_requests(:fancy_dog_request))
incoming_messages(:useless_incoming_message).reload
incoming_messages(:useless_incoming_message).user_classified.should == true