Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

Commit

Permalink
More future-proof testing with Lint
Browse files Browse the repository at this point in the history
We previously were relying on Lint to never add new tests.
  • Loading branch information
martinemde committed Jan 30, 2015
1 parent 7290d3f commit 56add6d
Showing 1 changed file with 4 additions and 27 deletions.
31 changes: 4 additions & 27 deletions spec/amo_interface_compliance_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,9 @@

include ActiveModel::Lint::Tests

it 'must implement the #to_key interface' do
test_to_key
end

it 'must implement the #to_param interface' do
test_to_param
end

it 'must implement the #to_partial_path interface' do
test_to_partial_path if respond_to?(:test_to_partial_path)
end

it 'must implement the #valid? interface' do
test_valid? if respond_to?(:test_valid?)
end

it 'must implement the #persisted? interface' do
test_persisted?
end

it 'must implement the .model_name interface' do
test_model_naming
end

it 'must implement the #errors interface' do
test_errors_aref
test_errors_full_messages if respond_to?(:test_errors_full_messages)
instance_methods.grep(/^test_/).each do |meth|
it meth.to_s do
send(meth)
end
end
end

0 comments on commit 56add6d

Please sign in to comment.