uploader 3.1.0 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +22 -20
- data/VERSION +1 -1
- data/app/controllers/uploader/uploads_controller.rb +21 -4
- data/lib/uploader/config.rb +2 -0
- data/test/rails_test/Gemfile +17 -7
- data/test/rails_test/Gemfile.lock +86 -45
- data/test/rails_test/spec/controllers/default_controller_spec.rb +45 -0
- data/test/rails_test/spec/controllers/uploads_controller_spec.rb +221 -0
- data/test/rails_test/{test → spec}/factories.rb +1 -1
- data/test/rails_test/{test → spec}/fixtures/files/5k.png +0 -0
- data/test/rails_test/test/fixtures/files/IT'sUPPERCASE!AND WeIRD.JPG b/data/test/rails_test/spec/fixtures/files/IT'sUPPERCASE!AND → WeIRD.JPG +0 -0
- data/test/rails_test/{:rails_test/public/system/locals/000/000/001/original → spec/fixtures}/rails.png +0 -0
- data/test/rails_test/{:rails_test/public/system/locals/000/000/005/original → spec/fixtures}/test.doc +0 -0
- data/test/rails_test/{:rails_test/public/system/locals/000/000/007/original → spec/fixtures}/test.pdf +0 -0
- data/test/rails_test/{:rails_test/public/system/locals/000/000/044/original → spec/fixtures}/test.txt +0 -0
- data/test/rails_test/{:rails_test/public/system/locals/000/000/032/original → spec/fixtures}/test.xls +0 -0
- data/test/rails_test/spec/models/upload_spec.rb +149 -0
- data/test/rails_test/spec/models/user_spec.rb +20 -0
- data/test/rails_test/spec/spec_helper.rb +41 -0
- data/uploader.gemspec +14 -234
- metadata +17 -236
- data/test/rails_test/:rails_test/public/system/locals/000/000/001/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/001/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/001/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/001/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/001/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/002/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/002/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/002/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/002/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/002/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/002/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/003/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/003/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/003/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/003/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/003/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/003/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/004/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/004/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/004/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/004/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/004/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/004/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/006/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/006/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/006/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/006/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/006/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/006/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/008/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/008/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/008/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/008/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/008/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/008/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/009/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/009/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/009/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/009/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/009/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/009/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/010/original/test.doc +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/011/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/011/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/011/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/011/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/011/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/011/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/012/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/012/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/012/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/012/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/012/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/012/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/013/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/013/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/013/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/013/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/013/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/013/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/014/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/014/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/014/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/014/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/014/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/014/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/015/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/015/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/015/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/015/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/015/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/015/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/016/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/016/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/016/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/016/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/016/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/016/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/017/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/017/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/017/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/017/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/017/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/017/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/018/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/018/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/018/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/018/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/018/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/018/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/019/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/019/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/019/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/019/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/019/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/019/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/020/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/020/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/020/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/020/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/020/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/020/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/024/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/024/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/024/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/024/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/024/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/024/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/025/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/025/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/025/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/025/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/025/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/025/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/026/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/026/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/026/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/026/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/026/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/026/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/027/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/027/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/027/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/027/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/027/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/027/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/028/original/test.doc +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/029/original/test.doc +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/030/original/test.doc +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/031/original/test.doc +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/033/original/test.xls +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/034/original/test.xls +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/035/original/test.xls +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/036/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/036/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/036/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/036/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/036/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/036/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/037/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/037/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/037/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/037/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/037/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/037/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/038/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/038/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/038/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/038/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/038/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/038/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/039/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/039/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/039/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/039/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/039/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/039/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/040/original/test.pdf +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/041/original/test.pdf +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/042/original/test.pdf +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/043/original/test.pdf +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/045/original/test.txt +0 -1
- data/test/rails_test/:rails_test/public/system/locals/000/000/046/original/test.txt +0 -1
- data/test/rails_test/:rails_test/public/system/locals/000/000/047/original/test.txt +0 -1
- data/test/rails_test/:rails_test/public/system/locals/000/000/048/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/049/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/050/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/050/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/050/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/050/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/050/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/050/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/051/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/051/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/051/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/051/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/051/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/051/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/052/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/052/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/052/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/052/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/052/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/052/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/053/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/053/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/053/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/053/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/053/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/053/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/054/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/054/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/054/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/054/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/054/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/054/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/055/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/055/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/055/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/055/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/055/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/055/thumb/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/056/icon/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/056/large/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/056/medium/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/056/original/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/056/small/rails.png +0 -0
- data/test/rails_test/:rails_test/public/system/locals/000/000/056/thumb/rails.png +0 -0
- data/test/rails_test/test/fixtures/rails.png +0 -0
- data/test/rails_test/test/fixtures/test.doc +0 -0
- data/test/rails_test/test/fixtures/test.pdf +0 -0
- data/test/rails_test/test/fixtures/test.txt +0 -1
- data/test/rails_test/test/fixtures/test.xls +0 -0
- data/test/rails_test/test/functional/.keep +0 -0
- data/test/rails_test/test/functional/default_controller_test.rb +0 -49
- data/test/rails_test/test/functional/uploads_controller_test.rb +0 -191
- data/test/rails_test/test/integration/.keep +0 -0
- data/test/rails_test/test/performance/browsing_test.rb +0 -9
- data/test/rails_test/test/shoulda_macros/paperclip.rb +0 -68
- data/test/rails_test/test/test_helper.rb +0 -31
- data/test/rails_test/test/unit/.keep +0 -0
- data/test/rails_test/test/unit/upload_test.rb +0 -157
- data/test/rails_test/test/unit/user_test.rb +0 -26
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
This is just a text file.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
This is just a text file.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
This is just a text file.
|
|
File without changes
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
This is just a text file.
|
|
Binary file
|
|
File without changes
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
|
2
|
-
|
|
3
|
-
class DefaultControllerTest < ActionController::TestCase
|
|
4
|
-
|
|
5
|
-
tests DefaultController
|
|
6
|
-
|
|
7
|
-
context "default controller" do
|
|
8
|
-
|
|
9
|
-
context 'on GET to index' do
|
|
10
|
-
# The default view calls the upload_form helper. This isn't a great test but
|
|
11
|
-
# it will make sure it doesn't blow up
|
|
12
|
-
setup do
|
|
13
|
-
@user = Factory(:user)
|
|
14
|
-
get :index, :user_id => @user.to_param
|
|
15
|
-
end
|
|
16
|
-
should respond_with :success
|
|
17
|
-
should "have a_container_with_a_long_name in the body" do
|
|
18
|
-
assert @response.body.include?('a_container_with_a_long_name')
|
|
19
|
-
end
|
|
20
|
-
should "have '1 MB' in the body" do
|
|
21
|
-
assert @response.body.include?('1 MB')
|
|
22
|
-
end
|
|
23
|
-
should "have '*.jpg' in the body" do
|
|
24
|
-
assert @response.body.include?('*.jpg')
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
context 'on GET to uploadify' do
|
|
29
|
-
# The default view calls the upload_form helper. This isn't a great test but
|
|
30
|
-
# it will make sure it doesn't blow up
|
|
31
|
-
setup do
|
|
32
|
-
@user = Factory(:user)
|
|
33
|
-
get :uploadify, :user_id => @user.to_param
|
|
34
|
-
end
|
|
35
|
-
should respond_with :success
|
|
36
|
-
should "have a_container_with_a_long_name in the body" do
|
|
37
|
-
assert @response.body.include?('a_container_with_a_long_name')
|
|
38
|
-
end
|
|
39
|
-
should "have '1310720' in the body" do
|
|
40
|
-
assert @response.body.include?('1310720')
|
|
41
|
-
end
|
|
42
|
-
should "have '*.jpg' in the body" do
|
|
43
|
-
assert @response.body.include?('*.jpg')
|
|
44
|
-
end
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
end
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
|
2
|
-
|
|
3
|
-
class UploadsControllerTest < ActionController::TestCase
|
|
4
|
-
|
|
5
|
-
def setup
|
|
6
|
-
@controller = UploadsController.new
|
|
7
|
-
@request = ActionController::TestRequest.new
|
|
8
|
-
@response = ActionController::TestResponse.new
|
|
9
|
-
@user = Factory(:user)
|
|
10
|
-
@controller.stubs(:current_user).returns(@user)
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
context 'on POST to :create' do
|
|
14
|
-
context "good file" do
|
|
15
|
-
setup do
|
|
16
|
-
post :create, { :upload => { :local => VALID_FILE }, :parent_type => 'User', :parent_id => @user.to_param }
|
|
17
|
-
end
|
|
18
|
-
should redirect_to("/create_success") { '/create_success' }
|
|
19
|
-
should set_the_flash.to(I18n.t('uploader.successful_upload'))
|
|
20
|
-
should "create a valid upload" do
|
|
21
|
-
assert_difference "@user.uploads.count", 1 do
|
|
22
|
-
post :create, { :upload => { :local => VALID_FILE }, :parent_type => 'User', :parent_id => @user.to_param }
|
|
23
|
-
end
|
|
24
|
-
assert assigns(:upload).errors.empty?, assigns(:upload).errors
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
context "good text file" do
|
|
28
|
-
setup do
|
|
29
|
-
post :create, { :upload => { :local => VALID_TEXT_FILE }, :parent_type => 'User', :parent_id => @user.to_param }
|
|
30
|
-
end
|
|
31
|
-
should redirect_to("/create_success") { '/create_success' }
|
|
32
|
-
should set_the_flash.to(I18n.t('uploader.successful_upload'))
|
|
33
|
-
should "create a valid upload" do
|
|
34
|
-
assert_difference "@user.uploads.count", 1 do
|
|
35
|
-
post :create, { :upload => { :local => VALID_TEXT_FILE }, :parent_type => 'User', :parent_id => @user.to_param }
|
|
36
|
-
end
|
|
37
|
-
assert assigns(:upload).errors.empty?, assigns(:upload).errors
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
context "good pdf file" do
|
|
41
|
-
setup do
|
|
42
|
-
post :create, { :upload => { :local => VALID_PDF_FILE }, :parent_type => 'User', :parent_id => @user.to_param }
|
|
43
|
-
end
|
|
44
|
-
should redirect_to("/create_success") { '/create_success' }
|
|
45
|
-
should set_the_flash.to(I18n.t('uploader.successful_upload'))
|
|
46
|
-
should "create a valid upload" do
|
|
47
|
-
assert_difference "@user.uploads.count", 1 do
|
|
48
|
-
post :create, { :upload => { :local => VALID_PDF_FILE }, :parent_type => 'User', :parent_id => @user.to_param }
|
|
49
|
-
end
|
|
50
|
-
assert assigns(:upload).errors.empty?, assigns(:upload).errors
|
|
51
|
-
end
|
|
52
|
-
end
|
|
53
|
-
context "good doc file" do
|
|
54
|
-
setup do
|
|
55
|
-
post :create, { :upload => { :local => VALID_WORD_FILE }, :parent_type => 'User', :parent_id => @user.to_param }
|
|
56
|
-
end
|
|
57
|
-
should redirect_to("/create_success") { '/create_success' }
|
|
58
|
-
should set_the_flash.to(I18n.t('uploader.successful_upload'))
|
|
59
|
-
should "create a valid upload" do
|
|
60
|
-
assert_difference "@user.uploads.count", 1 do
|
|
61
|
-
post :create, { :upload => { :local => VALID_WORD_FILE }, :parent_type => 'User', :parent_id => @user.to_param }
|
|
62
|
-
end
|
|
63
|
-
assert assigns(:upload).errors.empty?, assigns(:upload).errors
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
context "good excel file" do
|
|
67
|
-
setup do
|
|
68
|
-
post :create, { :upload => { :local => VALID_EXCEL_FILE }, :parent_type => 'User', :parent_id => @user.to_param }
|
|
69
|
-
end
|
|
70
|
-
should redirect_to("/create_success") { '/create_success' }
|
|
71
|
-
should set_the_flash.to(I18n.t('uploader.successful_upload'))
|
|
72
|
-
should "create a valid upload" do
|
|
73
|
-
assert_difference "@user.uploads.count", 1 do
|
|
74
|
-
post :create, { :upload => { :local => VALID_EXCEL_FILE }, :parent_type => 'User', :parent_id => @user.to_param }
|
|
75
|
-
end
|
|
76
|
-
assert assigns(:upload).errors.empty?, assigns(:upload).errors
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
context "bad file" do
|
|
80
|
-
setup do
|
|
81
|
-
post :create, { :upload => { :local => nil }, :parent_type => 'User', :parent_id => @user.to_param }
|
|
82
|
-
end
|
|
83
|
-
should redirect_to("/create_failure") { '/create_failure' }
|
|
84
|
-
should set_the_flash.to(/An error occured while uploading the file/)
|
|
85
|
-
should "not create file" do
|
|
86
|
-
assert_difference "@user.uploads.count", 1 do
|
|
87
|
-
post :create, { :upload => { :local => VALID_FILE }, :parent_type => 'User', :parent_id => @user.to_param }
|
|
88
|
-
end
|
|
89
|
-
assert assigns(:upload).errors.empty?, assigns(:upload).errors
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
context "raw file upload" do
|
|
93
|
-
setup do
|
|
94
|
-
@name = 'rails.png'
|
|
95
|
-
@request.set_header "HTTP_X_FILE_NAME", @name
|
|
96
|
-
@request.set_header "HTTP_X_FILE_UPLOAD", "true"
|
|
97
|
-
@request.set_header "rack.input", StringIO.new('some random file')
|
|
98
|
-
end
|
|
99
|
-
should "create a new upload" do
|
|
100
|
-
assert_difference "Upload.count", 1 do
|
|
101
|
-
post :create
|
|
102
|
-
end
|
|
103
|
-
end
|
|
104
|
-
should "not have errors on the upload" do
|
|
105
|
-
post :create
|
|
106
|
-
assert assigns(:upload).errors.empty?
|
|
107
|
-
end
|
|
108
|
-
should "set the name of the file" do
|
|
109
|
-
post :create
|
|
110
|
-
assert assigns(:upload).name == @name
|
|
111
|
-
assert assigns(:upload).local_file_name == @name
|
|
112
|
-
end
|
|
113
|
-
end
|
|
114
|
-
end
|
|
115
|
-
context 'on POST to :multiupload' do
|
|
116
|
-
context 'js' do
|
|
117
|
-
setup do
|
|
118
|
-
post :multiupload, { :Filedata => VALID_FILE, :parent_type => 'User', :parent_id => @user.to_param, :format => 'js' }
|
|
119
|
-
end
|
|
120
|
-
should respond_with :success
|
|
121
|
-
should "add an upload" do
|
|
122
|
-
assert_difference "Upload.count", 1 do
|
|
123
|
-
post :multiupload, { :Filedata => VALID_FILE, :parent_type => 'User', :parent_id => @user.to_param, :format => 'js' }
|
|
124
|
-
end
|
|
125
|
-
end
|
|
126
|
-
end
|
|
127
|
-
context 'json' do
|
|
128
|
-
setup do
|
|
129
|
-
post :multiupload, { :Filedata => VALID_FILE, :parent_type => 'User', :parent_id => @user.to_param, :format => 'json' }
|
|
130
|
-
end
|
|
131
|
-
should respond_with :success
|
|
132
|
-
should "add an upload" do
|
|
133
|
-
assert_difference "Upload.count", 1 do
|
|
134
|
-
post :multiupload, { :Filedata => VALID_FILE, :parent_type => 'User', :parent_id => @user.to_param, :format => 'json' }
|
|
135
|
-
end
|
|
136
|
-
end
|
|
137
|
-
end
|
|
138
|
-
end
|
|
139
|
-
|
|
140
|
-
context 'permission denied' do
|
|
141
|
-
setup do
|
|
142
|
-
@controller.stubs(:has_permission_to_upload).returns(false)
|
|
143
|
-
post :create, { :upload => { :local => VALID_FILE }, :parent_type => 'User', :parent_id => @user.to_param }
|
|
144
|
-
end
|
|
145
|
-
should redirect_to("/permission_denied") { '/permission_denied' }
|
|
146
|
-
end
|
|
147
|
-
|
|
148
|
-
context 'on DELETE to :destroy' do
|
|
149
|
-
setup do
|
|
150
|
-
@upload = Factory(:upload)
|
|
151
|
-
end
|
|
152
|
-
context "has permission" do
|
|
153
|
-
context "controller" do
|
|
154
|
-
setup do
|
|
155
|
-
delete :destroy, { :id => @upload.to_param }
|
|
156
|
-
end
|
|
157
|
-
should redirect_to("/destroy_success") { '/destroy_success' }
|
|
158
|
-
should set_the_flash.to(I18n.t('uploader.file_deleted'))
|
|
159
|
-
end
|
|
160
|
-
context "data changes" do
|
|
161
|
-
should "delete the upload" do
|
|
162
|
-
assert_difference "Upload.count", -1 do
|
|
163
|
-
delete :destroy, { :id => @upload.to_param }
|
|
164
|
-
end
|
|
165
|
-
end
|
|
166
|
-
end
|
|
167
|
-
end
|
|
168
|
-
context "permission denied" do
|
|
169
|
-
setup do
|
|
170
|
-
@upload.stubs(:can_edit?).returns(false)
|
|
171
|
-
Upload.stubs(:find).returns(@upload) # db version won't have can_edit? stubbed since it is a new object so we have to return @upload instead.
|
|
172
|
-
end
|
|
173
|
-
context "controller" do
|
|
174
|
-
setup do
|
|
175
|
-
delete :destroy, { :id => @upload.to_param }
|
|
176
|
-
end
|
|
177
|
-
should redirect_to("/destroy_success") { '/destroy_success' }
|
|
178
|
-
should set_the_flash.to(I18n.t('uploader.file_delete_permission_denied'))
|
|
179
|
-
end
|
|
180
|
-
context "data changes" do
|
|
181
|
-
should "not delete the upload" do
|
|
182
|
-
assert_no_difference "Upload.count" do
|
|
183
|
-
delete :destroy, { :id => @upload.to_param }
|
|
184
|
-
end
|
|
185
|
-
end
|
|
186
|
-
end
|
|
187
|
-
end
|
|
188
|
-
|
|
189
|
-
end
|
|
190
|
-
|
|
191
|
-
end
|