Sha256: 6a8bda0c2233fd21195115bf35286b1e5652fd6ec6b9b8e90218c817027b0a53

Contents?: true

Size: 543 Bytes

Versions: 3

Compression:

Stored size: 543 Bytes

Contents

require 'spec_helper'

describe Formulaic::Dsl do
  it 'responds to input' do
    expect(object_with_dsl).to respond_to(:input)
  end

  it 'responds to fill_form' do
    expect(object_with_dsl).to respond_to(:fill_form)
  end

  it 'finds a submit label' do
    I18n.backend.store_translations(:en, { helpers: { submit: { user: { create: 'Create user' } } } })

    expect(object_with_dsl.submit(:user)).to eq 'Create user'
  end

  def object_with_dsl
    @object_with_dsl ||= Class.new do
      include Formulaic::Dsl
    end.new
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
formulaic-0.0.6 spec/formulaic/dsl_spec.rb
formulaic-0.0.5 spec/formulaic/dsl_spec.rb
formulaic-0.0.4 spec/formulaic/dsl_spec.rb