Rails 3.0.7 - before_filter returns false, but action executed

Test Case Description:

 

Created vanilla rails 3.0.7 app with single controller containing 5 actions.

 

Each action was guarded by a 'before_filter ..., :only => '.

 

Each action and each filter 'puts '

 

The five filters did:

  1. always returned true
  2. always returned false
  3. always rendered 'action a'
  4. always redirected to 'action a'
  5. always raised an exception

Ran test case via Webrick on port 3001

Probed each action using 'curl http://localhost:3001/a/'

 

1, 3, 4, & 5 performed as expected

2 failed

 

See https://[email protected]/mikehoward/before_filter_but.git for test case

 

你可能感兴趣的:(Rails,before_filter)