Hi @zuhao , Thanks for clarifying.

> Therefore, although min_cost is already set to true in setup, it is good to explicitly set it here so that this test is clear.

I personally think that ```setup``` and ```teardown``` is essentially part of the tests since it defines the starting state in which the tests are carried out. However, I do agree that this is a matter of personal preference. 

> As for the teardown block, if you take a look at https://github.com/rails/rails/blob/master/activemodel/lib/active_model/secure_password.rb#L8, you'll see that by default min_cost is set to false. We set it to true in setup, and therefore have to restore it back to false to prevent leaks of global state.

If that is the case, would it be better if it is done this way?
```ruby
    begin
      @user.password = "secret"
      assert_equal BCrypt::Engine::MIN_COST, @user.password_digest.cost
    ensure
      ActiveModel::SecurePassword.min_cost = false
    end
```
It is technically more correct to me since when an assertion fails we want the global state returned to it's default state. Also, ```teardown``` will still be run even if the assertion fails. Therefore, I just wanted to know if we'll being 'too safe' :P