Commit eff1b7831a6a0ee857cb095bb9e17f8bc84915b1
1 parent
3e0600f2
Exists in
master
and in
29 other branches
ActionItem24: checkpoint
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1156 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
6 changed files
with
17 additions
and
5 deletions
Show diff stats
app/controllers/my_profile/cms_controller.rb
app/helpers/cms_helper.rb
app/models/uploaded_file.rb
test/functional/cms_controller_test.rb
| ... | ... | @@ -169,7 +169,14 @@ class CmsControllerTest < Test::Unit::TestCase |
| 169 | 169 | end |
| 170 | 170 | |
| 171 | 171 | should 'be able to update an uploaded file' do |
| 172 | - flunk 'pending' | |
| 172 | + post :new, :type => UploadedFile.name, :profile => profile.identifier, :article => { :uploaded_data => fixture_file_upload('/files/test.txt', 'text/plain')} | |
| 173 | + | |
| 174 | + file = profile.articles.find(:first) | |
| 175 | + assert_equal 'test.txt', file.name | |
| 176 | + | |
| 177 | + post :edit, :profile => profile.identifier, :id => file.id, :article => { :uploaded_data => fixture_file_upload('/files/test.txt', 'text/plain')} | |
| 178 | + | |
| 179 | + assert_equal 2, file.versions(true).size | |
| 173 | 180 | end |
| 174 | 181 | |
| 175 | 182 | should 'offer to create children' do | ... | ... |
test/functional/enterprise_editor_controller_test.rb
| ... | ... | @@ -15,7 +15,7 @@ class EnterpriseEditorControllerTest < Test::Unit::TestCase |
| 15 | 15 | ent1 = Enterprise.create!(:identifier => 'test_enterprise1', :name => 'Test enteprise1') |
| 16 | 16 | get 'index', :profile => 'test_enterprise1' |
| 17 | 17 | |
| 18 | - assert_response :success | |
| 18 | + assert_response 403 | |
| 19 | 19 | assert_template 'access_denied.rhtml' |
| 20 | 20 | end |
| 21 | 21 | |
| ... | ... | @@ -26,7 +26,7 @@ class EnterpriseEditorControllerTest < Test::Unit::TestCase |
| 26 | 26 | |
| 27 | 27 | get 'index', :profile => 'test_enterprise' |
| 28 | 28 | |
| 29 | - assert_response :success | |
| 29 | + assert_response 403 | |
| 30 | 30 | assert @controller.send(:profile) |
| 31 | 31 | assert_equal ent.identifier, @controller.send(:profile).identifier |
| 32 | 32 | assert_template 'access_denied.rhtml' | ... | ... |
test/functional/profile_members_controller_test.rb