Skip to content
Browse files

added test for writable attributes for objects retrieved by find_by_xx

  • Loading branch information...
1 parent f802f19 commit cd66e871dd254934fbbf8a6a6657e43648aa7743 @hukl hukl committed
Showing with 9 additions and 0 deletions.
  1. +9 −0 test/active_record/translates_test.rb
View
9 test/active_record/translates_test.rb
@@ -84,4 +84,13 @@ def setup
post.subject = 'title'
assert_equal 'title', post.subject
end
+
+ test "find_by_xx records have writable attributes" do
+ Post.create :subject => "change me"
+ p = Post.find_by_subject("change me")
+ p.subject = "changed"
+ assert_nothing_raised(ActiveRecord::ReadOnlyRecord) do
+ p.save
+ end
+ end
end

0 comments on commit cd66e87

Please sign in to comment.
Something went wrong with that request. Please try again.