muck-contents 0.2.25 → 0.2.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. data/README.rdoc +10 -0
  2. data/VERSION +1 -1
  3. data/app/controllers/muck/contents_controller.rb +2 -1
  4. data/lib/active_record/acts/muck_content.rb +6 -0
  5. data/muck-contents.gemspec +21 -2
  6. data/test/rails_root/public/images/icon_no.gif +0 -0
  7. data/test/rails_root/public/images/icon_success.gif +0 -0
  8. data/test/rails_root/public/javascripts/jquery/fg.menu.js +517 -0
  9. data/test/rails_root/public/javascripts/muck_admin.js +13 -0
  10. data/test/rails_root/public/stylesheets/admin.css +22 -0
  11. data/test/rails_root/public/stylesheets/fgmenu/fg.menu.css +114 -0
  12. data/test/rails_root/public/stylesheets/flick/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  13. data/test/rails_root/public/stylesheets/flick/images/ui-bg_flat_0_eeeeee_40x100.png +0 -0
  14. data/test/rails_root/public/stylesheets/flick/images/ui-bg_flat_55_ffffff_40x100.png +0 -0
  15. data/test/rails_root/public/stylesheets/flick/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
  16. data/test/rails_root/public/stylesheets/flick/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  17. data/test/rails_root/public/stylesheets/flick/images/ui-bg_highlight-soft_100_f6f6f6_1x100.png +0 -0
  18. data/test/rails_root/public/stylesheets/flick/images/ui-bg_highlight-soft_25_0073ea_1x100.png +0 -0
  19. data/test/rails_root/public/stylesheets/flick/images/ui-bg_highlight-soft_50_dddddd_1x100.png +0 -0
  20. data/test/rails_root/public/stylesheets/flick/images/ui-icons_0073ea_256x240.png +0 -0
  21. data/test/rails_root/public/stylesheets/flick/images/ui-icons_454545_256x240.png +0 -0
  22. data/test/rails_root/public/stylesheets/flick/images/ui-icons_666666_256x240.png +0 -0
  23. data/test/rails_root/public/stylesheets/flick/images/ui-icons_ff0084_256x240.png +0 -0
  24. data/test/rails_root/public/stylesheets/flick/images/ui-icons_ffffff_256x240.png +0 -0
  25. data/test/rails_root/public/stylesheets/flick/jquery-ui-1.8.1.custom.css +486 -0
  26. data/test/rails_root/test/functional/contents_controller_test.rb +59 -0
  27. data/test/rails_root/test/unit/content_test.rb +8 -0
  28. metadata +23 -4
@@ -37,5 +37,64 @@ class Muck::ContentsControllerTest < ActionController::TestCase
37
37
  should_render_template :show
38
38
  end
39
39
 
40
+ context "logged in" do
41
+
42
+ setup do
43
+ @admin = Factory(:user)
44
+ @admin_role = Factory(:role, :rolename => 'administrator')
45
+ @admin.roles << @admin_role
46
+ activate_authlogic
47
+ login_as @admin
48
+ end
49
+
50
+ context "GET new" do
51
+ setup do
52
+ @path = '/a/test/path'
53
+ @file = 'file'
54
+ get :new, :path => File.join(@path, @file)
55
+ end
56
+ should_respond_with :success
57
+ should_render_template :new
58
+ should "setup content object uri_path" do
59
+ assert_equal @path, assigns(:content).uri_path
60
+ end
61
+ end
62
+
63
+ context "POST create" do
64
+ setup do
65
+ end
66
+ end
67
+
68
+ context "PUT update" do
69
+ setup do
70
+ end
71
+ end
72
+
73
+ context "DELETE destroy" do
74
+ context "html" do
75
+ setup do
76
+ delete :destroy, :id => @content.id
77
+ end
78
+ should_respond_with :redirect
79
+ should_set_the_flash_to I18n.t('muck.contents.content_removed')
80
+ end
81
+ context "js" do
82
+ setup do
83
+ delete :destroy, :id => @content.id, :format => 'js'
84
+ end
85
+ should_respond_with :success
86
+ end
87
+ context "json" do
88
+ setup do
89
+ delete :destroy, :id => @content.id, :format => 'json'
90
+ end
91
+ should_respond_with :success
92
+ should "indicate success in the json" do
93
+ assert @response.body.include?(I18n.t("muck.contents.content_removed"))
94
+ end
95
+ end
96
+ end
97
+
98
+ end
40
99
  end
41
100
  end
@@ -155,6 +155,14 @@ class ContentTest < ActiveSupport::TestCase
155
155
  should "get uri based on path" do
156
156
  assert_equal File.join(@path, @key), @content.uri
157
157
  end
158
+ context "setup_uri_path" do
159
+ should "load uri_path" do
160
+ @content.reload
161
+ assert_equal nil, @content.uri_path
162
+ @content.setup_uri_path
163
+ assert_equal @path, @content.uri_path
164
+ end
165
+ end
158
166
  end
159
167
  context "content with contentable" do
160
168
  setup do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muck-contents
3
3
  version: !ruby/object:Gem::Version
4
- hash: 37
4
+ hash: 35
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 25
10
- version: 0.2.25
9
+ - 26
10
+ version: 0.2.26
11
11
  platform: ruby
12
12
  authors:
13
13
  - Justin Ball
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-05-27 00:00:00 -06:00
19
+ date: 2010-07-14 00:00:00 -06:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -1779,6 +1779,8 @@ files:
1779
1779
  - test/rails_root/public/images/file_icons/text.gif
1780
1780
  - test/rails_root/public/images/file_icons/text.png
1781
1781
  - test/rails_root/public/images/file_icons/word.gif
1782
+ - test/rails_root/public/images/icon_no.gif
1783
+ - test/rails_root/public/images/icon_success.gif
1782
1784
  - test/rails_root/public/images/icons/accept.png
1783
1785
  - test/rails_root/public/images/icons/add.png
1784
1786
  - test/rails_root/public/images/icons/blue_guy.png
@@ -2164,6 +2166,7 @@ files:
2164
2166
  - test/rails_root/public/javascripts/effects.js
2165
2167
  - test/rails_root/public/javascripts/fancyzoom.min.js
2166
2168
  - test/rails_root/public/javascripts/jquery/colorpicker.js
2169
+ - test/rails_root/public/javascripts/jquery/fg.menu.js
2167
2170
  - test/rails_root/public/javascripts/jquery/jquery-ui.js
2168
2171
  - test/rails_root/public/javascripts/jquery/jquery.autocomplete.js.readme
2169
2172
  - test/rails_root/public/javascripts/jquery/jquery.autocomplete.min.js
@@ -2186,6 +2189,7 @@ files:
2186
2189
  - test/rails_root/public/javascripts/muck-users.js
2187
2190
  - test/rails_root/public/javascripts/muck.js
2188
2191
  - test/rails_root/public/javascripts/muck_activities.js
2192
+ - test/rails_root/public/javascripts/muck_admin.js
2189
2193
  - test/rails_root/public/javascripts/muck_time/en.js
2190
2194
  - test/rails_root/public/javascripts/prototype.js
2191
2195
  - test/rails_root/public/javascripts/scriptaculous.js
@@ -3582,6 +3586,21 @@ files:
3582
3586
  - test/rails_root/public/stylesheets/blueprint/src/print.css
3583
3587
  - test/rails_root/public/stylesheets/blueprint/src/reset.css
3584
3588
  - test/rails_root/public/stylesheets/blueprint/src/typography.css
3589
+ - test/rails_root/public/stylesheets/fgmenu/fg.menu.css
3590
+ - test/rails_root/public/stylesheets/flick/images/ui-bg_flat_0_aaaaaa_40x100.png
3591
+ - test/rails_root/public/stylesheets/flick/images/ui-bg_flat_0_eeeeee_40x100.png
3592
+ - test/rails_root/public/stylesheets/flick/images/ui-bg_flat_55_ffffff_40x100.png
3593
+ - test/rails_root/public/stylesheets/flick/images/ui-bg_flat_75_ffffff_40x100.png
3594
+ - test/rails_root/public/stylesheets/flick/images/ui-bg_glass_65_ffffff_1x400.png
3595
+ - test/rails_root/public/stylesheets/flick/images/ui-bg_highlight-soft_100_f6f6f6_1x100.png
3596
+ - test/rails_root/public/stylesheets/flick/images/ui-bg_highlight-soft_25_0073ea_1x100.png
3597
+ - test/rails_root/public/stylesheets/flick/images/ui-bg_highlight-soft_50_dddddd_1x100.png
3598
+ - test/rails_root/public/stylesheets/flick/images/ui-icons_0073ea_256x240.png
3599
+ - test/rails_root/public/stylesheets/flick/images/ui-icons_454545_256x240.png
3600
+ - test/rails_root/public/stylesheets/flick/images/ui-icons_666666_256x240.png
3601
+ - test/rails_root/public/stylesheets/flick/images/ui-icons_ff0084_256x240.png
3602
+ - test/rails_root/public/stylesheets/flick/images/ui-icons_ffffff_256x240.png
3603
+ - test/rails_root/public/stylesheets/flick/jquery-ui-1.8.1.custom.css
3585
3604
  - test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_diagonals-small_0_aaaaaa_40x40.png
3586
3605
  - test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_diagonals-thick_15_444444_40x40.png
3587
3606
  - test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_glass_100_f0f0f0_1x400.png