aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/dynamic_finder_match_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/dynamic_finder_match_test.rb')
-rw-r--r--activerecord/test/cases/dynamic_finder_match_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/dynamic_finder_match_test.rb b/activerecord/test/cases/dynamic_finder_match_test.rb
index e576870317..db619faa83 100644
--- a/activerecord/test/cases/dynamic_finder_match_test.rb
+++ b/activerecord/test/cases/dynamic_finder_match_test.rb
@@ -83,6 +83,14 @@ module ActiveRecord
assert_equal :create, m.instantiator
end
+ def test_find_or_create!
+ m = DynamicFinderMatch.match(:find_or_create_by_foo!)
+ assert_equal :first, m.finder
+ assert m.bang?, 'should be banging'
+ assert_equal %w{ foo }, m.attribute_names
+ assert_equal :create, m.instantiator
+ end
+
def test_find_or_initialize
m = DynamicFinderMatch.match(:find_or_initialize_by_foo)
assert_equal :first, m.finder