Sha256: bed6e561f3c6a1d212edba29d92a0150627e52c8cbd944b0df40be030248156b

Contents?: true

Size: 409 Bytes

Versions: 22

Compression:

Stored size: 409 Bytes

Contents

# adapted from rspec-rails:
# http://github.com/rspec/rspec-rails/blob/master/spec/rspec/rails/mocks/mock_model_spec.rb

shared_examples_for 'ActiveModel' do
  include ActiveModel::Lint::Tests

  # to_s is to support ruby-1.9
  ActiveModel::Lint::Tests.public_instance_methods.map(&:to_s).grep(/^test/).each do |m|
    example m.gsub('_', ' ') do
      send m
    end
  end

  def model
    subject
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
contact_us-1.2.0 spec/support/active_model_lint.rb
contact_us-1.1.0 spec/support/active_model_lint.rb
contact_us-1.0.1 spec/support/active_model_lint.rb
contact_us-1.0.0 spec/support/active_model_lint.rb
contact_us-0.5.4 spec/support/active_model_lint.rb
contact_us-0.5.3 spec/support/active_model_lint.rb
contact_us-0.5.2 spec/support/active_model_lint.rb
contact_us-0.5.1 spec/support/active_model_lint.rb
contact_us-0.5.0 spec/support/active_model_lint.rb
contact_us-0.4.0 spec/support/active_model_lint.rb
contact_us_website-0.4.4.beta spec/support/active_model_lint.rb
contact_us-0.4.0.beta spec/support/active_model_lint.rb
contact_us-0.3.0 spec/support/active_model_lint.rb
spree_contact_us-1.1.0 spec/support/active_model_lint.rb
contact_us-0.2.1 spec/support/active_model_lint.rb
spree_contact_us-1.0.1 spec/support/active_model_lint.rb
spree_contact_us-1.0.0 spec/support/active_model_lint.rb
contact_us-0.2.0 spec/support/active_model_lint.rb
contact_us-0.1.5 spec/support/active_model_lint.rb
contact_us-0.1.4 spec/support/active_model_lint.rb