Sha256: b952e505bd014b7f678bb36f931177623384c3f413b62ba1d7bae904ff707253

Contents?: true

Size: 956 Bytes

Versions: 1

Compression:

Stored size: 956 Bytes

Contents

require 'formulaic'
require 'pry'

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: Age
              name: Display name
              email: Email
              phone: Phone Number
              url: Website
              password: Password
              date_of_birth: Date of birth
              terms_of_service: I agree to the Terms of Service
              awesome: Are you awesome?
              bio: Biography
    TRANSLATIONS
  end
end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
formulaic-0.0.6 spec/spec_helper.rb