mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Implements login macros
This commit is contained in:
parent
d6c692962e
commit
e823fc0279
2 changed files with 15 additions and 0 deletions
|
|
@ -47,6 +47,9 @@ RSpec.configure do |config|
|
|||
# Use capybara-webkit as default javascript driver
|
||||
Capybara.javascript_driver = :webkit
|
||||
|
||||
# Includes support/login_macros for feature tests
|
||||
config.include LoginMacros, type: :feature
|
||||
|
||||
# As we start from scratch in April 2014, let's forbid the old :should syntax
|
||||
config.expect_with :rspec do |c|
|
||||
c.syntax = :expect
|
||||
|
|
|
|||
12
spec/support/login_macros.rb
Normal file
12
spec/support/login_macros.rb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
module LoginMacros
|
||||
|
||||
def sign_in(user)
|
||||
visit new_user_session_path
|
||||
|
||||
fill_in 'user_email', with: user.email
|
||||
fill_in 'user_password', with: user.password
|
||||
find(:xpath, "//div[@id='content']//input[@name='commit']").click
|
||||
|
||||
expect(page.has_content?('Signed in successfully')).to be true
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue