alchemy_cms 2.2.rc3 → 2.2.rc6
Sign up to get free protection for your applications and to get access to all the features.
- data/alchemy_cms.gemspec +1 -0
- data/app/assets/stylesheets/alchemy/base.css.scss +1 -1
- data/app/assets/stylesheets/alchemy/sitemap.css.scss +3 -0
- data/app/controllers/alchemy/admin/attachments_controller.rb +1 -1
- data/app/controllers/alchemy/admin/contents_controller.rb +1 -1
- data/app/controllers/alchemy/admin/dashboard_controller.rb +1 -1
- data/app/controllers/alchemy/admin/elements_controller.rb +1 -1
- data/app/controllers/alchemy/admin/essence_audios_controller.rb +1 -1
- data/app/controllers/alchemy/admin/essence_files_controller.rb +1 -1
- data/app/controllers/alchemy/admin/essence_flashes_controller.rb +1 -1
- data/app/controllers/alchemy/admin/essence_pictures_controller.rb +1 -1
- data/app/controllers/alchemy/admin/essence_videos_controller.rb +1 -1
- data/app/controllers/alchemy/admin/pages_controller.rb +4 -4
- data/app/controllers/alchemy/admin/resources_controller.rb +2 -3
- data/app/controllers/alchemy/admin/users_controller.rb +2 -2
- data/app/controllers/alchemy/base_controller.rb +8 -1
- data/app/controllers/alchemy/pages_controller.rb +2 -0
- data/app/models/alchemy/attachment.rb +2 -0
- data/app/models/alchemy/cell.rb +2 -0
- data/app/models/alchemy/content.rb +17 -4
- data/app/models/alchemy/element.rb +22 -3
- data/app/models/alchemy/essence_audio.rb +2 -0
- data/app/models/alchemy/essence_date.rb +2 -0
- data/app/models/alchemy/essence_file.rb +2 -0
- data/app/models/alchemy/essence_flash.rb +2 -0
- data/app/models/alchemy/essence_html.rb +2 -0
- data/app/models/alchemy/essence_picture.rb +15 -0
- data/app/models/alchemy/essence_richtext.rb +2 -0
- data/app/models/alchemy/essence_text.rb +10 -0
- data/app/models/alchemy/essence_video.rb +8 -0
- data/app/models/alchemy/folded_page.rb +1 -0
- data/app/models/alchemy/language.rb +11 -0
- data/app/models/alchemy/message.rb +7 -10
- data/app/models/alchemy/page.rb +28 -7
- data/app/models/alchemy/picture.rb +8 -0
- data/app/models/alchemy/user.rb +12 -8
- data/app/views/alchemy/admin/pages/_page.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/show_in_window.html.erb +1 -1
- data/app/views/alchemy/pictures/zoom.jpg.flexi +3 -0
- data/config/alchemy/config.yml +9 -13
- data/config/locales/alchemy.de.yml +29 -15
- data/config/locales/alchemy.en.yml +27 -10
- data/lib/alchemy/version.rb +1 -1
- data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +1 -1
- data/spec/controllers/pages_controller_spec.rb +8 -8
- data/spec/dummy/app/models/event.rb +1 -0
- data/spec/dummy/config/application.rb +26 -8
- data/spec/dummy/config/environments/development.rb +8 -8
- data/spec/dummy/config/environments/production.rb +9 -2
- data/spec/dummy/config/environments/test.rb +6 -11
- data/spec/factories.rb +1 -1
- data/spec/helpers/elements_helper_spec.rb +4 -4
- data/spec/models/language_spec.rb +2 -2
- data/spec/models/page_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -2
- metadata +36 -38
@@ -1,6 +1,17 @@
|
|
1
1
|
module Alchemy
|
2
2
|
class Language < ActiveRecord::Base
|
3
3
|
|
4
|
+
attr_accessible(
|
5
|
+
:name,
|
6
|
+
:language_code,
|
7
|
+
:frontpage_name,
|
8
|
+
:page_layout,
|
9
|
+
:public,
|
10
|
+
:default,
|
11
|
+
:country_code,
|
12
|
+
:code
|
13
|
+
)
|
14
|
+
|
4
15
|
validates_presence_of :name
|
5
16
|
validates_presence_of :language_code
|
6
17
|
validates_presence_of :page_layout
|
@@ -1,16 +1,13 @@
|
|
1
|
-
# This is a tableless model only used for validating
|
2
|
-
#
|
1
|
+
# This is a tableless model only used for validating contactform fields.
|
2
|
+
#
|
3
|
+
# You can specify the fields for your contactform in the +config/alchemy/config.yml+ file in the +:mailer+ options.
|
3
4
|
#
|
4
5
|
# === Example Contactform Configuration:
|
5
6
|
#
|
6
7
|
# :mailer:
|
7
8
|
# :form_layout_name: contact
|
8
9
|
# :fields: [subject, name, email, message, info]
|
9
|
-
# :validate_fields:
|
10
|
-
# :name:
|
11
|
-
# :message: blank_name
|
12
|
-
# :email:
|
13
|
-
# :message: blank_email
|
10
|
+
# :validate_fields: [name, email]
|
14
11
|
|
15
12
|
module Alchemy
|
16
13
|
class Message
|
@@ -31,9 +28,9 @@ module Alchemy
|
|
31
28
|
end
|
32
29
|
|
33
30
|
@@config[:validate_fields].each do |field|
|
34
|
-
validates_presence_of field
|
35
|
-
if field
|
36
|
-
validates_format_of field
|
31
|
+
validates_presence_of field
|
32
|
+
if field.to_s == 'email'
|
33
|
+
validates_format_of field, :with => ::Authlogic::Regex.email, :if => :email_is_filled
|
37
34
|
end
|
38
35
|
end
|
39
36
|
|
data/app/models/alchemy/page.rb
CHANGED
@@ -2,6 +2,27 @@
|
|
2
2
|
module Alchemy
|
3
3
|
class Page < ActiveRecord::Base
|
4
4
|
|
5
|
+
attr_accessible(
|
6
|
+
:do_not_sweep,
|
7
|
+
:language_code,
|
8
|
+
:language_id,
|
9
|
+
:language_root,
|
10
|
+
:layoutpage,
|
11
|
+
:meta_description,
|
12
|
+
:meta_keywords,
|
13
|
+
:name,
|
14
|
+
:page_layout,
|
15
|
+
:parent_id,
|
16
|
+
:public,
|
17
|
+
:restricted,
|
18
|
+
:robot_index,
|
19
|
+
:robot_follow,
|
20
|
+
:sitemap,
|
21
|
+
:title,
|
22
|
+
:urlname,
|
23
|
+
:visible
|
24
|
+
)
|
25
|
+
|
5
26
|
RESERVED_URLNAMES = %w(admin messages)
|
6
27
|
|
7
28
|
acts_as_nested_set(:dependent => :destroy)
|
@@ -13,18 +34,18 @@ module Alchemy
|
|
13
34
|
has_and_belongs_to_many :to_be_sweeped_elements, :class_name => 'Alchemy::Element', :uniq => true, :join_table => 'alchemy_elements_alchemy_pages'
|
14
35
|
belongs_to :language
|
15
36
|
|
16
|
-
validates_presence_of :name
|
17
|
-
validates_presence_of :page_layout, :
|
18
|
-
validates_presence_of :parent_id, :
|
19
|
-
validates_length_of :urlname, :minimum => 3, :
|
20
|
-
validates_uniqueness_of :urlname, :
|
21
|
-
validates :urlname, :exclusion => {:in => RESERVED_URLNAMES
|
37
|
+
validates_presence_of :name
|
38
|
+
validates_presence_of :page_layout, :unless => :systempage?
|
39
|
+
validates_presence_of :parent_id, :if => proc { Page.count > 1 }
|
40
|
+
validates_length_of :urlname, :minimum => 3, :if => :urlname_entered?
|
41
|
+
validates_uniqueness_of :urlname, :scope => [:language_id, :layoutpage], :if => :urlname_entered?
|
42
|
+
validates :urlname, :exclusion => {:in => RESERVED_URLNAMES}
|
22
43
|
|
23
44
|
attr_accessor :do_not_autogenerate
|
24
45
|
attr_accessor :do_not_sweep
|
25
46
|
attr_accessor :do_not_validate_language
|
26
47
|
|
27
|
-
|
48
|
+
before_validation :set_url_name, :unless => proc { |page| page.systempage? || page.redirects_to_external? }
|
28
49
|
before_save :set_title, :unless => proc { |page| page.systempage? || page.redirects_to_external? || !page.title.blank? }
|
29
50
|
before_save :set_language_code, :unless => :systempage?
|
30
51
|
before_save :set_restrictions_to_child_pages, :if => proc { |page| !page.systempage? && page.restricted_changed? }
|
data/app/models/alchemy/user.rb
CHANGED
@@ -8,6 +8,18 @@ module Alchemy
|
|
8
8
|
c.logged_in_timeout = Config.get(:auto_logout_time).minutes
|
9
9
|
end
|
10
10
|
|
11
|
+
attr_accessible(
|
12
|
+
:firstname,
|
13
|
+
:lastname,
|
14
|
+
:login,
|
15
|
+
:email,
|
16
|
+
:gender,
|
17
|
+
:role,
|
18
|
+
:language,
|
19
|
+
:password,
|
20
|
+
:password_confirmation
|
21
|
+
)
|
22
|
+
|
11
23
|
has_many :folded_pages
|
12
24
|
|
13
25
|
before_destroy :unlock_pages
|
@@ -66,13 +78,5 @@ module Alchemy
|
|
66
78
|
]
|
67
79
|
end
|
68
80
|
|
69
|
-
def self.all_online
|
70
|
-
User.logged_in
|
71
|
-
end
|
72
|
-
|
73
|
-
def self.all_others_online
|
74
|
-
User.logged_in.to_a.delete(self)
|
75
|
-
end
|
76
|
-
|
77
81
|
end
|
78
82
|
end
|
@@ -90,7 +90,7 @@
|
|
90
90
|
<div class="sitemap_sitename">
|
91
91
|
<%- if page.redirects_to_external? -%>
|
92
92
|
<span class="sitemap_pagename_link <%= cycle('even', 'odd') %> inactive"><%= page.name %></span>
|
93
|
-
<span class="redirect_url">
|
93
|
+
<span class="redirect_url" title="<%= h page.urlname %>">
|
94
94
|
» <%= t('Redirects to') %>:
|
95
95
|
<%= h page.urlname %>
|
96
96
|
</span>
|
data/config/alchemy/config.yml
CHANGED
@@ -81,20 +81,20 @@ default_language:
|
|
81
81
|
# ==== Options:
|
82
82
|
#
|
83
83
|
# page_layout_name: [String] # A +Alchemy::PageLayout+ name. Used to render the contactform on a page with this layout.
|
84
|
-
# fields: [Array] # An Array of fieldnames
|
85
|
-
# validate_fields: [
|
84
|
+
# fields: [Array] # An Array of fieldnames.
|
85
|
+
# validate_fields: [Array] # An Array of fieldnames to be validated on presence.
|
86
86
|
#
|
87
87
|
# ==== Translating validation messages:
|
88
88
|
#
|
89
|
-
# The
|
89
|
+
# The validation messages are passed through ::I18n.t so you can translate it in your language yml file.
|
90
90
|
#
|
91
|
-
# Example:
|
91
|
+
# ==== Example:
|
92
92
|
#
|
93
93
|
# de:
|
94
|
-
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
#
|
94
|
+
# activemodel:
|
95
|
+
# attributes:
|
96
|
+
# alchemy/message:
|
97
|
+
# firstname: Vorname
|
98
98
|
#
|
99
99
|
:mailer:
|
100
100
|
:page_layout_name: contact
|
@@ -103,11 +103,7 @@ default_language:
|
|
103
103
|
:mail_from: your.mail@your-domain.com
|
104
104
|
:mail_to: your.mail@your-domain.com
|
105
105
|
:fields: [salutation, firstname, lastname, address, zip, city, phone, email, message]
|
106
|
-
:validate_fields:
|
107
|
-
:lastname:
|
108
|
-
:message: enter_name
|
109
|
-
:email:
|
110
|
-
:message: enter_email
|
106
|
+
:validate_fields: [lastname, email]
|
111
107
|
|
112
108
|
# === User roles
|
113
109
|
# You can add own user roles. To set permissions for this roles please add an authorization_rules.rb file in your config folder.
|
@@ -113,12 +113,6 @@ de:
|
|
113
113
|
message: 'Nachricht'
|
114
114
|
send: 'absenden'
|
115
115
|
mandatory_fields: '*Pflichtfelder. Bitte füllen Sie diese Felder aus.'
|
116
|
-
# Translations for the contactform validations.
|
117
|
-
# Validations are set in the config/alchemy/config.yml mailer section.
|
118
|
-
validations:
|
119
|
-
enter_name: 'Bitte geben Sie Ihren Namen an'
|
120
|
-
enter_email: Bitte geben Sie Ihre E-Mail-Adresse an
|
121
|
-
wrong_email_format: 'Die E-Mail-Adresse scheint nicht richtig zu sein.'
|
122
116
|
# The flash message shown after succesfully sending the message.
|
123
117
|
messages:
|
124
118
|
success: 'Ihre Nachricht wurde erfolgreich übermittelt.'
|
@@ -232,7 +226,7 @@ de:
|
|
232
226
|
"No EssenceType given": ""
|
233
227
|
"No image found. Did you saved the element?": "Es wurde kein Bild gefunden. Haben Sie das Element auch gespeichert?"
|
234
228
|
"No items in your clipboard": "Ihre Zwischenablage ist leer"
|
235
|
-
"None": ""
|
229
|
+
"None": "keine"
|
236
230
|
"Open Link in": "Link öffnen in"
|
237
231
|
"Page deleted": "%{name} wurde gelöscht"
|
238
232
|
"Page saved": "%{name} wurde gespeichert"
|
@@ -253,13 +247,11 @@ de:
|
|
253
247
|
"Picture cache flushed": "Bildercache wurde geleert"
|
254
248
|
"Please Signup": "Um Ihre Homepage bearbeiten zu können, müssen Sie als erstes einen Admin Benutzer einrichten."
|
255
249
|
"Please choose": "Bitte wählen"
|
256
|
-
"Please choose a page layout.": "Bitte wählen Sie einen Seitentyp."
|
257
|
-
choose_element: "Bitte wählen Sie ein Element."
|
258
250
|
"Please log in": "Bitte melden Sie sich an."
|
259
251
|
use_alternative_uploader_instead: "Benutzen Sie bitte diesen alternativen Uploader."
|
260
252
|
"Publish page": "veröffentlichen"
|
261
253
|
"Read the License": "Lizenz lesen"
|
262
|
-
"Redirects to": ""
|
254
|
+
"Redirects to": "Leitet weiter auf"
|
263
255
|
"Remove item from clipboard": "Inhalt aus der Zwischenablage entfernen"
|
264
256
|
"Remove this content": "Diesen Inhalt entfernen"
|
265
257
|
"Reset Imagemask": "Bildmaske zurücksetzen"
|
@@ -273,7 +265,6 @@ de:
|
|
273
265
|
"Show trash": "Papierkorb anzeigen"
|
274
266
|
"Size": "Größe"
|
275
267
|
"Sort pages": "Seiten sortieren"
|
276
|
-
"Status": ""
|
277
268
|
"Successfully added content": "%{content} wurde hinzugefügt"
|
278
269
|
"Successfully deleted content": "%{content} wurde gelöscht"
|
279
270
|
"Successfully saved content position": "Die Position wurde gespeichert."
|
@@ -285,8 +276,6 @@ de:
|
|
285
276
|
"Title": "Titel"
|
286
277
|
"To manage your website open a browser and go to": "Um die Inhalte Ihrer Webseite zu bearbeiten klicken Sie bitte auf folgenden Link"
|
287
278
|
"Trash": "Papierkorb"
|
288
|
-
"URL": ""
|
289
|
-
"URL-Name already token": "Der URL-Name ist bereits vergeben."
|
290
279
|
"User created": "%{name} wurde erstellt"
|
291
280
|
"User deleted": "%{name} wurde gelöscht"
|
292
281
|
"User updated": "%{name} wurde aktualisiert"
|
@@ -483,7 +472,6 @@ de:
|
|
483
472
|
picture_gallery_editor: 'Bilder'
|
484
473
|
place_link: "Text verlinken"
|
485
474
|
player_version: "Flashplayer Version"
|
486
|
-
"please enter a name": "Bitte geben Sie einen Namen ein."
|
487
475
|
"please enter subject and mail address": "Bitte geben Sie den Betreff und eine Empfängeradresse an."
|
488
476
|
please_confirm: "Bitte bestätigen"
|
489
477
|
please_wait: "Bitte warten"
|
@@ -522,7 +510,6 @@ de:
|
|
522
510
|
upload_file: "Datei(en) hochladen"
|
523
511
|
upload_image: "Bild(er) hochladen"
|
524
512
|
url_name: "URL-Name"
|
525
|
-
urlname_to_short: "Der URL-Name der Seite ist zu kurz (min. 3 Zeichen)"
|
526
513
|
username: "Benutzername"
|
527
514
|
visible: "sichtbar"
|
528
515
|
want_to_create_new_language: "Wollen Sie einen neuen leeren Sprachbaum erstellen?"
|
@@ -663,6 +650,19 @@ de:
|
|
663
650
|
words_connector: ", "
|
664
651
|
two_words_connector: " und "
|
665
652
|
last_word_connector: " und "
|
653
|
+
|
654
|
+
activemodel:
|
655
|
+
attributes:
|
656
|
+
alchemy/message:
|
657
|
+
salutation: Anrede
|
658
|
+
firstname: Vorname
|
659
|
+
lastname: Nachname
|
660
|
+
address: Adresse
|
661
|
+
zip: PLZ
|
662
|
+
city: Ort
|
663
|
+
phone: Telefon
|
664
|
+
email: E-Mail
|
665
|
+
message: Nachricht
|
666
666
|
|
667
667
|
# Translations for active record database models and error messages.
|
668
668
|
activerecord:
|
@@ -803,11 +803,25 @@ de:
|
|
803
803
|
attributes:
|
804
804
|
essence:
|
805
805
|
validation_failed: 'Validierung fehlgeschlagen.'
|
806
|
+
alchemy/element:
|
807
|
+
attributes:
|
808
|
+
name:
|
809
|
+
blank: "^Bitte wählen Sie ein Element."
|
806
810
|
alchemy/language:
|
807
811
|
attributes:
|
808
812
|
language_code:
|
809
813
|
invalid: 'ist nicht korrekt. Bitte exakt zwei Kleinbuchstaben verwenden.'
|
810
814
|
taken: 'ist für dieses Länderkürzel bereits vergeben.'
|
815
|
+
alchemy/page:
|
816
|
+
attributes:
|
817
|
+
name:
|
818
|
+
blank: "^Bitte geben Sie einen Namen ein."
|
819
|
+
page_layout:
|
820
|
+
blank: "^Bitte wählen Sie einen Seitentyp."
|
821
|
+
urlname:
|
822
|
+
too_short: "^Der URL-Name der Seite ist zu kurz (min. 3 Zeichen)"
|
823
|
+
taken: "^Der URL-Name ist bereits vergeben."
|
824
|
+
exclusion: "^Der URL-Name der Seite kann nicht benutzt werden."
|
811
825
|
|
812
826
|
# Translations for the authentication system used in alchemy.
|
813
827
|
authlogic:
|
@@ -96,12 +96,6 @@ en:
|
|
96
96
|
message: 'Message'
|
97
97
|
send: 'Send'
|
98
98
|
mandatory_fields: '*Mandatory fields.'
|
99
|
-
# Translations for the contactform validations.
|
100
|
-
# Validations are set in the config/alchemy/config.yml mailer section.
|
101
|
-
validations:
|
102
|
-
enter_name: 'Please enter your name'
|
103
|
-
enter_email: 'Please enter your email'
|
104
|
-
wrong_email_format: 'Email has wrong format'
|
105
99
|
# The flash message shown after succesfully sending the message.
|
106
100
|
messages:
|
107
101
|
success: 'Your message was delivered succesfully.'
|
@@ -186,7 +180,6 @@ en:
|
|
186
180
|
big_thumbnails: "Big thumbnails"
|
187
181
|
choose_element_as_target: "Please choose an element as target"
|
188
182
|
choose_element_to_link: "Please choose an element"
|
189
|
-
choose_element: "Please choose an element."
|
190
183
|
choose_file_to_link: "Please choose a file to link"
|
191
184
|
click_to_show_all: "Click to show all again."
|
192
185
|
confirm_to_delete_file: "Do you really want to delete this file from the server?"
|
@@ -326,7 +319,6 @@ en:
|
|
326
319
|
"Picture deleted successfully": "Picture %{name} deleted"
|
327
320
|
place_link: "Link text"
|
328
321
|
player_version: "Flashplayer Version"
|
329
|
-
"please enter a name": "Please enter a name."
|
330
322
|
"please enter subject and mail address": "Please enter recipient and subject."
|
331
323
|
please_confirm: "Please confirm"
|
332
324
|
please_wait: "Please wait"
|
@@ -359,7 +351,6 @@ en:
|
|
359
351
|
upload_file: "Upload file(s)"
|
360
352
|
upload_image: "Upload image(s)"
|
361
353
|
url_name: "URL-Name"
|
362
|
-
urlname_to_short: "The pages urlname is too short (minimum of 3 characters)"
|
363
354
|
username: "Username"
|
364
355
|
want_to_create_new_language: "Do you want to create a new empty language tree?"
|
365
356
|
want_to_make_copy_of_existing_language: "Do you want to copy an existing language tree?"
|
@@ -488,6 +479,18 @@ en:
|
|
488
479
|
one: "over 1 year"
|
489
480
|
many: "over %{count} years"
|
490
481
|
|
482
|
+
activemodel:
|
483
|
+
attributes:
|
484
|
+
alchemy/message:
|
485
|
+
salutation: 'Salutation'
|
486
|
+
firstname: 'Firstname'
|
487
|
+
lastname: 'Lastname'
|
488
|
+
address: 'Street / No.'
|
489
|
+
zip: 'Zipcode / City'
|
490
|
+
phone: 'Telephone'
|
491
|
+
email: 'Email'
|
492
|
+
message: 'Message'
|
493
|
+
|
491
494
|
# Translations for active record database models and error messages.
|
492
495
|
activerecord:
|
493
496
|
|
@@ -589,10 +592,24 @@ en:
|
|
589
592
|
attributes:
|
590
593
|
essence:
|
591
594
|
validation_failed: 'Validation failed.'
|
595
|
+
alchemy/element:
|
596
|
+
attributes:
|
597
|
+
name:
|
598
|
+
blank: "^Please choose an element."
|
592
599
|
alchemy/language:
|
593
600
|
attributes:
|
594
601
|
code:
|
595
|
-
invalid: 'Format of languagecode is not valid. Please use exactly two lowercase characters.'
|
602
|
+
invalid: '^Format of languagecode is not valid. Please use exactly two lowercase characters.'
|
603
|
+
alchemy/page:
|
604
|
+
attributes:
|
605
|
+
name:
|
606
|
+
blank: "^Please enter a name."
|
607
|
+
page_layout:
|
608
|
+
blank: "^Please choose a page layout."
|
609
|
+
urlname:
|
610
|
+
too_short: "^The pages urlname is too short (minimum of 3 characters)."
|
611
|
+
taken: "^URL-Name already taken."
|
612
|
+
exclusion: "^URL-Name reserved."
|
596
613
|
|
597
614
|
# Translations for the authentication system used in alchemy.
|
598
615
|
authlogic:
|
data/lib/alchemy/version.rb
CHANGED
@@ -28,7 +28,7 @@ module Alchemy
|
|
28
28
|
page_layouts_path = File.expand_path('../../../../../app/views/alchemy/page_layouts', File.dirname(__FILE__))
|
29
29
|
copy_file "#{@config_path}/elements.yml", "#{Rails.root}/config/alchemy/elements.yml"
|
30
30
|
copy_file "#{@config_path}/page_layouts.yml", "#{Rails.root}/config/alchemy/page_layouts.yml"
|
31
|
-
copy_file "#{layouts_path}/pages.html.erb", "#{Rails.root}/app/views/layouts/
|
31
|
+
copy_file "#{layouts_path}/pages.html.erb", "#{Rails.root}/app/views/layouts/application.html.erb"
|
32
32
|
Dir.glob("#{elements_path}/*").reject { |file_path| !(File.basename(file_path) =~ /(.+)_(view|editor).html.erb/) }.each do |file_path|
|
33
33
|
copy_file file_path, "#{Rails.root}/app/views/alchemy/elements/#{File.basename(file_path)}"
|
34
34
|
end
|
@@ -121,10 +121,10 @@ describe Alchemy::PagesController do
|
|
121
121
|
|
122
122
|
context "with incorrect levelnames in params" do
|
123
123
|
|
124
|
-
it "should
|
125
|
-
|
126
|
-
|
127
|
-
|
124
|
+
it "should render a 404 page" do
|
125
|
+
get :show, {:level1 => 'catalog', :level2 => 'faqs', :urlname => 'screwdriver'}
|
126
|
+
response.status.should == 404
|
127
|
+
response.body.should have_content('The page you were looking for doesn\'t exist')
|
128
128
|
end
|
129
129
|
|
130
130
|
end
|
@@ -132,11 +132,11 @@ describe Alchemy::PagesController do
|
|
132
132
|
end
|
133
133
|
|
134
134
|
context "when a non-existent page is requested" do
|
135
|
-
it "should
|
135
|
+
it "should rescue a RoutingError with rendering a 404 page." do
|
136
136
|
Factory(:admin_user) # otherwise we are redirected to create_user
|
137
|
-
|
138
|
-
|
139
|
-
|
137
|
+
get :show, {:urlname => 'doesntexist'}
|
138
|
+
response.status.should == 404
|
139
|
+
response.body.should have_content('The page you were looking for doesn\'t exist')
|
140
140
|
end
|
141
141
|
end
|
142
142
|
|