Sha256: 0c562e4971b7f51730f90e0b4dbde95c18f55419b5ba500482d62b660945143d

Contents?: true

Size: 1.43 KB

Versions: 3

Compression:

Stored size: 1.43 KB

Contents

require 'formulaic'

module SpecHelper
  def input(model, field)
    page.find("##{model}_#{field}")
  end

  def visit(page_name)
    page.visit("/#{page_name}.html")
  end

  def page
    @page ||= begin
                Capybara.app = Rack::File.new(File.expand_path('../fixtures', __FILE__))
                Capybara.current_session
              end
  end

  def load_translations
    I18n.backend.store_translations(:en, YAML.load(<<-TRANSLATIONS))
        simple_form:
          labels:
            user:
              age: Your Age
              avatar: Your Avatar
              awesome: Are you awesome?
              bio: Biography
              date_of_birth: Your Date of birth
              likes: Your Likes
              dislikes: Your Dislikes
              email: Your Email
              name: Your Display name
              new:
                password: Your Password
                phone: Phone Number
                terms_of_service: I agree to the Terms of Service
                url: Website
    TRANSLATIONS
    I18n.backend.store_translations(:es, YAML.load(<<-TRANSLATIONS))
      date:
        month_names:
          -
          - Enero
          - Febrero
          - Marzo
          - Abril
          - Mayo
          - Junio
          - Julio
          - Agosto
          - Septiembre
          - Octubre
          - Noviembre
          - Diciembre
    TRANSLATIONS
  end
end

RSpec.configure do |c|
  c.include SpecHelper
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
formulaic-0.3.0 spec/spec_helper.rb
formulaic-0.2.0 spec/spec_helper.rb
formulaic-0.1.4 spec/spec_helper.rb