ensl.org/spec/support/features/form_helpers.rb
Luke Barratt 24eabf89e6 Changed newrelic configuration to load from environment variables
Changed login field text
Changed database configuration connection pool size to be configured via dotenv
Use a single BBcode parser library
Added better translations coverage
Code formatting
Increases maximum article text limit
Added database cleaner with the deletion strategy during testing
2014-03-30 20:50:52 +01:00

25 lines
No EOL
634 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