diff options
author | Gareth Rees <gareth@mysociety.org> | 2015-01-09 12:55:27 +0000 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2015-01-09 12:55:27 +0000 |
commit | dc8d15f0b23c7d4857813c6c4bdc22e4349a00d0 (patch) | |
tree | 8411c64479b15ef5cec31b0a0084f0d4952ada04 /spec/integration | |
parent | b9d5a77246762de56f39d4476c881c1b667e7a20 (diff) | |
parent | 1c39bffe4a35f77e926ccd18ee2a160984d6d55a (diff) |
Merge branch '1680-sign-up-form' into rails-3-develop
Diffstat (limited to 'spec/integration')
-rw-r--r-- | spec/integration/alaveteli_dsl.rb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/spec/integration/alaveteli_dsl.rb b/spec/integration/alaveteli_dsl.rb index 1d56abbdf..b408bc4c6 100644 --- a/spec/integration/alaveteli_dsl.rb +++ b/spec/integration/alaveteli_dsl.rb @@ -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 |