aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support/helpers
diff options
context:
space:
mode:
authorLuc Donnet2015-01-07 21:58:56 +0100
committerLuc Donnet2015-01-07 21:58:56 +0100
commitbaaed4653623cfc918ada7250c4fd879aad28893 (patch)
treeec1e7da111c2ccd95f82013e2d40d6b455f80815 /spec/support/helpers
parentc39887f2e4f6a12ab3af205c58a1330d8b28f5e9 (diff)
downloadchouette-core-baaed4653623cfc918ada7250c4fd879aad28893.tar.bz2
Fix spec and update devise usage
Diffstat (limited to 'spec/support/helpers')
-rw-r--r--spec/support/helpers/session_helpers.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/support/helpers/session_helpers.rb b/spec/support/helpers/session_helpers.rb
new file mode 100644
index 000000000..17a3fc51b
--- /dev/null
+++ b/spec/support/helpers/session_helpers.rb
@@ -0,0 +1,19 @@
+module Features
+ module SessionHelpers
+ def sign_up_with(email, password, confirmation)
+ visit new_user_session_path
+ fill_in '#registration_new #user_email', with: email
+ fill_in 'Password', with: password
+ fill_in 'Password confirmation', :with => confirmation
+ click_button 'Sign up'
+ end
+
+ def signin(email, password)
+ visit new_user_session_path
+ save_and_open_page
+ fill_in '#session_new #user_email', with: email
+ fill_in 'Password', with: password
+ click_button 'Sign in'
+ end
+ end
+end