refinerycms 0.9.8.5 → 0.9.8.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. data/Gemfile +15 -21
  2. data/bin/refinerycms +9 -12
  3. data/changelog.md +164 -154
  4. data/db/migrate/20100913234704_create_refinery_schema.rb +151 -0
  5. data/db/migrate/20100926142529_add_value_type_to_refinery_settings.rb +9 -0
  6. data/db/migrate/20100929035252_add_missing_indexes_to_roles_users.rb +11 -0
  7. data/db/schema.rb +5 -1
  8. data/db/seeds/pages.rb +0 -39
  9. data/db/seeds/pages_for_inquiries.rb +40 -0
  10. data/vendor/refinerycms/authentication/app/models/roles_users.rb +6 -0
  11. data/vendor/refinerycms/authentication/features/lost_password.feature +1 -0
  12. data/vendor/refinerycms/authentication/features/manage_users.feature +1 -1
  13. data/vendor/refinerycms/authentication/features/step_definitions/lost_password.rb +2 -2
  14. data/vendor/refinerycms/authentication/features/support/factories.rb +1 -0
  15. data/vendor/refinerycms/authentication/spec/models/user_spec.rb +52 -0
  16. data/vendor/refinerycms/core/app/views/admin/_head.html.erb +1 -4
  17. data/vendor/refinerycms/core/app/views/shared/_menu.html.erb +11 -5
  18. data/vendor/refinerycms/core/app/views/shared/_menu_branch.html.erb +8 -8
  19. data/vendor/refinerycms/core/app/views/shared/admin/_make_sortable.html.erb +3 -2
  20. data/vendor/refinerycms/core/app/views/shared/admin/_sortable_list.html.erb +2 -3
  21. data/vendor/refinerycms/core/lib/core.rb +5 -5
  22. data/vendor/refinerycms/core/lib/generators/refinery_engine/refinery_engine_generator.rb +2 -2
  23. data/vendor/refinerycms/core/lib/generators/refinery_engine/templates/app/views/admin/plural_name/index.html.erb +11 -9
  24. data/vendor/refinerycms/core/lib/generators/refinery_engine/templates/db/seeds/plural_name.rb +1 -1
  25. data/vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib/generators/refinerycms_plural_name_generator.rb +3 -3
  26. data/vendor/refinerycms/core/lib/generators/refinery_engine/templates/lib/plural_name.rb +1 -1
  27. data/vendor/refinerycms/core/lib/refinery/crud.rb +48 -28
  28. data/vendor/refinerycms/core/lib/refinery/helpers/menu_helper.rb +34 -4
  29. data/vendor/refinerycms/core/lib/refinery/plugin.rb +5 -5
  30. data/vendor/refinerycms/core/public/javascripts/rails.js +152 -0
  31. data/vendor/refinerycms/core/public/javascripts/refinery/admin.js +33 -13
  32. data/vendor/refinerycms/core/public/javascripts/wymeditor/jquery.refinery.wymeditor.js +191 -175
  33. data/vendor/refinerycms/core/public/stylesheets/refinery/refinery.css +80 -12
  34. data/vendor/refinerycms/dashboard/features/dashboard.feature +3 -1
  35. data/vendor/refinerycms/images/features/support/factories.rb +5 -0
  36. data/vendor/refinerycms/images/lib/images.rb +7 -35
  37. data/vendor/refinerycms/images/spec/models/image_spec.rb +50 -0
  38. data/vendor/refinerycms/images/spec/uploads/beach.jpeg +0 -0
  39. data/vendor/refinerycms/pages/features/manage_pages.feature +1 -1
  40. data/vendor/refinerycms/pages/features/step_definitions/page_steps.rb +19 -3
  41. data/vendor/refinerycms/pages/features/support/paths.rb +9 -1
  42. data/vendor/refinerycms/pages/features/visit_pages.feature +45 -0
  43. data/vendor/refinerycms/pages/spec/models/page_spec.rb +134 -4
  44. data/vendor/refinerycms/refinery.rb +1 -1
  45. data/vendor/refinerycms/resources/features/manage_files.feature +5 -1
  46. data/vendor/refinerycms/resources/features/step_definitions/file_steps.rb +2 -2
  47. data/vendor/refinerycms/resources/lib/resources.rb +8 -37
  48. data/vendor/refinerycms/resources/spec/models/resource_spec.rb +45 -0
  49. data/vendor/refinerycms/resources/spec/uploads/refinery_is_awesome.txt +1 -0
  50. data/vendor/refinerycms/settings/app/models/refinery_setting.rb +26 -12
  51. data/vendor/refinerycms/settings/features/manage_refinery_settings.feature +1 -1
  52. data/vendor/refinerycms/settings/spec/models/refinery_setting_spec.rb +101 -0
  53. metadata +37 -56
  54. data/db/migrate/20091109012126_add_missing_indexes.rb +0 -25
  55. data/db/migrate/20091130040711_add_down_for_maintenance_page.rb +0 -15
  56. data/db/migrate/20091207033335_add_superuser_to_users.rb +0 -12
  57. data/db/migrate/20100114092849_add_themes_table.rb +0 -19
  58. data/db/migrate/20100125003944_rename_title_to_name_on_user_plugins.rb +0 -9
  59. data/db/migrate/20100125033146_migrate_old_plugin_titles_to_plugin_names_for_users.rb +0 -61
  60. data/db/migrate/20100127004649_add_reset_code_to_users.rb +0 -9
  61. data/db/migrate/20100202034802_remove_custom_title_image_id_and_image_id_from_pages.rb +0 -13
  62. data/db/migrate/20100204011654_change_part_titles_to_titleized_version_for_new_format.rb +0 -13
  63. data/db/migrate/20100223211536_remove_themes_table.rb +0 -17
  64. data/db/migrate/20100305023036_change_users_columns_for_authlogic.rb +0 -54
  65. data/db/migrate/20100305023037_remove_unused_users_columns.rb +0 -15
  66. data/db/migrate/20100312155331_make_user_perishable_token_nullable.rb +0 -13
  67. data/db/migrate/20100312160327_make_user_persistence_token_nullable.rb +0 -13
  68. data/db/migrate/20100315203301_remove_state_from_users.rb +0 -9
  69. data/db/migrate/20100419001048_change_image_grid_thumbnail_size_and_regenerate.rb +0 -13
  70. data/db/migrate/20100522020225_rename_permissions_for_resources_plugin_to_files.rb +0 -15
  71. data/db/migrate/20100525084518_remove_take_down_for_maintenance_page.rb +0 -19
  72. data/db/migrate/20100525110237_add_small_and_large_thumbnail_sizes.rb +0 -14
  73. data/db/migrate/20100530205942_update_link_url_on_pages_from_inquiries_new_to_contact.rb +0 -31
  74. data/db/migrate/20100605132138_convert_resource_to_dragonfly.rb +0 -41
  75. data/db/migrate/20100605132208_convert_image_to_dragonfly.rb +0 -51
  76. data/db/migrate/20100606135207_change_thumbnail_sizes_for_dragonfly.rb +0 -17
  77. data/db/migrate/20100608062447_add_scoping_to_refinery_settings.rb +0 -9
  78. data/db/migrate/20100623220402_add_restricted_to_refinery_settings.rb +0 -9
  79. data/db/migrate/20100624024501_add_roles.rb +0 -24
  80. data/db/migrate/20100629081543_add_callback_proc_as_string_to_refinery_settings.rb +0 -9
  81. data/db/migrate/20100701053151_remove_superuser_from_users.rb +0 -20
  82. data/db/migrate/20100702022630_add_spam_to_inquiries.rb +0 -11
  83. data/db/migrate/20100708014636_ensure_user_plugins_use_name_and_not_title.rb +0 -9
  84. data/db/migrate/20100729221735_remove_page_translations_if_present.rb +0 -12
  85. data/db/migrate/20100826232810_move_inquiry_settings_to_refinery_settings.rb +0 -23
  86. data/db/migrate/20100831122919_move_page_to_nested_set.rb +0 -28
  87. data/db/migrate/20100913234704_add_cached_slug_to_pages.rb +0 -12
  88. data/db/seeds/inquiry_settings.rb +0 -2
@@ -17,7 +17,7 @@ body {
17
17
  font-size: 10px;
18
18
  font-family: Verdana;
19
19
  line-height: 1.5em;
20
- background: black url('/images/refinery/page_bg.png') repeat;
20
+ background: #303030 url('/images/refinery/page_bg.png') repeat;
21
21
  }
22
22
  acronym {
23
23
  cursor: help;
@@ -43,6 +43,7 @@ label[for] {
43
43
  }
44
44
  #dialog_container #content .field, .dialog_container .field {
45
45
  width: auto;
46
+ margin:5px 0;
46
47
  }
47
48
  input.widest, textarea.widest {
48
49
  width: 99%;
@@ -231,7 +232,7 @@ body.login #site_bar_content a#site_bar_refinery_cms_logo {
231
232
  font-size: 20px;
232
233
  line-height:22px
233
234
  }
234
- body.login #page_container div.remember_me label {
235
+ body.login #page_container div.remember_me label, label.inline {
235
236
  display: inline;
236
237
  }
237
238
  body.login #page_container div.actions {
@@ -267,13 +268,13 @@ body.login label, body.login a {
267
268
  body.login #flash_container, body.login .errorExplanation {
268
269
  margin-bottom: 12px;
269
270
  }
270
- div.field.plugin_access ul#plugins li {
271
+ div.field.checkbox_access ul.checkboxes li {
271
272
  margin-top: 3px;
272
273
  }
273
- div.field.plugin_access {
274
+ div.field.checkbox_access {
274
275
  margin-top: 20px;
275
276
  }
276
- div.field.plugin_access .label_with_help a {
277
+ div.field.checkbox_access .label_with_help a {
277
278
  font-weight: normal;
278
279
  }
279
280
  /* Works in Firefox, Safari, Chrome, IE8+ */
@@ -488,6 +489,9 @@ header p {
488
489
  padding: 4px 0 0 40px;
489
490
  background: url('/images/refinery/branch.gif') no-repeat 15px 0px;
490
491
  }
492
+ #records.tree li.record ul {
493
+ margin-left: 0;
494
+ }
491
495
  #records.tree .on-hover, #pagination ul.tree a:hover, #pagination .tree .on {
492
496
  background: url('/images/refinery/branch.gif') no-repeat 15px 0px;
493
497
  }
@@ -731,18 +735,18 @@ label.stripped {
731
735
  .brown_border {
732
736
  border: 1px solid #99998B;
733
737
  }
734
- #inquiry {
738
+ #inquiry, .inquiry {
735
739
  border-collapse: collapse;
736
740
  width: 100%;
737
741
  }
738
- #inquiry td {
742
+ #inquiry td, .inquiry td {
739
743
  border-bottom: 1px solid #CCCCCC;
740
744
  padding: 7px;
741
745
  }
742
- #inquiry tr:last-child td {
746
+ #inquiry tr:last-child td, .inquiry tr:last-child td {
743
747
  border-bottom: 0px;
744
748
  }
745
- #inquiry td label.stripped {
749
+ #inquiry td label.stripped, .inquiry td label.stripped {
746
750
  font-weight: bold;
747
751
  }
748
752
  body.dialog {
@@ -786,6 +790,9 @@ body.dialog form {
786
790
  height: 300px;
787
791
  padding: 12px;
788
792
  }
793
+ .dialog #existing_image_area_content {
794
+ margin-top: 28px;
795
+ }
789
796
  .dialog #existing_image_area_content ul {
790
797
  margin: 0px;
791
798
  padding: 0px;
@@ -866,6 +873,7 @@ body.dialog form {
866
873
  }
867
874
  #dialog_main #pages_list {
868
875
  width: 100%;
876
+ padding-bottom: 40px;
869
877
  }
870
878
  #dialog_main #pages_list ul {
871
879
  margin: 0px 12px 0px 12px;
@@ -1106,6 +1114,11 @@ a#toggle_advanced_options:hover {
1106
1114
  #content .form-actions .form-actions-right, .wym_dialog .form-actions .form-actions-right, .ui-dialog .form-actions .form-actions-right {
1107
1115
  right: 10px;
1108
1116
  }
1117
+ #content .form-actions .save-loader {
1118
+ position: absolute;
1119
+ right: -24px;
1120
+ top: 4px;
1121
+ }
1109
1122
  .wym_dialog .form-actions, .ui-dialog .form-actions {
1110
1123
  border: 0px none;
1111
1124
  border-top: 1px solid #E8E8E8;
@@ -1126,6 +1139,12 @@ a#toggle_advanced_options:hover {
1126
1139
  #dialog_container.dialog.iframed #content .form-actions {
1127
1140
  position: fixed;
1128
1141
  }
1142
+ body.dialog #content .search_form {
1143
+ float: right;
1144
+ width: auto !important;
1145
+ min-width: 300px;
1146
+ margin-bottom: 0px;
1147
+ }
1129
1148
  #existing_image_area {
1130
1149
  padding-top:6px;
1131
1150
  }
@@ -1178,11 +1197,19 @@ ul#image_grid li p {
1178
1197
  ul#image_grid li span.actions {
1179
1198
  width: 100%;
1180
1199
  }
1181
- ul#plugins {
1200
+ #content form.edit_image {
1201
+ width: 70%;
1202
+ float: left;
1203
+ }
1204
+ #content #existing_image {
1205
+ float: right;
1206
+ width: 25%;
1207
+ }
1208
+ ul.checkboxes {
1182
1209
  margin: 0px;
1183
1210
  padding: 0px;
1184
1211
  }
1185
- ul#plugins li {
1212
+ ul.checkboxes li {
1186
1213
  list-style: none;
1187
1214
  }
1188
1215
  .label_inline_with_link label {
@@ -1198,7 +1225,7 @@ ul#plugins li {
1198
1225
  .label_inline_with_link a img {
1199
1226
  vertical-align: middle;
1200
1227
  }
1201
- #remove_picked_image {
1228
+ .remove_picked_image {
1202
1229
  margin-top:8px;
1203
1230
  display:inline-block;
1204
1231
  width:auto;
@@ -1378,6 +1405,12 @@ input.button.close_dialog:active, a.button.close_dialog:active, #content a.butto
1378
1405
 
1379
1406
  #other_locales li:first-child {
1380
1407
  margin-top: 0px;
1408
+ }
1409
+
1410
+ /* dubiously in here */
1411
+ .current_image_link {
1412
+ display: inline-block;
1413
+ width: auto;
1381
1414
  }
1382
1415
 
1383
1416
  /* cornering */
@@ -1430,3 +1463,38 @@ input.button.close_dialog:active, a.button.close_dialog:active, #content a.butto
1430
1463
  -moz-border-radius: 6px;
1431
1464
  -webkit-border-radius: 6px;
1432
1465
  }
1466
+
1467
+ /* Internet Explorer to follow: */
1468
+ /* IE 7 */
1469
+ .ie7 #content .form-actions .form-actions-left a.button {
1470
+ height: 19px;
1471
+ line-height: 19px;
1472
+ padding-top: 3px;
1473
+ padding-bottom: 3px;
1474
+ }
1475
+ .ie7 .search_form input.button {
1476
+ padding-left: 8px;
1477
+ padding-right: 8px;
1478
+ }
1479
+ .ie7 body.login .field input.larger, .ie7 body.login .field input.larger:focus {
1480
+ background-image: none !important;
1481
+ padding: 0px;
1482
+ line-height: 30px;
1483
+ }
1484
+ .ie7 .pagination a, .ie7 #content .pagination a, .ie7 .pagination .current, .ie7 .disabled, .ie7 .pagination em {
1485
+ padding-bottom: 6px;
1486
+ }
1487
+ .ie7 .pt-BR #search {
1488
+ width: 177px;
1489
+ }
1490
+ .ie7 .en #search {
1491
+ width: 200px;
1492
+ }
1493
+
1494
+ /* IE 8 */
1495
+ .ie8 body.login .field input.larger, .ie8 body.login .field input.larger:focus {
1496
+ line-height: 30px;
1497
+ }
1498
+ .ie8 .pagination a, .ie8 #content .pagination a, .ie8 .pagination .current, .ie8 .disabled, .ie8 .pagination em {
1499
+ padding-bottom: 6px;
1500
+ }
@@ -1,4 +1,4 @@
1
- @dashboard
1
+ @refinerycms @dashboard
2
2
  Feature: Dashboard
3
3
  In order to see recent changes to my website
4
4
  As an administrator
@@ -35,10 +35,12 @@ Feature: Dashboard
35
35
  When I follow "See home page"
36
36
  Then I should be on the home page
37
37
 
38
+ @i18n
38
39
  Scenario: Translation options available
39
40
  When I go to the Dashboard
40
41
  Then I should see "English Change Language"
41
42
 
43
+ @i18n
42
44
  Scenario: Change Language to Slovenian and back to English
43
45
  When I go to the dashboard
44
46
  And I follow "English Change Language"
@@ -0,0 +1,5 @@
1
+ require 'factory_girl'
2
+
3
+ Factory.define :image do |i|
4
+ i.image File.new(File.expand_path('../../uploads/beach.jpeg', __FILE__))
5
+ end
@@ -5,32 +5,9 @@ require 'refinery'
5
5
  module Refinery
6
6
  module Images
7
7
  class Engine < Rails::Engine
8
- initializer 'fix-tempfile-not-closing-with-dragonfly-images' do |app|
9
- # see http://github.com/markevans/dragonfly/issues#issue/18/comment/415807
10
- require 'tempfile'
11
- class Tempfile
12
-
13
- def unlink
14
- # keep this order for thread safeness
15
- begin
16
- if File.exist?(@tmpname)
17
- closed? or close
18
- File.unlink(@tmpname)
19
- end
20
- @@cleanlist.delete(@tmpname)
21
- @data = @tmpname = nil
22
- ObjectSpace.undefine_finalizer(self)
23
- rescue Errno::EACCES
24
- # may not be able to unlink on Windows; just ignore
25
- end
26
- end
27
-
28
- end
29
- end
30
-
31
8
  initializer 'images-with-dragonfly' do |app|
32
9
  app_images = Dragonfly[:images]
33
- app_images.configure_with(:rmagick)
10
+ app_images.configure_with(:imagemagick)
34
11
  app_images.configure_with(:rails) do |c|
35
12
  c.datastore.root_path = Rails.root.join('public', 'system', 'images').to_s
36
13
  c.url_path_prefix = '/system/images'
@@ -42,23 +19,18 @@ module Refinery
42
19
  app_images.configure_with(:heroku, ENV['S3_BUCKET']) if Refinery.s3_backend
43
20
 
44
21
  app_images.define_macro(ActiveRecord::Base, :image_accessor)
45
- app_images.analyser.register(Dragonfly::Analysis::RMagickAnalyser)
22
+ app_images.analyser.register(Dragonfly::Analysis::ImageMagickAnalyser)
46
23
  app_images.analyser.register(Dragonfly::Analysis::FileCommandAnalyser)
47
24
 
48
- # This little eval makes it so that dragonfly urls work in traditional
25
+ # This url_suffix makes it so that dragonfly urls work in traditional
49
26
  # situations where the filename and extension are required, e.g. lightbox.
50
27
  # What this does is takes the url that is about to be produced e.g.
51
28
  # /system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw
52
29
  # and adds the filename onto the end (say the image was 'refinery_is_awesome.jpg')
53
30
  # /system/images/BAhbB1sHOgZmIiMyMDEwLzA5LzAxL1NTQ19DbGllbnRfQ29uZi5qcGdbCDoGcDoKdGh1bWIiDjk0MngzNjAjYw/refinery_is_awesome.jpg
54
- app_images.instance_eval %{
55
- def url_for(job, *args)
56
- image_url = nil
57
- if (fetcher = job.steps.detect{|s| s.class.step_name == :fetch}).present?
58
- image_url = ['', fetcher.uid.to_s.split('/').last].join('/')
59
- end
60
- "\#{super}\#{image_url}"
61
- end
31
+ # Officially the way to do it, from: http://markevans.github.com/dragonfly/file.URLs.html
32
+ app_images.url_suffix = proc{|job|
33
+ "/#{job.uid_basename}#{job.encoded_extname || job.uid_extname}"
62
34
  }
63
35
 
64
36
  ### Extend active record ###
@@ -66,7 +38,7 @@ module Refinery
66
38
  app.config.middleware.insert_after 'Rack::Lock', 'Dragonfly::Middleware', :images, '/system/images'
67
39
 
68
40
  app.config.middleware.insert_before 'Dragonfly::Middleware', 'Rack::Cache', {
69
- :verbose => true,
41
+ :verbose => Rails.env.development?,
70
42
  :metastore => "file:#{Rails.root.join('tmp', 'dragonfly', 'cache', 'meta')}",
71
43
  :entitystore => "file:#{Rails.root.join('tmp', 'dragonfly', 'cache', 'body')}"
72
44
  }
@@ -0,0 +1,50 @@
1
+ require 'spec_helper'
2
+
3
+ describe Image do
4
+
5
+ def reset_image(options = {})
6
+ @valid_attributes = {
7
+ :id => 1,
8
+ :image => File.new(File.expand_path('../../uploads/beach.jpeg', __FILE__))
9
+ }.merge(options)
10
+
11
+ @image.destroy if @image
12
+ @image = Image.create!(@valid_attributes)
13
+ end
14
+
15
+ def image_can_be_destroyed
16
+ @image.destroy.should == true
17
+ end
18
+
19
+ before(:each) do
20
+ reset_image
21
+ end
22
+
23
+ context "with valid attributes" do
24
+ it "should create successfully" do
25
+ @image.errors.empty?
26
+ end
27
+ end
28
+
29
+ context "image url" do
30
+ it "should respond to .thumbnail" do
31
+ @image.respond_to?(:thumbnail).should == true
32
+ end
33
+
34
+ it "should contain its filename at the end" do
35
+ @image.thumbnail(nil).url.should =~ %r{#{@image.image_uid.split('/').last}$}
36
+ end
37
+
38
+ it "should be different when supplying geometry" do
39
+ @image.thumbnail(nil).url.should_not == @image.thumbnail('200x200').url
40
+ end
41
+
42
+ it "should have different urls for each geometry string" do
43
+ @image.thumbnail('200x200').url.should_not == @image.thumbnail('200x201').url
44
+ end
45
+
46
+ end
47
+
48
+
49
+ end
50
+
@@ -1,4 +1,4 @@
1
- @pages @pages-manage
1
+ @refinerycms @pages @pages-manage
2
2
  Feature: Manage Pages
3
3
  In order to control the content on my website
4
4
  As an administrator
@@ -1,11 +1,15 @@
1
- Given /^I (only )?have a page titled "([^"]*)" with a custom url "([^"]*)"?$/ do |only, title, link_url|
1
+ Given /^I (only )?have a page titled "?([^\"]*)"? with a custom url "?([^\"]*)"?$/ do |only, title, link_url|
2
2
  Page.delete_all if only
3
3
 
4
4
  Page.create(:title => title,
5
5
  :link_url => link_url)
6
6
  end
7
7
 
8
- Given /^I (only )?have pages titled "?([^"]*)"?$/ do |only, titles|
8
+ Given /^the page titled "?([^\"]*)"? has a menu match "?([^\"]*)"?$/ do |title, menu_match|
9
+ Page.find_by_title(title).update_attribute(:menu_match, menu_match)
10
+ end
11
+
12
+ Given /^I (only )?have pages titled "?([^\"]*)"?$/ do |only, titles|
9
13
  Page.delete_all if only
10
14
  titles.split(', ').each do |title|
11
15
  Page.create(:title => title)
@@ -16,7 +20,7 @@ Given /^I have no pages$/ do
16
20
  Page.delete_all
17
21
  end
18
22
 
19
- Given /^I (only )?have a page titled "([^"]*)"$/ do |only, title|
23
+ Given /^I (only )?have a page titled "?([^\"]*)"?$/ do |only, title|
20
24
  Page.delete_all if only
21
25
  PagePart.delete_all if only
22
26
  page = Page.create(:title => title)
@@ -24,6 +28,18 @@ Given /^I (only )?have a page titled "([^"]*)"$/ do |only, title|
24
28
  page
25
29
  end
26
30
 
31
+ Given /^the page titled "?([^\"]*)"? is a child of "?([^\"]*)"?$/ do |title, parent_title|
32
+ Page.find_by_title(title).update_attribute(:parent, Page.find_by_title(parent_title))
33
+ end
34
+
35
+ Given /^the page titled "?([^\"]*)"? is not shown in the menu$/ do |title|
36
+ Page.find_by_title(title).update_attribute(:show_in_menu, false)
37
+ end
38
+
39
+ Given /^the page titled "?([^\"]*)"? is draft$/ do |title|
40
+ Page.find_by_title(title).update_attribute(:draft, true)
41
+ end
42
+
27
43
  Then /^I should have ([0-9]+) pages?$/ do |count|
28
44
  Page.count.should == count.to_i
29
45
  end
@@ -10,7 +10,15 @@ module NavigationHelpers
10
10
  when /the new page form/
11
11
  new_admin_page_path
12
12
  else
13
- nil
13
+ begin
14
+ if page_name =~ /the page titled "?([^\"]*)"?/ and (page = Page.find_by_title($1)).present?
15
+ self.url_for(page.url)
16
+ else
17
+ nil
18
+ end
19
+ rescue
20
+ nil
21
+ end
14
22
  end
15
23
  end
16
24
  end
@@ -0,0 +1,45 @@
1
+ @refinerycms @pages @pages-visit @visit-pages
2
+ Feature: Visit Pages
3
+ In order to view the content on this website
4
+ As a visitor
5
+ I want to view pages
6
+
7
+ Background:
8
+ Given A Refinery user exists
9
+ And I have a page titled "Home" with a custom url "/"
10
+ And I have a page titled "About"
11
+ And I have a page titled "ä ö ü spéciål chåråctÉrs"
12
+ And I have a page titled "Hidden"
13
+ And the page titled "Hidden" is a child of Home
14
+ And the page titled "Hidden" is not shown in the menu
15
+
16
+ Scenario: Home Page
17
+ When I go to the home page
18
+ Then I should see "Home"
19
+ And I should see "About"
20
+ And I should see "Home" within ".selected"
21
+
22
+ Scenario: Content Page
23
+ When I go to the page titled "About"
24
+ Then I should see "Home"
25
+ And I should see "About"
26
+ And I should see "About" within ".selected > a"
27
+
28
+ Scenario: Special Characters Title
29
+ When I go to the page titled "ä ö ü spéciål chåråctÉrs"
30
+ Then I should see "Home"
31
+ And I should see "About"
32
+ And I should see "ä ö ü spéciål chåråctÉrs"
33
+
34
+ Scenario: Special Characters Title as submenu page
35
+ Given the page titled "ä ö ü spéciål chåråctÉrs" is a child of About
36
+ When I go to the page titled "ä ö ü spéciål chåråctÉrs"
37
+ Then I should see "Home"
38
+ And I should see "About"
39
+ And I should see "ä ö ü spéciål chåråctÉrs"
40
+
41
+ Scenario: Hidden Page
42
+ When I go to the page titled "Hidden"
43
+ Then I should see "Home"
44
+ And I should see "About"
45
+ And I should see "Home" within ".selected > a"