diff options
author | Roque Pinel <repinel@gmail.com> | 2015-07-19 22:00:36 -0400 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2015-07-20 09:12:01 -0600 |
commit | 12b0b26df7560ab5199ba830586864085441508f (patch) | |
tree | fc2cc53a6795ee099fec878e4c33f7337f05b476 /actionpack/test/controller | |
parent | c0ef95a1c6db3095c4b5f80f8044fbbbdfebeff1 (diff) | |
download | rails-12b0b26df7560ab5199ba830586864085441508f.tar.gz rails-12b0b26df7560ab5199ba830586864085441508f.tar.bz2 rails-12b0b26df7560ab5199ba830586864085441508f.zip |
Fix state being carried over from previous transaction
This clears the transaction record state when the transaction finishes
with a `:committed` status.
Considering the following example where `name` is a required attribute.
Before we had `new_record?` returning `true` for a persisted record:
```ruby
author = Author.create! name: 'foo'
author.name = nil
author.save # => false
author.new_record? # => true
```
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/parameters/parameters_permit_test.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/test/controller/parameters/parameters_permit_test.rb b/actionpack/test/controller/parameters/parameters_permit_test.rb index 2dd2826196..9f7d14e85d 100644 --- a/actionpack/test/controller/parameters/parameters_permit_test.rb +++ b/actionpack/test/controller/parameters/parameters_permit_test.rb @@ -199,7 +199,7 @@ class ParametersPermitTest < ActiveSupport::TestCase assert_equal nil, @params.fetch(:foo) { nil } end - test 'KeyError in fetch block should not be coverd up' do + test 'KeyError in fetch block should not be covered up' do params = ActionController::Parameters.new e = assert_raises(KeyError) do params.fetch(:missing_key) { {}.fetch(:also_missing) } |