Sha256: 56146566a2eae341badb40b17ca943d842c73912f148d0ac697f4a4a84b14fe5

Contents?: true

Size: 872 Bytes

Versions: 1

Compression:

Stored size: 872 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:
              name: Display name
              email: Email
              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.3 spec/spec_helper.rb