ensl.org/spec/support/features/form_helpers.rb
Luke Barratt 8c9debefc3 Added ability to login with a username that is case insensitive
Added some missing translations
Small CSS tweaks
2014-04-04 20:38:44 +01:00

25 lines
635 B
Ruby

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 fill_tinymce(element, contents)
page.execute_script("$('#{element}').tinymce().setContent('#{contents}')")
end
def submit(model, action)
helper_translation(model, action)
end
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