Commit a87bef107465346a83dabbabfdd1c8c25e0b161c
1 parent
fcc76897
Exists in
master
and in
23 other branches
ActionItem16: listing past validations
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@874 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
15 additions
and
3 deletions
Show diff stats
app/controllers/profile_admin/enterprise_validation_controller.rb
| ... | ... | @@ -34,6 +34,10 @@ class EnterpriseValidationController < ProfileAdminController |
| 34 | 34 | end |
| 35 | 35 | end |
| 36 | 36 | |
| 37 | + def list_processed | |
| 38 | + @processed_validations = profile.processed_validations | |
| 39 | + end | |
| 40 | + | |
| 37 | 41 | def view_processed |
| 38 | 42 | @processed = profile.find_processed_validation(params[:id]) |
| 39 | 43 | unless @processed | ... | ... |
test/functional/enterprise_validation_test.rb
| ... | ... | @@ -6,8 +6,8 @@ class EnterpriseValidationController; def rescue_action(e) raise e end; end |
| 6 | 6 | |
| 7 | 7 | class EnterpriseValidationControllerTest < Test::Unit::TestCase |
| 8 | 8 | |
| 9 | -# all_fixtures:users | |
| 10 | -all_fixtures | |
| 9 | + all_fixtures | |
| 10 | + | |
| 11 | 11 | def setup |
| 12 | 12 | @controller = EnterpriseValidationController.new |
| 13 | 13 | @request = ActionController::TestRequest.new |
| ... | ... | @@ -68,7 +68,15 @@ all_fixtures |
| 68 | 68 | end |
| 69 | 69 | |
| 70 | 70 | should 'list validations already processed' do |
| 71 | - flunk 'not yet' | |
| 71 | + processed_validations = [CreateEnterprise.new] | |
| 72 | + @org.expects(:processed_validations).returns(processed_validations) | |
| 73 | + | |
| 74 | + get :list_processed, :profile => 'myorg' | |
| 75 | + | |
| 76 | + assert_same processed_validations, assigns(:processed_validations) | |
| 77 | + | |
| 78 | + assert_response :success | |
| 79 | + assert_template 'list_processed' | |
| 72 | 80 | end |
| 73 | 81 | |
| 74 | 82 | should 'be able to display a validation that was already processed' do | ... | ... |