Sha256: 73a9bd5f98d90289d69b6f154d1e719178cd8680db5742b1f2d992b2a6c27497

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 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
  end
end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
formulaic-0.1.3 spec/spec_helper.rb
formulaic-0.1.2 spec/spec_helper.rb