aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test/models/attached
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-07-08 11:35:27 -0400
committerGeorge Claghorn <george@basecamp.com>2018-07-08 11:35:27 -0400
commit0b85123cd82a99431c12cd260a1c537a9e604a23 (patch)
treeb73eff696226b4c7c6b06dbdb0dd58e05be5957a /activestorage/test/models/attached
parent79edcaeb6ccd7f95029e36dd1a13369b119edfdf (diff)
downloadrails-0b85123cd82a99431c12cd260a1c537a9e604a23.tar.gz
rails-0b85123cd82a99431c12cd260a1c537a9e604a23.tar.bz2
rails-0b85123cd82a99431c12cd260a1c537a9e604a23.zip
Raise an ArgumentError instead of a RuntimeError
Diffstat (limited to 'activestorage/test/models/attached')
-rw-r--r--activestorage/test/models/attached/many_test.rb2
-rw-r--r--activestorage/test/models/attached/one_test.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/activestorage/test/models/attached/many_test.rb b/activestorage/test/models/attached/many_test.rb
index ff2d29de11..bc44e9da68 100644
--- a/activestorage/test/models/attached/many_test.rb
+++ b/activestorage/test/models/attached/many_test.rb
@@ -253,7 +253,7 @@ class ActiveStorage::ManyAttachedTest < ActiveSupport::TestCase
end
test "creating a record with an unexpected object attached" do
- error = assert_raises { User.create!(name: "Jason", highlights: :foo) }
+ error = assert_raises(ArgumentError) { User.create!(name: "Jason", highlights: :foo) }
assert_equal "Could not find or build blob: expected attachable, got :foo", error.message
end
diff --git a/activestorage/test/models/attached/one_test.rb b/activestorage/test/models/attached/one_test.rb
index af45b696ae..8654ecffef 100644
--- a/activestorage/test/models/attached/one_test.rb
+++ b/activestorage/test/models/attached/one_test.rb
@@ -255,7 +255,7 @@ class ActiveStorage::OneAttachedTest < ActiveSupport::TestCase
end
test "creating a record with an unexpected object attached" do
- error = assert_raises { User.create!(name: "Jason", avatar: :foo) }
+ error = assert_raises(ArgumentError) { User.create!(name: "Jason", avatar: :foo) }
assert_equal "Could not find or build blob: expected attachable, got :foo", error.message
end