diff options
Diffstat (limited to 'spec/integration/alaveteli_dsl.rb')
-rw-r--r-- | spec/integration/alaveteli_dsl.rb | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/spec/integration/alaveteli_dsl.rb b/spec/integration/alaveteli_dsl.rb index 1d56abbdf..370628d98 100644 --- a/spec/integration/alaveteli_dsl.rb +++ b/spec/integration/alaveteli_dsl.rb @@ -21,7 +21,7 @@ module AlaveteliDsl response.should redirect_to(:controller => 'user', :action => 'signin', :token => post_redirect.token) follow_redirect! response.should render_template("user/sign") - response.body.should match(/To send your FOI request, please sign in or make a new account./) + response.body.should match(/To send your FOI request, create an account or sign in/) end end @@ -33,15 +33,16 @@ def login(user) sess.reset! sess.extend(AlaveteliDsl) - if user.is_a? User - u = user - else - u = users(user) - end + u = user.is_a?(User) ? user : users(user) + sess.visit signin_path - sess.fill_in "Your e-mail:", :with => u.email - sess.fill_in "Password:", :with => "jonespassword" - sess.click_button "Sign in" + + sess.within '#signin_form' do + sess.fill_in "Your e-mail:", :with => u.email + sess.fill_in "Password:", :with => "jonespassword" + sess.click_button "Sign in" + end + assert sess.session[:user_id] == u.id end end |