diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-08-30 17:49:28 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-08-30 17:49:28 +0100 |
commit | 74531a783a8ea62a80596b435bd151cec2bf82c8 (patch) | |
tree | f0d27526768e6a50d1fccf17e5a723324441bb13 /spec/integration/create_request_spec.rb | |
parent | ee723d9e6645bc7987cb2b7cc9cd320950536201 (diff) | |
parent | 62a20d6696275a6f83ca4cf835c487873ca89c99 (diff) |
Merge branch 'release/0.6.5'0.6.5
Diffstat (limited to 'spec/integration/create_request_spec.rb')
-rw-r--r-- | spec/integration/create_request_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/integration/create_request_spec.rb b/spec/integration/create_request_spec.rb index 6f336d406..56757c7e0 100644 --- a/spec/integration/create_request_spec.rb +++ b/spec/integration/create_request_spec.rb @@ -2,14 +2,14 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe "When creating requests" do it "should associate the request with the requestor, even if it is approved by an admin" do - # This is a test for https://github.com/sebbacon/alaveteli/issues/446 - + # This is a test for https://github.com/mysociety/alaveteli/issues/446 + params = { :info_request => { :public_body_id => public_bodies(:geraldine_public_body).id, :title => "Why is your quango called Geraldine?", :tag_string => "" }, :outgoing_message => { :body => "This is a silly letter. It is too short to be interesting." }, :submitted_new_request => 1, :preview => 0 } - + # Initially we are not logged in. Try to create a new request. post "/new", params # We expect to be redirected to the login page @@ -17,13 +17,13 @@ describe "When creating requests" do response.should redirect_to(:controller => 'user', :action => 'signin', :token => post_redirect.token) follow_redirect! response.should render_template("user/sign") - + # Now log in as an unconfirmed user. post "/profile/sign_in", :user_signin => {:email => users(:unconfirmed_user).email, :password => "jonespassword"}, :token => post_redirect.token # This will trigger a confirmation mail. Get the PostRedirect for later. response.should render_template("user/confirm") post_redirect = PostRedirect.get_last_post_redirect - + # Now log in as an admin user, then follow the confirmation link in the email that was sent to the unconfirmed user admin_user = users(:admin_user) admin_user.email_confirmed = true @@ -37,7 +37,7 @@ describe "When creating requests" do url_title = $1 info_request = InfoRequest.find_by_url_title(url_title) info_request.should_not be_nil - + # Make sure the request is still owned by the user who made it, not the admin who confirmed it info_request.user_id.should == users(:unconfirmed_user).id end |