mirror of
https://github.com/ENSL/ensl.org.git
synced 2025-05-30 16:30:59 +00:00
Purged git history and removed sensitive information.
This commit is contained in:
commit
6bcc8dc76b
862 changed files with 25312 additions and 0 deletions
23
spec/support/features/form_helpers.rb
Normal file
23
spec/support/features/form_helpers.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
module Features
|
||||
module FormHelpers
|
||||
def fill_form(model, hash)
|
||||
hash.each do |attribute, value|
|
||||
fill_in attribute_translation(model, attribute), :with => value
|
||||
end
|
||||
end
|
||||
|
||||
def submit(model, action)
|
||||
helper_translation(model, action)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def attribute_translation(model, attribute)
|
||||
I18n.t("activerecord.attributes.#{model}.#{attribute}")
|
||||
end
|
||||
|
||||
def helper_translation(model, action)
|
||||
I18n.t("helpers.submit.#{model}.#{action}")
|
||||
end
|
||||
end
|
||||
end
|
10
spec/support/features/session_helpers.rb
Normal file
10
spec/support/features/session_helpers.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
module Features
|
||||
module SessionHelpers
|
||||
def sign_in
|
||||
visit root_path
|
||||
user = create(:user)
|
||||
fill_form(:user, { email: user.email, password: user.raw_password })
|
||||
click_button '»'
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue