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.
Files changed (56) hide show
  1. data/alchemy_cms.gemspec +1 -0
  2. data/app/assets/stylesheets/alchemy/base.css.scss +1 -1
  3. data/app/assets/stylesheets/alchemy/sitemap.css.scss +3 -0
  4. data/app/controllers/alchemy/admin/attachments_controller.rb +1 -1
  5. data/app/controllers/alchemy/admin/contents_controller.rb +1 -1
  6. data/app/controllers/alchemy/admin/dashboard_controller.rb +1 -1
  7. data/app/controllers/alchemy/admin/elements_controller.rb +1 -1
  8. data/app/controllers/alchemy/admin/essence_audios_controller.rb +1 -1
  9. data/app/controllers/alchemy/admin/essence_files_controller.rb +1 -1
  10. data/app/controllers/alchemy/admin/essence_flashes_controller.rb +1 -1
  11. data/app/controllers/alchemy/admin/essence_pictures_controller.rb +1 -1
  12. data/app/controllers/alchemy/admin/essence_videos_controller.rb +1 -1
  13. data/app/controllers/alchemy/admin/pages_controller.rb +4 -4
  14. data/app/controllers/alchemy/admin/resources_controller.rb +2 -3
  15. data/app/controllers/alchemy/admin/users_controller.rb +2 -2
  16. data/app/controllers/alchemy/base_controller.rb +8 -1
  17. data/app/controllers/alchemy/pages_controller.rb +2 -0
  18. data/app/models/alchemy/attachment.rb +2 -0
  19. data/app/models/alchemy/cell.rb +2 -0
  20. data/app/models/alchemy/content.rb +17 -4
  21. data/app/models/alchemy/element.rb +22 -3
  22. data/app/models/alchemy/essence_audio.rb +2 -0
  23. data/app/models/alchemy/essence_date.rb +2 -0
  24. data/app/models/alchemy/essence_file.rb +2 -0
  25. data/app/models/alchemy/essence_flash.rb +2 -0
  26. data/app/models/alchemy/essence_html.rb +2 -0
  27. data/app/models/alchemy/essence_picture.rb +15 -0
  28. data/app/models/alchemy/essence_richtext.rb +2 -0
  29. data/app/models/alchemy/essence_text.rb +10 -0
  30. data/app/models/alchemy/essence_video.rb +8 -0
  31. data/app/models/alchemy/folded_page.rb +1 -0
  32. data/app/models/alchemy/language.rb +11 -0
  33. data/app/models/alchemy/message.rb +7 -10
  34. data/app/models/alchemy/page.rb +28 -7
  35. data/app/models/alchemy/picture.rb +8 -0
  36. data/app/models/alchemy/user.rb +12 -8
  37. data/app/views/alchemy/admin/pages/_page.html.erb +1 -1
  38. data/app/views/alchemy/admin/pictures/show_in_window.html.erb +1 -1
  39. data/app/views/alchemy/pictures/zoom.jpg.flexi +3 -0
  40. data/config/alchemy/config.yml +9 -13
  41. data/config/locales/alchemy.de.yml +29 -15
  42. data/config/locales/alchemy.en.yml +27 -10
  43. data/lib/alchemy/version.rb +1 -1
  44. data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +1 -1
  45. data/spec/controllers/pages_controller_spec.rb +8 -8
  46. data/spec/dummy/app/models/event.rb +1 -0
  47. data/spec/dummy/config/application.rb +26 -8
  48. data/spec/dummy/config/environments/development.rb +8 -8
  49. data/spec/dummy/config/environments/production.rb +9 -2
  50. data/spec/dummy/config/environments/test.rb +6 -11
  51. data/spec/factories.rb +1 -1
  52. data/spec/helpers/elements_helper_spec.rb +4 -4
  53. data/spec/models/language_spec.rb +2 -2
  54. data/spec/models/page_spec.rb +2 -2
  55. data/spec/spec_helper.rb +1 -2
  56. metadata +36 -38
@@ -1,5 +1,6 @@
1
1
  module Alchemy
2
2
  class FoldedPage < ActiveRecord::Base
3
3
  belongs_to :page
4
+ belongs_to :user
4
5
  end
5
6
  end
@@ -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 Contactform Fields.
2
- # You can specify the fields for your contactform in the +config/alchemy/config.yml+ file in the +:mailer+ options
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[0], :message => '^' + I18n.t(field[1][:message].to_s, :scope => [:contactform, :validations])
35
- if field[0].to_s.include?('email')
36
- validates_format_of field[0], :with => ::Authlogic::Regex.email, :message => '^' + I18n.t(:wrong_email_format, :scope => [:contactform, :validations]), :if => :email_is_filled
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
 
@@ -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, :message => '^' + I18n.t("please enter a name")
17
- validates_presence_of :page_layout, :message => '^' + I18n.t("Please choose a page layout."), :unless => :systempage?
18
- validates_presence_of :parent_id, :message => '^' + I18n.t("No parent page was given."), :if => proc { Page.count > 1 }
19
- validates_length_of :urlname, :minimum => 3, :too_short => I18n.t("urlname_to_short"), :if => :urlname_entered?
20
- validates_uniqueness_of :urlname, :message => '^' + I18n.t("URL-Name already token"), :scope => [:language_id, :layoutpage], :if => :urlname_entered?
21
- validates :urlname, :exclusion => {:in => RESERVED_URLNAMES, :message => '^' + I18n.t("This urlname is reserved.")}
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
- before_save :set_url_name, :unless => proc { |page| page.systempage? || page.redirects_to_external? }
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? }
@@ -15,6 +15,14 @@ module Alchemy
15
15
  end
16
16
  end
17
17
 
18
+ attr_accessible(
19
+ :image_file,
20
+ :image_filename,
21
+ :image_height,
22
+ :image_width,
23
+ :name
24
+ )
25
+
18
26
  stampable
19
27
 
20
28
  def self.find_paginated(params, per_page)
@@ -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
  &raquo; <%= t('Redirects to') %>:
95
95
  <%= h page.urlname %>
96
96
  </span>
@@ -2,6 +2,6 @@
2
2
  alchemy.zoom_picture_path(
3
3
  :id => @picture.id,
4
4
  :name => @picture.urlname,
5
- :format => (Alchemy::Config.get(:image_output_format) or 'png')
5
+ :format => :png
6
6
  )
7
7
  ) %>
@@ -0,0 +1,3 @@
1
+ @picture.operate do |image|
2
+ image
3
+ end
@@ -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: [Hash] # A Hash with fieldname as key and a Hash (with :message as key and a message_id as value) as value
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 message_id is passed through Alchemy::I18n.t so you can translate it in your language yml file.
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
- # alchemy:
95
- # contactform:
96
- # validations:
97
- # enter_name: 'Bitte geben Sie einen Namen an'
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:
@@ -1,5 +1,5 @@
1
1
  module Alchemy
2
2
 
3
- VERSION = "2.2.rc3"
3
+ VERSION = "2.2.rc6"
4
4
 
5
5
  end
@@ -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/alchemy/pages.html.erb"
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 raise a RoutingError that is in turn handled by rails (as 404 status)" do
125
- expect {
126
- get :show, {:level1 => 'catalog', :level2 => 'faqs', :urlname => 'screwdriver'}
127
- }.to raise_error(ActionController::RoutingError)
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 raise a RoutingError (that is handled by rails, see integration specs)" do
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
- expect {
138
- get :show, {:urlname => 'doesntexist'}
139
- }.to raise_error(ActionController::RoutingError)
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