alchemy_cms 2.2.rc8 → 2.2.rc11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. data/README.md +1 -1
  2. data/app/assets/javascripts/alchemy/alchemy.page_sorter.js +1 -1
  3. data/app/assets/stylesheets/alchemy/sitemap.css.scss +14 -13
  4. data/app/assets/stylesheets/alchemy/standard_set.css +9 -10
  5. data/app/controllers/alchemy/admin/pages_controller.rb +1 -0
  6. data/app/controllers/alchemy/base_controller.rb +2 -1
  7. data/app/helpers/alchemy/admin/essences_helper.rb +1 -0
  8. data/app/helpers/alchemy/elements_helper.rb +2 -10
  9. data/app/helpers/alchemy/essences_helper.rb +1 -0
  10. data/app/helpers/alchemy/pages_helper.rb +31 -13
  11. data/app/models/alchemy/attachment.rb +1 -1
  12. data/app/models/alchemy/content.rb +8 -8
  13. data/app/models/alchemy/element.rb +14 -10
  14. data/app/models/alchemy/essence_file.rb +1 -1
  15. data/app/models/alchemy/message.rb +9 -9
  16. data/app/models/alchemy/page.rb +4 -3
  17. data/app/models/alchemy/picture.rb +1 -1
  18. data/app/models/alchemy/user.rb +1 -1
  19. data/app/sweepers/alchemy/content_sweeper.rb +29 -6
  20. data/app/views/alchemy/admin/attachments/new.html.erb +1 -1
  21. data/app/views/alchemy/admin/pages/index.html.erb +7 -7
  22. data/app/views/alchemy/admin/pages/sort.js.erb +2 -1
  23. data/app/views/alchemy/admin/partials/_upload_form.html.erb +2 -2
  24. data/app/views/alchemy/admin/pictures/new.html.erb +1 -1
  25. data/app/views/alchemy/essences/_essence_picture_tools.html.erb +2 -2
  26. data/app/views/alchemy/essences/_essence_text_editor.html.erb +11 -11
  27. data/app/views/alchemy/navigation/_link.html.erb +20 -20
  28. data/app/views/alchemy/navigation/_renderer.html.erb +37 -23
  29. data/config/alchemy/config.yml +107 -65
  30. data/config/alchemy/elements.yml +12 -1
  31. data/config/locales/alchemy.de.yml +1 -0
  32. data/config/locales/alchemy.en.yml +1 -0
  33. data/lib/alchemy/essence.rb +1 -1
  34. data/lib/alchemy/page_layout.rb +3 -9
  35. data/lib/alchemy/resource.rb +5 -5
  36. data/lib/alchemy/version.rb +1 -1
  37. data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +2 -2
  38. data/lib/rails/generators/alchemy/scaffold/{files/page_layouts.yml → templates/page_layouts.yml.tt} +4 -0
  39. data/spec/config_spec.rb +1 -1
  40. data/spec/dummy/db/schema.rb +1 -1
  41. data/spec/helpers/admin/contents_helper_spec.rb +4 -3
  42. data/spec/helpers/admin/essences_helper_spec.rb +4 -8
  43. data/spec/helpers/essences_helper_spec.rb +0 -4
  44. data/spec/helpers/pages_helper_spec.rb +10 -1
  45. data/spec/integration/admin/modules_integration_spec.rb +25 -21
  46. data/spec/integration/admin/pages_controller_spec.rb +16 -19
  47. data/spec/integration/admin/resources_integration_spec.rb +58 -64
  48. data/spec/integration/pages_controller_spec.rb +24 -3
  49. data/spec/integration/security_spec.rb +12 -12
  50. data/spec/libraries/resource_spec.rb +16 -18
  51. data/spec/models/page_spec.rb +352 -326
  52. data/spec/page_layout_spec.rb +2 -2
  53. data/spec/support/alchemy/specs_helpers.rb +16 -1
  54. metadata +116 -38
  55. data/spec/support/integration_spec_helper.rb +0 -24
@@ -14,7 +14,7 @@ describe Alchemy::PageLayout do
14
14
 
15
15
  it "should return the users page_layouts if exists in the application" do
16
16
  @config_path = Rails.root.join("config/alchemy")
17
- FileUtils.mkdir_p(@config_path)
17
+ FileUtils.mv(File.join(@config_path, 'page_layouts.yml'), File.join(@config_path, 'page_layouts.bak'))
18
18
  layouts_file = File.join(@config_path, 'page_layouts.yml')
19
19
  File.open(layouts_file, 'w') do |page_layouts|
20
20
  page_layouts.puts "- name: testlayout\n elements:"
@@ -23,7 +23,7 @@ describe Alchemy::PageLayout do
23
23
  end
24
24
 
25
25
  after(:each) do
26
- FileUtils.rm_rf(@config_path)
26
+ FileUtils.mv(File.join(@config_path, 'page_layouts.bak'), File.join(@config_path, 'page_layouts.yml'))
27
27
  end
28
28
 
29
29
  end
@@ -1,8 +1,11 @@
1
+ require 'declarative_authorization/maintenance'
2
+
1
3
  module Alchemy
2
4
  module Specs
3
5
  # Helpers for integration specs
4
6
  # This file is auto included in rspec integration/request tests.
5
7
  module Helpers
8
+ include Authorization::TestHelper
6
9
 
7
10
  # Capybara actions to login into Alchemy Backend
8
11
  #
@@ -13,7 +16,7 @@ module Alchemy
13
16
  # === Example:
14
17
  #
15
18
  # before(:all) do
16
- # FactoryGirl.build(:admin_user).save_without_session_maintenance
19
+ # create_admin_user
17
20
  # end
18
21
  #
19
22
  def login_into_alchemy
@@ -23,6 +26,18 @@ module Alchemy
23
26
  click_on('Login')
24
27
  end
25
28
 
29
+ # Load additional authorization_rules for specs.
30
+ # For some strange reason, this isn't done automatically while running the specs
31
+ def load_authorization_rules
32
+ instance = Alchemy::AuthEngine.get_instance
33
+ instance.load(File.join(File.dirname(__FILE__), '../../dummy', 'config/authorization_rules.rb'))
34
+ end
35
+
36
+ # Creates an admin user in a way it works
37
+ def create_admin_user
38
+ @user = FactoryGirl.build(:admin_user).save_without_session_maintenance
39
+ end
40
+
26
41
  end
27
42
  end
28
43
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.rc8
4
+ version: 2.2.rc11
5
5
  prerelease: 4
6
6
  platform: ruby
7
7
  authors:
@@ -12,11 +12,11 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2012-04-27 00:00:00.000000000 Z
15
+ date: 2012-05-29 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rails
19
- requirement: &70331181302120 !ruby/object:Gem::Requirement
19
+ requirement: !ruby/object:Gem::Requirement
20
20
  none: false
21
21
  requirements:
22
22
  - - ~>
@@ -24,10 +24,15 @@ dependencies:
24
24
  version: 3.2.1
25
25
  type: :runtime
26
26
  prerelease: false
27
- version_requirements: *70331181302120
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ~>
31
+ - !ruby/object:Gem::Version
32
+ version: 3.2.1
28
33
  - !ruby/object:Gem::Dependency
29
34
  name: authlogic
30
- requirement: &70331181301520 !ruby/object:Gem::Requirement
35
+ requirement: !ruby/object:Gem::Requirement
31
36
  none: false
32
37
  requirements:
33
38
  - - ! '>='
@@ -35,10 +40,15 @@ dependencies:
35
40
  version: '0'
36
41
  type: :runtime
37
42
  prerelease: false
38
- version_requirements: *70331181301520
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
39
49
  - !ruby/object:Gem::Dependency
40
50
  name: awesome_nested_set
41
- requirement: &70331181300780 !ruby/object:Gem::Requirement
51
+ requirement: !ruby/object:Gem::Requirement
42
52
  none: false
43
53
  requirements:
44
54
  - - ~>
@@ -46,10 +56,15 @@ dependencies:
46
56
  version: '2.0'
47
57
  type: :runtime
48
58
  prerelease: false
49
- version_requirements: *70331181300780
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ none: false
61
+ requirements:
62
+ - - ~>
63
+ - !ruby/object:Gem::Version
64
+ version: '2.0'
50
65
  - !ruby/object:Gem::Dependency
51
66
  name: declarative_authorization
52
- requirement: &70331181299840 !ruby/object:Gem::Requirement
67
+ requirement: !ruby/object:Gem::Requirement
53
68
  none: false
54
69
  requirements:
55
70
  - - ~>
@@ -57,10 +72,15 @@ dependencies:
57
72
  version: 0.5.4
58
73
  type: :runtime
59
74
  prerelease: false
60
- version_requirements: *70331181299840
75
+ version_requirements: !ruby/object:Gem::Requirement
76
+ none: false
77
+ requirements:
78
+ - - ~>
79
+ - !ruby/object:Gem::Version
80
+ version: 0.5.4
61
81
  - !ruby/object:Gem::Dependency
62
82
  name: tvdeyen-fleximage
63
- requirement: &70331181299160 !ruby/object:Gem::Requirement
83
+ requirement: !ruby/object:Gem::Requirement
64
84
  none: false
65
85
  requirements:
66
86
  - - ~>
@@ -68,10 +88,15 @@ dependencies:
68
88
  version: 1.2.0
69
89
  type: :runtime
70
90
  prerelease: false
71
- version_requirements: *70331181299160
91
+ version_requirements: !ruby/object:Gem::Requirement
92
+ none: false
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: 1.2.0
72
97
  - !ruby/object:Gem::Dependency
73
98
  name: kaminari
74
- requirement: &70331181298360 !ruby/object:Gem::Requirement
99
+ requirement: !ruby/object:Gem::Requirement
75
100
  none: false
76
101
  requirements:
77
102
  - - ~>
@@ -79,10 +104,15 @@ dependencies:
79
104
  version: 0.13.0
80
105
  type: :runtime
81
106
  prerelease: false
82
- version_requirements: *70331181298360
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ none: false
109
+ requirements:
110
+ - - ~>
111
+ - !ruby/object:Gem::Version
112
+ version: 0.13.0
83
113
  - !ruby/object:Gem::Dependency
84
114
  name: acts_as_ferret
85
- requirement: &70331181297520 !ruby/object:Gem::Requirement
115
+ requirement: !ruby/object:Gem::Requirement
86
116
  none: false
87
117
  requirements:
88
118
  - - ~>
@@ -90,10 +120,15 @@ dependencies:
90
120
  version: '0.5'
91
121
  type: :runtime
92
122
  prerelease: false
93
- version_requirements: *70331181297520
123
+ version_requirements: !ruby/object:Gem::Requirement
124
+ none: false
125
+ requirements:
126
+ - - ~>
127
+ - !ruby/object:Gem::Version
128
+ version: '0.5'
94
129
  - !ruby/object:Gem::Dependency
95
130
  name: acts_as_list
96
- requirement: &70331181296980 !ruby/object:Gem::Requirement
131
+ requirement: !ruby/object:Gem::Requirement
97
132
  none: false
98
133
  requirements:
99
134
  - - ~>
@@ -101,10 +136,15 @@ dependencies:
101
136
  version: '0.1'
102
137
  type: :runtime
103
138
  prerelease: false
104
- version_requirements: *70331181296980
139
+ version_requirements: !ruby/object:Gem::Requirement
140
+ none: false
141
+ requirements:
142
+ - - ~>
143
+ - !ruby/object:Gem::Version
144
+ version: '0.1'
105
145
  - !ruby/object:Gem::Dependency
106
146
  name: magiclabs-userstamp
107
- requirement: &70331180893820 !ruby/object:Gem::Requirement
147
+ requirement: !ruby/object:Gem::Requirement
108
148
  none: false
109
149
  requirements:
110
150
  - - ~>
@@ -112,10 +152,15 @@ dependencies:
112
152
  version: 2.0.2
113
153
  type: :runtime
114
154
  prerelease: false
115
- version_requirements: *70331180893820
155
+ version_requirements: !ruby/object:Gem::Requirement
156
+ none: false
157
+ requirements:
158
+ - - ~>
159
+ - !ruby/object:Gem::Version
160
+ version: 2.0.2
116
161
  - !ruby/object:Gem::Dependency
117
162
  name: dynamic_form
118
- requirement: &70331180892420 !ruby/object:Gem::Requirement
163
+ requirement: !ruby/object:Gem::Requirement
119
164
  none: false
120
165
  requirements:
121
166
  - - ~>
@@ -123,10 +168,15 @@ dependencies:
123
168
  version: '1.1'
124
169
  type: :runtime
125
170
  prerelease: false
126
- version_requirements: *70331180892420
171
+ version_requirements: !ruby/object:Gem::Requirement
172
+ none: false
173
+ requirements:
174
+ - - ~>
175
+ - !ruby/object:Gem::Version
176
+ version: '1.1'
127
177
  - !ruby/object:Gem::Dependency
128
178
  name: jquery-rails
129
- requirement: &70331180891480 !ruby/object:Gem::Requirement
179
+ requirement: !ruby/object:Gem::Requirement
130
180
  none: false
131
181
  requirements:
132
182
  - - ~>
@@ -134,10 +184,15 @@ dependencies:
134
184
  version: 2.0.0
135
185
  type: :runtime
136
186
  prerelease: false
137
- version_requirements: *70331180891480
187
+ version_requirements: !ruby/object:Gem::Requirement
188
+ none: false
189
+ requirements:
190
+ - - ~>
191
+ - !ruby/object:Gem::Version
192
+ version: 2.0.0
138
193
  - !ruby/object:Gem::Dependency
139
194
  name: attachment_magic
140
- requirement: &70331180890840 !ruby/object:Gem::Requirement
195
+ requirement: !ruby/object:Gem::Requirement
141
196
  none: false
142
197
  requirements:
143
198
  - - ~>
@@ -145,10 +200,15 @@ dependencies:
145
200
  version: 0.2.1
146
201
  type: :runtime
147
202
  prerelease: false
148
- version_requirements: *70331180890840
203
+ version_requirements: !ruby/object:Gem::Requirement
204
+ none: false
205
+ requirements:
206
+ - - ~>
207
+ - !ruby/object:Gem::Version
208
+ version: 0.2.1
149
209
  - !ruby/object:Gem::Dependency
150
210
  name: sass-rails
151
- requirement: &70331180890000 !ruby/object:Gem::Requirement
211
+ requirement: !ruby/object:Gem::Requirement
152
212
  none: false
153
213
  requirements:
154
214
  - - ~>
@@ -156,10 +216,15 @@ dependencies:
156
216
  version: 3.2.3
157
217
  type: :runtime
158
218
  prerelease: false
159
- version_requirements: *70331180890000
219
+ version_requirements: !ruby/object:Gem::Requirement
220
+ none: false
221
+ requirements:
222
+ - - ~>
223
+ - !ruby/object:Gem::Version
224
+ version: 3.2.3
160
225
  - !ruby/object:Gem::Dependency
161
226
  name: rspec-rails
162
- requirement: &70331180888980 !ruby/object:Gem::Requirement
227
+ requirement: !ruby/object:Gem::Requirement
163
228
  none: false
164
229
  requirements:
165
230
  - - ~>
@@ -167,10 +232,15 @@ dependencies:
167
232
  version: '2.8'
168
233
  type: :development
169
234
  prerelease: false
170
- version_requirements: *70331180888980
235
+ version_requirements: !ruby/object:Gem::Requirement
236
+ none: false
237
+ requirements:
238
+ - - ~>
239
+ - !ruby/object:Gem::Version
240
+ version: '2.8'
171
241
  - !ruby/object:Gem::Dependency
172
242
  name: sqlite3
173
- requirement: &70331180888460 !ruby/object:Gem::Requirement
243
+ requirement: !ruby/object:Gem::Requirement
174
244
  none: false
175
245
  requirements:
176
246
  - - ! '>='
@@ -178,10 +248,15 @@ dependencies:
178
248
  version: '0'
179
249
  type: :development
180
250
  prerelease: false
181
- version_requirements: *70331180888460
251
+ version_requirements: !ruby/object:Gem::Requirement
252
+ none: false
253
+ requirements:
254
+ - - ! '>='
255
+ - !ruby/object:Gem::Version
256
+ version: '0'
182
257
  - !ruby/object:Gem::Dependency
183
258
  name: jasminerice
184
- requirement: &70331180887520 !ruby/object:Gem::Requirement
259
+ requirement: !ruby/object:Gem::Requirement
185
260
  none: false
186
261
  requirements:
187
262
  - - ! '>='
@@ -189,7 +264,12 @@ dependencies:
189
264
  version: '0'
190
265
  type: :development
191
266
  prerelease: false
192
- version_requirements: *70331180887520
267
+ version_requirements: !ruby/object:Gem::Requirement
268
+ none: false
269
+ requirements:
270
+ - - ! '>='
271
+ - !ruby/object:Gem::Version
272
+ version: '0'
193
273
  description: Alchemy is a Rails 3 CMS with a flexible content storing architecture.
194
274
  email:
195
275
  - alchemy@magiclabs.de
@@ -643,9 +723,9 @@ files:
643
723
  - lib/rails/generators/alchemy/plugin/templates/plugin.rb
644
724
  - lib/rails/generators/alchemy/plugin/templates/routes.rb
645
725
  - lib/rails/generators/alchemy/scaffold/files/elements.yml
646
- - lib/rails/generators/alchemy/scaffold/files/page_layouts.yml
647
726
  - lib/rails/generators/alchemy/scaffold/files/pages.html.erb
648
727
  - lib/rails/generators/alchemy/scaffold/scaffold_generator.rb
728
+ - lib/rails/generators/alchemy/scaffold/templates/page_layouts.yml.tt
649
729
  - lib/rails/templates/alchemy.rb
650
730
  - lib/tasks/ferret.rake
651
731
  - lib/tasks/fleximage.rake
@@ -740,7 +820,6 @@ files:
740
820
  - spec/spec_helper.rb
741
821
  - spec/support/alchemy/controller_hacks.rb
742
822
  - spec/support/alchemy/specs_helpers.rb
743
- - spec/support/integration_spec_helper.rb
744
823
  - vendor/assets/javascripts/jquery_plugins/jquery.Jcrop.min.js
745
824
  - vendor/assets/javascripts/jquery_plugins/jquery.dialogextend.min.js
746
825
  - vendor/assets/javascripts/jquery_plugins/jquery.html5uploader.js
@@ -864,7 +943,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
864
943
  requirements:
865
944
  - ImageMagick (libmagick), v6.6 or greater.
866
945
  rubyforge_project:
867
- rubygems_version: 1.8.15
946
+ rubygems_version: 1.8.24
868
947
  signing_key:
869
948
  specification_version: 3
870
949
  summary: An extremly flexbile CMS for Rails 3.2
@@ -957,5 +1036,4 @@ test_files:
957
1036
  - spec/spec_helper.rb
958
1037
  - spec/support/alchemy/controller_hacks.rb
959
1038
  - spec/support/alchemy/specs_helpers.rb
960
- - spec/support/integration_spec_helper.rb
961
1039
  has_rdoc:
@@ -1,24 +0,0 @@
1
- require 'declarative_authorization/maintenance'
2
- include Authorization::TestHelper
3
-
4
- # Trying to load additional authorization-rules in dummy-app.
5
- # When accessing dummy-app in development-env it works without loading,
6
- # in capybara-test this doesn't work. Unfortunately the method below doesn't work neither.
7
- # I leave it here as a reminder
8
- def load_authorization_rules
9
- Alchemy::AuthEngine.get_instance.load(File.join(File.dirname(__FILE__), '../..', 'config/authorization_rules.rb'))
10
- Alchemy::AuthEngine.get_instance.load(File.join(File.dirname(__FILE__), '../dummy' 'config/authorization_rules.rb'))
11
- end
12
-
13
- def create_admin_user
14
- @user = Alchemy::User.create!(:login => 'admin_user', :password => 's3cr3t', :password_confirmation => 's3cr3t', :email => 'jdoe2@example.com', :role => :admin)
15
- end
16
-
17
- def login_with_admin_user
18
- visit '/alchemy/admin/login'
19
- fill_in('alchemy_user_session_login', :with => 'admin_user')
20
- fill_in('alchemy_user_session_password', :with => 's3cr3t')
21
- click_on('Login')
22
- end
23
-
24
-