alchemy_cms 2.3.1 → 2.3.2

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/.gitignore CHANGED
@@ -18,4 +18,5 @@ spec/dummy/uploads/
18
18
  spec/dummy/db/test.sqlite3-journal
19
19
  spec/dummy/db/seeds.rb
20
20
  .rvmrc
21
- spec/dummy/config/locales/**/*
21
+ spec/dummy/config/locales/**/*
22
+ /coverage/
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
21
  s.require_paths = ["lib"]
22
22
 
23
- s.add_runtime_dependency(%q<rails>, ["~> 3.2.5"])
23
+ s.add_runtime_dependency(%q<rails>, ["~> 3.2.11"])
24
24
  s.add_runtime_dependency(%q<authlogic>)
25
25
  s.add_runtime_dependency(%q<awesome_nested_set>, ["~> 2.0"])
26
26
  s.add_runtime_dependency(%q<acts-as-taggable-on>, ["~> 2.1"])
@@ -41,7 +41,7 @@ Gem::Specification.new do |s|
41
41
  s.add_development_dependency(%q<bumpy>)
42
42
  s.add_development_dependency(%q<capybara>)
43
43
  s.add_development_dependency(%q<factory_girl_rails>, ['~> 1.7.0'])
44
- s.add_development_dependency(%q<rspec-rails>)
44
+ s.add_development_dependency(%q<rspec-rails>, ['2.12.0'])
45
45
  s.add_development_dependency(%q<sqlite3>)
46
46
  s.add_development_dependency(%q<yard>)
47
47
 
@@ -56,8 +56,6 @@ module Alchemy
56
56
  session[:current_locale] = ::I18n.locale = params[:locale]
57
57
  elsif current_user && current_user.language.present?
58
58
  ::I18n.locale = current_user.language
59
- elsif Rails.env == 'test' # OMG I hate to do this. But it helps...
60
- ::I18n.locale = 'en'
61
59
  else
62
60
  ::I18n.locale = request.env['HTTP_ACCEPT_LANGUAGE'].try(:scan, /^[a-z]{2}/).try(:first)
63
61
  end
@@ -1,6 +1,6 @@
1
1
  module Alchemy
2
2
 
3
- VERSION = "2.3.1"
3
+ VERSION = "2.3.2"
4
4
 
5
5
  def self.version
6
6
  VERSION
@@ -37,7 +37,7 @@ module Dummy
37
37
 
38
38
  # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
39
39
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
40
- # config.i18n.default_locale = :de
40
+ config.i18n.default_locale = :en
41
41
 
42
42
  # Configure the default encoding used in templates for Ruby 1.9.
43
43
  config.encoding = "utf-8"
@@ -5,6 +5,7 @@ FactoryGirl.define do
5
5
  login "jdoe"
6
6
  password 's3cr3t'
7
7
  password_confirmation 's3cr3t'
8
+ language 'en'
8
9
 
9
10
  factory :admin_user do
10
11
  role "admin"
@@ -4,33 +4,34 @@ describe "Translation integration" do
4
4
 
5
5
  context "in admin backend" do
6
6
 
7
- before do
8
- authorize_as_admin
9
- end
10
-
11
7
  it "should be possible to set the locale of the admin backend via params" do
8
+ authorize_as_admin
12
9
  visit admin_dashboard_path(:locale => :de)
13
10
  page.should have_content('Willkommen')
14
11
  end
15
12
 
16
13
  it "should store the current locale in the session" do
14
+ authorize_as_admin
17
15
  visit admin_dashboard_path(:locale => :de)
18
16
  visit admin_dashboard_path
19
17
  page.should have_content('Willkommen')
20
18
  end
21
19
 
22
20
  it "should be possible to change the current locale in the session" do
21
+ authorize_as_admin
23
22
  visit admin_dashboard_path(:locale => :de)
24
23
  visit admin_dashboard_path(:locale => :en)
25
24
  page.should have_content('Welcome')
26
25
  end
27
26
 
28
27
  it "should not be possible to switch the locale of the admin backend to an unknown locale" do
28
+ authorize_as_admin
29
29
  visit admin_dashboard_path(:locale => :ko)
30
30
  page.should have_content('Welcome')
31
31
  end
32
32
 
33
33
  it "should use the current users language setting if no other parameter is given" do
34
+ authorize_as_admin(locale = nil)
34
35
  Alchemy::User.first.update_attributes(:language => :de)
35
36
  visit admin_dashboard_path
36
37
  page.should have_content('Willkommen')
@@ -41,8 +42,6 @@ describe "Translation integration" do
41
42
  context "with translated header" do
42
43
 
43
44
  before do
44
- # Hack my hack.... OMG
45
- Rails.stub(:env).and_return('foo')
46
45
  Capybara.current_driver = :rack_test_translated_header
47
46
  end
48
47
 
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe "The Routing", :type => :routing do
4
4
 
5
- before(:each) { @routes = Alchemy::Engine.routes }
5
+ before { @routes = Alchemy::Engine.routes }
6
6
 
7
7
  context "for downloads" do
8
8
 
@@ -10,44 +10,44 @@ describe "The Routing", :type => :routing do
10
10
  {
11
11
  :get => "/attachment/32/download/Presseveranstaltung.pdf"
12
12
  }.should route_to(
13
- :controller => "alchemy/attachments",
14
- :action => "download",
15
- :id => "32",
16
- :name => "Presseveranstaltung",
17
- :format => "pdf"
18
- )
13
+ :controller => "alchemy/attachments",
14
+ :action => "download",
15
+ :id => "32",
16
+ :name => "Presseveranstaltung",
17
+ :format => "pdf"
18
+ )
19
19
  end
20
20
 
21
21
  it "should have a route for legacy Alchemy 1.x downloads" do
22
22
  {
23
23
  :get => "/attachment/32/download?name=Presseveranstaltung.pdf"
24
24
  }.should route_to(
25
- :controller => "alchemy/attachments",
26
- :action => "download",
27
- :id => "32"
28
- )
25
+ :controller => "alchemy/attachments",
26
+ :action => "download",
27
+ :id => "32"
28
+ )
29
29
  end
30
30
 
31
31
  it "should have a route for legacy washAPP downloads" do
32
32
  {
33
33
  :get => "/wa_files/download/11"
34
34
  }.should route_to(
35
- :controller => "alchemy/attachments",
36
- :action => "download",
37
- :id => "11"
38
- )
35
+ :controller => "alchemy/attachments",
36
+ :action => "download",
37
+ :id => "11"
38
+ )
39
39
  end
40
40
 
41
41
  it "should have a route for legacy WebMate downloads" do
42
42
  {
43
43
  :get => "/uploads/files/0000/0028/Pressetext.pdf"
44
44
  }.should route_to(
45
- :controller => "alchemy/attachments",
46
- :action => "download",
47
- :id => "0028",
48
- :name => "Pressetext",
49
- :suffix => "pdf"
50
- )
45
+ :controller => "alchemy/attachments",
46
+ :action => "download",
47
+ :id => "0028",
48
+ :name => "Pressetext",
49
+ :suffix => "pdf"
50
+ )
51
51
  end
52
52
 
53
53
  end
@@ -60,11 +60,11 @@ describe "The Routing", :type => :routing do
60
60
  {
61
61
  :get => "/products/my-product"
62
62
  }.should route_to(
63
- :controller => "alchemy/pages",
64
- :action => "show",
65
- :level1 => "products",
66
- :urlname => "my-product"
67
- )
63
+ :controller => "alchemy/pages",
64
+ :action => "show",
65
+ :level1 => "products",
66
+ :urlname => "my-product"
67
+ )
68
68
  end
69
69
 
70
70
  context "and language" do
@@ -73,12 +73,12 @@ describe "The Routing", :type => :routing do
73
73
  {
74
74
  :get => "/de/products/my-product"
75
75
  }.should route_to(
76
- :controller => "alchemy/pages",
77
- :action => "show",
78
- :level1 => "products",
79
- :urlname => "my-product",
80
- :lang => "de"
81
- )
76
+ :controller => "alchemy/pages",
77
+ :action => "show",
78
+ :level1 => "products",
79
+ :urlname => "my-product",
80
+ :lang => "de"
81
+ )
82
82
  end
83
83
 
84
84
  end
@@ -91,12 +91,12 @@ describe "The Routing", :type => :routing do
91
91
  {
92
92
  :get => "/catalog/products/my-product"
93
93
  }.should route_to(
94
- :controller => "alchemy/pages",
95
- :action => "show",
96
- :level1 => "catalog",
97
- :level2 => "products",
98
- :urlname => "my-product"
99
- )
94
+ :controller => "alchemy/pages",
95
+ :action => "show",
96
+ :level1 => "catalog",
97
+ :level2 => "products",
98
+ :urlname => "my-product"
99
+ )
100
100
  end
101
101
 
102
102
  context "and language" do
@@ -105,13 +105,13 @@ describe "The Routing", :type => :routing do
105
105
  {
106
106
  :get => "/de/catalog/products/my-product"
107
107
  }.should route_to(
108
- :controller => "alchemy/pages",
109
- :action => "show",
110
- :level1 => "catalog",
111
- :level2 => "products",
112
- :urlname => "my-product",
113
- :lang => "de"
114
- )
108
+ :controller => "alchemy/pages",
109
+ :action => "show",
110
+ :level1 => "catalog",
111
+ :level2 => "products",
112
+ :urlname => "my-product",
113
+ :lang => "de"
114
+ )
115
115
  end
116
116
 
117
117
  end
@@ -124,13 +124,13 @@ describe "The Routing", :type => :routing do
124
124
  {
125
125
  :get => "/2011/12/08/my-post"
126
126
  }.should route_to(
127
- :controller => "alchemy/pages",
128
- :action => "show",
129
- :level1 => "2011",
130
- :level2 => "12",
131
- :level3 => "08",
132
- :urlname => "my-post"
133
- )
127
+ :controller => "alchemy/pages",
128
+ :action => "show",
129
+ :level1 => "2011",
130
+ :level2 => "12",
131
+ :level3 => "08",
132
+ :urlname => "my-post"
133
+ )
134
134
  end
135
135
 
136
136
  context "and language" do
@@ -139,14 +139,14 @@ describe "The Routing", :type => :routing do
139
139
  {
140
140
  :get => "/de/2011/12/08/my-post"
141
141
  }.should route_to(
142
- :controller => "alchemy/pages",
143
- :action => "show",
144
- :level1 => "2011",
145
- :level2 => "12",
146
- :level3 => "08",
147
- :urlname => "my-post",
148
- :lang => "de"
149
- )
142
+ :controller => "alchemy/pages",
143
+ :action => "show",
144
+ :level1 => "2011",
145
+ :level2 => "12",
146
+ :level3 => "08",
147
+ :urlname => "my-post",
148
+ :lang => "de"
149
+ )
150
150
  end
151
151
 
152
152
  end
@@ -161,97 +161,97 @@ describe "The Routing", :type => :routing do
161
161
  {
162
162
  :get => "/pictures/3/show/900x300/kitten.jpg"
163
163
  }.should route_to(
164
- :controller => "alchemy/pictures",
165
- :action => "show",
166
- :id => "3",
167
- :size => "900x300",
168
- :name => "kitten",
169
- :format => "jpg"
170
- )
164
+ :controller => "alchemy/pictures",
165
+ :action => "show",
166
+ :id => "3",
167
+ :size => "900x300",
168
+ :name => "kitten",
169
+ :format => "jpg"
170
+ )
171
171
  end
172
172
 
173
173
  it "should route to cropped show action" do
174
174
  {
175
175
  :get => "/pictures/3/show/900x300/crop/kitten.jpg"
176
176
  }.should route_to(
177
- :controller => "alchemy/pictures",
178
- :action => "show",
179
- :id => "3",
180
- :size => "900x300",
181
- :crop => "crop",
182
- :name => "kitten",
183
- :format => "jpg"
184
- )
177
+ :controller => "alchemy/pictures",
178
+ :action => "show",
179
+ :id => "3",
180
+ :size => "900x300",
181
+ :crop => "crop",
182
+ :name => "kitten",
183
+ :format => "jpg"
184
+ )
185
185
  end
186
186
 
187
187
  it "should route to cropped mask show action" do
188
188
  get(
189
189
  "/pictures/3/show/300x300/crop/200x50/100x100/kitten.jpg"
190
190
  ).should route_to(
191
- :controller => "alchemy/pictures",
192
- :action => "show",
193
- :id => "3",
194
- :size => "300x300",
195
- :crop => "crop",
196
- :crop_from => "200x50",
197
- :crop_size => "100x100",
198
- :name => "kitten",
199
- :format => "jpg"
200
- )
191
+ :controller => "alchemy/pictures",
192
+ :action => "show",
193
+ :id => "3",
194
+ :size => "300x300",
195
+ :crop => "crop",
196
+ :crop_from => "200x50",
197
+ :crop_size => "100x100",
198
+ :name => "kitten",
199
+ :format => "jpg"
200
+ )
201
201
  end
202
202
 
203
203
  it "should route to thumbnail action" do
204
204
  get(
205
205
  "/pictures/3/thumbnails/small/kitten.jpg"
206
206
  ).should route_to(
207
- :controller => "alchemy/pictures",
208
- :action => "thumbnail",
209
- :id => "3",
210
- :size => "small",
211
- :name => "kitten",
212
- :format => "jpg"
213
- )
207
+ :controller => "alchemy/pictures",
208
+ :action => "thumbnail",
209
+ :id => "3",
210
+ :size => "small",
211
+ :name => "kitten",
212
+ :format => "jpg"
213
+ )
214
214
  end
215
215
 
216
216
  it "should route to cropped thumbnail action" do
217
217
  get(
218
218
  "/pictures/3/thumbnails/small/crop/kitten.jpg"
219
219
  ).should route_to(
220
- :controller => "alchemy/pictures",
221
- :action => "thumbnail",
222
- :id => "3",
223
- :crop => "crop",
224
- :size => "small",
225
- :name => "kitten",
226
- :format => "jpg"
227
- )
220
+ :controller => "alchemy/pictures",
221
+ :action => "thumbnail",
222
+ :id => "3",
223
+ :crop => "crop",
224
+ :size => "small",
225
+ :name => "kitten",
226
+ :format => "jpg"
227
+ )
228
228
  end
229
229
 
230
230
  it "should route to cropped and masked thumbnail" do
231
231
  get(
232
232
  "/pictures/3/thumbnails/small/0x0/200x200/kitten.jpg"
233
233
  ).should route_to(
234
- :controller => "alchemy/pictures",
235
- :action => "thumbnail",
236
- :id => "3",
237
- :crop_from => "0x0",
238
- :crop_size => "200x200",
239
- :size => "small",
240
- :name => "kitten",
241
- :format => "jpg"
242
- )
234
+ :controller => "alchemy/pictures",
235
+ :action => "thumbnail",
236
+ :id => "3",
237
+ :crop_from => "0x0",
238
+ :crop_size => "200x200",
239
+ :size => "small",
240
+ :name => "kitten",
241
+ :format => "jpg"
242
+ )
243
243
  end
244
244
 
245
245
  it "should route to zoomed picture" do
246
246
  get(
247
247
  "/pictures/3/zoom/kitten.jpg"
248
248
  ).should route_to(
249
- :controller => "alchemy/pictures",
250
- :action => "zoom",
251
- :id => "3",
252
- :name => "kitten",
253
- :format => "jpg"
254
- )
249
+ :controller => "alchemy/pictures",
250
+ :action => "zoom",
251
+ :id => "3",
252
+ :name => "kitten",
253
+ :format => "jpg"
254
+ )
255
255
  end
256
256
 
257
257
  end
@@ -15,9 +15,9 @@ module Alchemy
15
15
  # * create_admin_user
16
16
  # * login_into_alchemy
17
17
  #
18
- def authorize_as_admin
18
+ def authorize_as_admin(locale = 'en')
19
19
  create_admin_user
20
- login_into_alchemy
20
+ login_into_alchemy(locale)
21
21
  end
22
22
 
23
23
  # Capybara actions to login into Alchemy Backend
@@ -26,8 +26,8 @@ module Alchemy
26
26
  #
27
27
  # See: create_admin_user method
28
28
  #
29
- def login_into_alchemy
30
- visit '/alchemy/admin/login'
29
+ def login_into_alchemy(locale = 'en')
30
+ visit "/alchemy/admin/login?locale=#{locale}"
31
31
  fill_in('alchemy_user_session_login', :with => 'jdoe')
32
32
  fill_in('alchemy_user_session_password', :with => 's3cr3t')
33
33
  click_on('Login')
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.3.1
4
+ version: 2.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2012-11-19 00:00:00.000000000 Z
15
+ date: 2013-01-10 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rails
@@ -21,7 +21,7 @@ dependencies:
21
21
  requirements:
22
22
  - - ~>
23
23
  - !ruby/object:Gem::Version
24
- version: 3.2.5
24
+ version: 3.2.11
25
25
  type: :runtime
26
26
  prerelease: false
27
27
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  requirements:
30
30
  - - ~>
31
31
  - !ruby/object:Gem::Version
32
- version: 3.2.5
32
+ version: 3.2.11
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: authlogic
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -339,17 +339,17 @@ dependencies:
339
339
  requirement: !ruby/object:Gem::Requirement
340
340
  none: false
341
341
  requirements:
342
- - - ! '>='
342
+ - - '='
343
343
  - !ruby/object:Gem::Version
344
- version: '0'
344
+ version: 2.12.0
345
345
  type: :development
346
346
  prerelease: false
347
347
  version_requirements: !ruby/object:Gem::Requirement
348
348
  none: false
349
349
  requirements:
350
- - - ! '>='
350
+ - - '='
351
351
  - !ruby/object:Gem::Version
352
- version: '0'
352
+ version: 2.12.0
353
353
  - !ruby/object:Gem::Dependency
354
354
  name: sqlite3
355
355
  requirement: !ruby/object:Gem::Requirement
@@ -1094,7 +1094,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1094
1094
  version: '0'
1095
1095
  segments:
1096
1096
  - 0
1097
- hash: -2692259618496397345
1097
+ hash: -3162154013037762335
1098
1098
  requirements:
1099
1099
  - ImageMagick (libmagick), v6.6 or greater.
1100
1100
  rubyforge_project: