Skip to content

Commit

Permalink
Merge branch 'bugfix/correct_failing_tests' of https://github.com/pos…
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Apr 14, 2015
2 parents b974f47 + 1cf15b2 commit 420b2f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/model_reflections_test.rb
Expand Up @@ -85,7 +85,7 @@ def defined_enums
# delegate to model class.
it do
reflection = form.class.reflect_on_association(:artist)
reflection.must_be_instance_of ActiveRecord::Reflection::AssociationReflection
reflection.must_be_kind_of ActiveRecord::Reflection::AssociationReflection
end
end

Expand Down
12 changes: 8 additions & 4 deletions test/validate_test.rb
Expand Up @@ -260,9 +260,13 @@ class ValidateTest < BaseTest
describe "invalid" do
before { subject.validate({}).must_equal false }

it { subject.errors.messages.must_equal(
:songs => ["is too short (minimum is 1 characters)"],
:hit => ["can't be blank"]) }
it do
# ensure that only hit and songs keys are present
subject.errors.messages.keys.sort.must_equal([:hit, :songs])
# validate content of hit and songs keys
subject.errors.messages[:hit].must_equal(["can't be blank"])
subject.errors.messages[:songs].first.must_match(/\Ais too short \(minimum is 1 characters?\)\z/)
end
end


Expand Down Expand Up @@ -359,4 +363,4 @@ def songs

# #sync (assumes that forms already have updated fields)
# model.title=
# song.sync
# song.sync

0 comments on commit 420b2f0

Please sign in to comment.