cms-lite 0.3.3 → 0.4.0
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 +5 -0
- data/{README.markdown → README.rdoc} +18 -30
- data/Rakefile +20 -3
- data/VERSION +1 -1
- data/app/controllers/cms_lite_controller.rb +10 -7
- data/cms-lite.gemspec +305 -8
- data/lib/cms_lite.rb +48 -35
- data/rails/init.rb +21 -1
- data/test/rails_root/.gitignore +8 -0
- data/test/rails_root/.rake_tasks +103 -0
- data/test/rails_root/Capfile +3 -0
- data/test/rails_root/Rakefile +14 -0
- data/test/rails_root/app/controllers/application_controller.rb +22 -0
- data/test/rails_root/app/models/.keep +0 -0
- data/test/rails_root/app/models/user.rb +10 -0
- data/test/rails_root/app/models/user_session.rb +2 -0
- data/test/rails_root/app/views/layouts/default.html.erb +26 -0
- data/test/rails_root/app/views/layouts/test.html.erb +26 -0
- data/test/rails_root/config/amazon_s3.yml +14 -0
- data/test/rails_root/config/boot.rb +109 -0
- data/test/rails_root/config/database.yml +14 -0
- data/test/rails_root/config/environment.rb +27 -0
- data/test/rails_root/config/environments/development.rb +19 -0
- data/test/rails_root/config/environments/production.rb +1 -0
- data/test/rails_root/config/environments/test.rb +33 -0
- data/test/rails_root/config/global_config.yml +20 -0
- data/test/rails_root/config/initializers/cms_lite.rb +4 -0
- data/test/rails_root/config/initializers/inflections.rb +10 -0
- data/test/rails_root/config/initializers/mime_types.rb +5 -0
- data/test/rails_root/config/initializers/requires.rb +13 -0
- data/test/rails_root/config/initializers/session_store.rb +8 -0
- data/test/rails_root/config/routes.rb +9 -0
- data/test/rails_root/content/pages/en/demo/hi.html.erb +1 -0
- data/test/rails_root/content/pages/en/open/hello.html.erb +1 -0
- data/test/rails_root/content/protected-pages/en/demo/hi.html.erb +1 -0
- data/test/rails_root/content/protected-pages/en/protected/safe-hello.html.erb +1 -0
- data/test/rails_root/db/.keep +0 -0
- data/test/rails_root/db/migrate/20090320174818_create_muck_permissions_and_roles.rb +16 -0
- data/test/rails_root/db/migrate/20090402234137_create_languages.rb +18 -0
- data/test/rails_root/db/migrate/20090426041056_create_countries.rb +15 -0
- data/test/rails_root/db/migrate/20090426041103_create_states.rb +18 -0
- data/test/rails_root/db/migrate/20090530170040_create_themes.rb +11 -0
- data/test/rails_root/db/migrate/20090602041838_create_users.rb +39 -0
- data/test/rails_root/db/migrate/20090606153236_create_domain_themes.rb +13 -0
- data/test/rails_root/features/step_definitions/cms_steps.rb +19 -0
- data/test/rails_root/features/step_definitions/common_steps.rb +86 -0
- data/test/rails_root/features/step_definitions/webrat_steps.rb +109 -0
- data/test/rails_root/features/support/env.rb +16 -0
- data/test/rails_root/features/view_cms_pages.feature +36 -0
- data/test/rails_root/lib/tasks/cucumber.rake +7 -0
- data/test/rails_root/public/.htaccess +40 -0
- data/test/rails_root/public/404.html +30 -0
- data/test/rails_root/public/422.html +30 -0
- data/test/rails_root/public/500.html +30 -0
- data/test/rails_root/public/dispatch.rb +10 -0
- data/test/rails_root/public/favicon.ico +0 -0
- data/test/rails_root/public/images/arrow_left.gif +0 -0
- data/test/rails_root/public/images/arrow_right.gif +0 -0
- data/test/rails_root/public/images/blue/preview.gif +0 -0
- data/test/rails_root/public/images/fancybox/fancy_closebox.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_left.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_progress.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_right.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_e.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_n.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_ne.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_nw.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_s.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_se.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_sw.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_w.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_title_left.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_title_main.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_title_right.png +0 -0
- data/test/rails_root/public/images/icons/accept.png +0 -0
- data/test/rails_root/public/images/icons/add.png +0 -0
- data/test/rails_root/public/images/icons/delete.png +0 -0
- data/test/rails_root/public/images/icons/vote.png +0 -0
- data/test/rails_root/public/images/kjh/preview.gif +0 -0
- data/test/rails_root/public/images/kjy/preview.gif +0 -0
- data/test/rails_root/public/images/loading.gif +0 -0
- data/test/rails_root/public/images/profile_default.jpg +0 -0
- data/test/rails_root/public/images/rails.png +0 -0
- data/test/rails_root/public/images/red/preview.gif +0 -0
- data/test/rails_root/public/images/spinner.gif +0 -0
- data/test/rails_root/public/images/sprites.png +0 -0
- data/test/rails_root/public/javascripts/application.js +2 -0
- data/test/rails_root/public/javascripts/builder.js +136 -0
- data/test/rails_root/public/javascripts/controls.js +963 -0
- data/test/rails_root/public/javascripts/dragdrop.js +972 -0
- data/test/rails_root/public/javascripts/effects.js +1120 -0
- data/test/rails_root/public/javascripts/fancyzoom.min.js +1 -0
- data/test/rails_root/public/javascripts/jquery/jquery-ui.js +273 -0
- data/test/rails_root/public/javascripts/jquery/jquery.easing.js +1 -0
- data/test/rails_root/public/javascripts/jquery/jquery.fancybox.js +9 -0
- data/test/rails_root/public/javascripts/jquery/jquery.form.js +637 -0
- data/test/rails_root/public/javascripts/jquery/jquery.jgrowl.js +2 -0
- data/test/rails_root/public/javascripts/jquery/jquery.js +19 -0
- data/test/rails_root/public/javascripts/jquery/jquery.tips.js +69 -0
- data/test/rails_root/public/javascripts/muck.js +80 -0
- data/test/rails_root/public/javascripts/prototype.js +4225 -0
- data/test/rails_root/public/javascripts/scriptaculous.js +58 -0
- data/test/rails_root/public/javascripts/slider.js +277 -0
- data/test/rails_root/public/javascripts/sound.js +60 -0
- data/test/rails_root/public/robots.txt +1 -0
- data/test/rails_root/public/stylesheets/.keep +0 -0
- data/test/rails_root/public/stylesheets/admin.css +12 -0
- data/test/rails_root/public/stylesheets/blue.css +1 -0
- data/test/rails_root/public/stylesheets/blueprint/ie.css +26 -0
- data/test/rails_root/public/stylesheets/blueprint/liquid_screen.css +203 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/buttons/icons/cross.png +0 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/buttons/icons/key.png +0 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/buttons/icons/tick.png +0 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/buttons/readme.txt +32 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/buttons/screen.css +97 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/fancy-type/readme.txt +14 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/fancy-type/screen.css +71 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/icons/doc.png +0 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/icons/email.png +0 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/icons/external.png +0 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/icons/feed.png +0 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/icons/im.png +0 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/icons/pdf.png +0 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/icons/visited.png +0 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/icons/xls.png +0 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/readme.txt +18 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/link-icons/screen.css +40 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/liquid/liquid.css +134 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/liquid/src/liquid.css +197 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/rtl/readme.txt +10 -0
- data/test/rails_root/public/stylesheets/blueprint/plugins/rtl/screen.css +109 -0
- data/test/rails_root/public/stylesheets/blueprint/print.css +30 -0
- data/test/rails_root/public/stylesheets/blueprint/screen.css +251 -0
- data/test/rails_root/public/stylesheets/blueprint/sprite.css +1 -0
- data/test/rails_root/public/stylesheets/blueprint/src/forms.css +49 -0
- data/test/rails_root/public/stylesheets/blueprint/src/grid.css +213 -0
- data/test/rails_root/public/stylesheets/blueprint/src/grid.png +0 -0
- data/test/rails_root/public/stylesheets/blueprint/src/ie.css +59 -0
- data/test/rails_root/public/stylesheets/blueprint/src/print.css +85 -0
- data/test/rails_root/public/stylesheets/blueprint/src/reset.css +38 -0
- data/test/rails_root/public/stylesheets/blueprint/src/typography.css +105 -0
- data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_diagonals-small_0_aaaaaa_40x40.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_diagonals-thick_15_444444_40x40.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_glass_100_f0f0f0_1x400.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_glass_50_99c2ff_1x400.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_glass_55_fbf5d0_1x400.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_glass_80_e6e6e6_1x400.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_highlight-hard_100_f9f9f9_1x100.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-bg_highlight-soft_100_e7eef3_1x100.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-icons_222222_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-icons_2694e8_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-icons_2e83ff_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-icons_72a7cf_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-icons_888888_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/cupertino/images/ui-icons_ffffff_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/cupertino/jquery-ui-1.7.1.custom.css +404 -0
- data/test/rails_root/public/stylesheets/jquery/jquery.fancybox.css +44 -0
- data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-icons_217bc0_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-icons_2e83ff_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-icons_469bdd_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-icons_6da8d5_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-icons_d8e7f3_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/redmond/images/ui-icons_f9bd01_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/redmond/jquery-ui-1.7.1.custom.css +404 -0
- data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/smoothness/jquery-ui-1.7.1.custom.css +404 -0
- data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/test/rails_root/public/stylesheets/jquery/ui-lightness/jquery-ui-1.7.1.custom.css +404 -0
- data/test/rails_root/public/stylesheets/kjh.css +1 -0
- data/test/rails_root/public/stylesheets/kjy.css +1 -0
- data/test/rails_root/public/stylesheets/red.css +1 -0
- data/test/rails_root/public/stylesheets/reset.css +0 -0
- data/test/rails_root/public/stylesheets/styles.css +83 -0
- data/test/rails_root/public/stylesheets/themes/blue/styles.css +1 -0
- data/test/rails_root/public/stylesheets/themes/red/styles.css +1 -0
- data/test/rails_root/script/about +3 -0
- data/test/rails_root/script/breakpointer +3 -0
- data/test/rails_root/script/console +3 -0
- data/test/rails_root/script/create_project.rb +52 -0
- data/test/rails_root/script/cucumber +7 -0
- data/test/rails_root/script/dbconsole +3 -0
- data/test/rails_root/script/destroy +3 -0
- data/test/rails_root/script/generate +3 -0
- data/test/rails_root/script/performance/benchmarker +3 -0
- data/test/rails_root/script/performance/profiler +3 -0
- data/test/rails_root/script/performance/request +3 -0
- data/test/rails_root/script/plugin +3 -0
- data/test/rails_root/script/process/inspector +3 -0
- data/test/rails_root/script/process/reaper +3 -0
- data/test/rails_root/script/process/spawner +3 -0
- data/test/rails_root/script/runner +3 -0
- data/test/rails_root/script/server +3 -0
- data/test/rails_root/test/factories.rb +45 -0
- data/test/rails_root/test/functional/.keep +0 -0
- data/test/rails_root/test/functional/cms_lite_controller_test.rb +35 -0
- data/test/rails_root/test/mocks/development/.keep +0 -0
- data/test/rails_root/test/mocks/test/.keep +0 -0
- data/test/rails_root/test/shoulda_macros/controller.rb +62 -0
- data/test/rails_root/test/shoulda_macros/models.rb +50 -0
- data/test/rails_root/test/test_helper.rb +38 -0
- data/test/rails_root/test/unit/.keep +0 -0
- data/test/rails_root/test/unit/cms_lite_test.rb +84 -0
- data/test/rails_root/themes/blue/content/pages/en/blue/blue.html.erb +1 -0
- data/test/rails_root/themes/blue/content/pages/en/open/blue.html.erb +1 -0
- data/test/rails_root/themes/blue/description.txt +1 -0
- data/test/rails_root/themes/blue/locales/en.yml +2 -0
- data/test/rails_root/themes/blue/views/layouts/default.html.erb +17 -0
- data/test/rails_root/themes/blue/views/layouts/global/_footer.html.erb +3 -0
- data/test/rails_root/themes/blue/views/layouts/global/_head.html.erb +8 -0
- data/test/rails_root/themes/blue/views/layouts/global/_header.html.erb +3 -0
- data/test/rails_root/themes/red/content/protected-pages/en/red/red.html.erb +1 -0
- data/test/rails_root/themes/red/description.txt +1 -0
- data/test/rails_root/themes/red/locales/en.yml +2 -0
- data/test/rails_root/themes/red/views/layouts/default.html.erb +17 -0
- data/test/rails_root/themes/red/views/layouts/global/_footer.html.erb +3 -0
- data/test/rails_root/themes/red/views/layouts/global/_head.html.erb +8 -0
- data/test/rails_root/themes/red/views/layouts/global/_header.html.erb +3 -0
- data/test/rails_root/vendor/plugins/ssl_requirement/README +43 -0
- data/test/rails_root/vendor/plugins/ssl_requirement/lib/ssl_requirement.rb +62 -0
- data/test/rails_root/vendor/plugins/ssl_requirement/test/ssl_requirement_test.rb +132 -0
- data/test/rails_root/vendor/plugins/validation_reflection/CHANGELOG +24 -0
- data/test/rails_root/vendor/plugins/validation_reflection/LICENSE +20 -0
- data/test/rails_root/vendor/plugins/validation_reflection/README +64 -0
- data/test/rails_root/vendor/plugins/validation_reflection/Rakefile +22 -0
- data/test/rails_root/vendor/plugins/validation_reflection/about.yml +7 -0
- data/test/rails_root/vendor/plugins/validation_reflection/init.rb +8 -0
- data/test/rails_root/vendor/plugins/validation_reflection/lib/boiler_plate/validation_reflection.rb +129 -0
- data/test/rails_root/vendor/plugins/validation_reflection/test/test_helper.rb +36 -0
- data/test/rails_root/vendor/plugins/validation_reflection/test/validation_reflection_test.rb +126 -0
- metadata +313 -10
- data/test/cms_lite_test.rb +0 -8
- data/test/test_helper.rb +0 -3
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
|
|
2
|
+
|
|
3
|
+
require File.join(File.dirname(__FILE__), 'boot')
|
|
4
|
+
|
|
5
|
+
# Load a global constant so the initializers can use them
|
|
6
|
+
require 'ostruct'
|
|
7
|
+
require 'yaml'
|
|
8
|
+
::GlobalConfig = OpenStruct.new(YAML.load_file("#{RAILS_ROOT}/config/global_config.yml")[RAILS_ENV])
|
|
9
|
+
|
|
10
|
+
class TestGemLocator < Rails::Plugin::Locator
|
|
11
|
+
def plugins
|
|
12
|
+
Rails::Plugin.new(File.join(File.dirname(__FILE__), *%w(.. .. ..)))
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
Rails::Initializer.run do |config|
|
|
17
|
+
config.time_zone = 'UTC'
|
|
18
|
+
config.gem 'mislav-will_paginate', :lib => 'will_paginate', :source => 'http://gems.github.com'
|
|
19
|
+
config.gem "binarylogic-authlogic", :lib => 'authlogic', :source => 'http://gems.github.com', :version => ">=2.1.0"
|
|
20
|
+
config.gem "binarylogic-searchlogic", :lib => 'searchlogic', :source => 'http://gems.github.com', :version => '~> 2.1.1'
|
|
21
|
+
config.gem "bcrypt-ruby", :lib => "bcrypt", :version => ">=2.0.5"
|
|
22
|
+
config.gem 'disguise'
|
|
23
|
+
config.gem 'muck-engine', :lib => 'muck_engine'
|
|
24
|
+
config.gem 'muck-users', :lib => 'muck_users'
|
|
25
|
+
config.plugin_locators << TestGemLocator
|
|
26
|
+
end
|
|
27
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
|
2
|
+
|
|
3
|
+
# In the development environment your application's code is reloaded on
|
|
4
|
+
# every request. This slows down response time but is perfect for development
|
|
5
|
+
# since you don't have to restart the webserver when you make code changes.
|
|
6
|
+
config.cache_classes = false
|
|
7
|
+
|
|
8
|
+
# Log error messages when you accidentally call methods on nil.
|
|
9
|
+
config.whiny_nils = true
|
|
10
|
+
|
|
11
|
+
# Show full error reports and disable caching
|
|
12
|
+
config.action_controller.consider_all_requests_local = true
|
|
13
|
+
config.action_controller.perform_caching = false
|
|
14
|
+
config.action_view.debug_rjs = true
|
|
15
|
+
|
|
16
|
+
# Don't care if the mailer can't send
|
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
|
18
|
+
|
|
19
|
+
HOST = "localhost"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
HOST = "http://example.com"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
|
2
|
+
|
|
3
|
+
# The test environment is used exclusively to run your application's
|
|
4
|
+
# test suite. You never need to work with it otherwise. Remember that
|
|
5
|
+
# your test database is "scratch space" for the test suite and is wiped
|
|
6
|
+
# and recreated between test runs. Don't rely on the data there!
|
|
7
|
+
config.cache_classes = true
|
|
8
|
+
|
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
|
10
|
+
config.whiny_nils = true
|
|
11
|
+
|
|
12
|
+
# Show full error reports and disable caching
|
|
13
|
+
config.action_controller.consider_all_requests_local = true
|
|
14
|
+
config.action_controller.perform_caching = false
|
|
15
|
+
|
|
16
|
+
# Disable request forgery protection in test environment
|
|
17
|
+
config.action_controller.allow_forgery_protection = false
|
|
18
|
+
|
|
19
|
+
# Tell ActionMailer not to deliver emails to the real world.
|
|
20
|
+
# The :test delivery method accumulates sent emails in the
|
|
21
|
+
# ActionMailer::Base.deliveries array.
|
|
22
|
+
config.action_mailer.delivery_method = :test
|
|
23
|
+
|
|
24
|
+
HOST = "localhost"
|
|
25
|
+
|
|
26
|
+
config.gem 'thoughtbot-shoulda',
|
|
27
|
+
:lib => 'shoulda',
|
|
28
|
+
:source => "http://gems.github.com",
|
|
29
|
+
:version => '>= 2.9.1'
|
|
30
|
+
config.gem 'thoughtbot-factory_girl',
|
|
31
|
+
:lib => 'factory_girl',
|
|
32
|
+
:source => "http://gems.github.com",
|
|
33
|
+
:version => '>= 1.2.0'
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#The account plugin needs to be configured. The following values may be used to customize the account
|
|
2
|
+
|
|
3
|
+
default: &DEFAULT
|
|
4
|
+
|
|
5
|
+
application_url: localhost:3000
|
|
6
|
+
|
|
7
|
+
application_name: 'example'
|
|
8
|
+
|
|
9
|
+
# session key information
|
|
10
|
+
session_key: _test_session
|
|
11
|
+
session_secret: 882585c5d472d21e832965410ab233be541ea626e50ed0eb68a00a2f49b59073480e58599404e3dc62105a803ee42d67872e3f95eb48e2d6508b42038436abd6
|
|
12
|
+
|
|
13
|
+
production:
|
|
14
|
+
<<: *DEFAULT
|
|
15
|
+
|
|
16
|
+
development:
|
|
17
|
+
<<: *DEFAULT
|
|
18
|
+
|
|
19
|
+
test:
|
|
20
|
+
<<: *DEFAULT
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
|
2
|
+
|
|
3
|
+
# Add new inflection rules using the following format
|
|
4
|
+
# (all these examples are active by default):
|
|
5
|
+
# Inflector.inflections do |inflect|
|
|
6
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
|
7
|
+
# inflect.singular /^(ox)en/i, '\1'
|
|
8
|
+
# inflect.irregular 'person', 'people'
|
|
9
|
+
# inflect.uncountable %w( fish sheep )
|
|
10
|
+
# end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Dir[File.join(RAILS_ROOT, 'lib', 'extensions', '*.rb')].each do |f|
|
|
2
|
+
require f
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
Dir[File.join(RAILS_ROOT, 'lib', '*.rb')].each do |f|
|
|
6
|
+
require f
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
# Rails 2 doesn't like mocks
|
|
10
|
+
|
|
11
|
+
Dir[File.join(RAILS_ROOT, 'test', 'mocks', RAILS_ENV, '*.rb')].each do |f|
|
|
12
|
+
require f
|
|
13
|
+
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Your secret key for verifying cookie session data integrity.
|
|
2
|
+
# If you change this key, all old sessions will become invalid!
|
|
3
|
+
# Make sure the secret is at least 30 characters and all random,
|
|
4
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
|
5
|
+
ActionController::Base.session = {
|
|
6
|
+
:key => GlobalConfig.session_key,
|
|
7
|
+
:secret => GlobalConfig.session_secret
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
hi
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
hello world
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
hi
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
protect hello world
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
class CreateMuckPermissionsAndRoles < ActiveRecord::Migration
|
|
2
|
+
|
|
3
|
+
create_table "permissions", :force => true do |t|
|
|
4
|
+
t.integer "role_id", :null => false
|
|
5
|
+
t.integer "user_id", :null => false
|
|
6
|
+
t.datetime "created_at"
|
|
7
|
+
t.datetime "updated_at"
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
create_table "roles", :force => true do |t|
|
|
11
|
+
t.string "rolename"
|
|
12
|
+
t.datetime "created_at"
|
|
13
|
+
t.datetime "updated_at"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
class CreateLanguages < ActiveRecord::Migration
|
|
2
|
+
def self.up
|
|
3
|
+
create_table :languages, :force => true do |t|
|
|
4
|
+
t.string :name
|
|
5
|
+
t.string :english_name
|
|
6
|
+
t.string :locale
|
|
7
|
+
t.boolean :supported, :default => true
|
|
8
|
+
t.integer :is_default, :default => false
|
|
9
|
+
end
|
|
10
|
+
add_index :languages, :name
|
|
11
|
+
add_index :languages, :locale
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def self.down
|
|
15
|
+
drop_table :languages
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class CreateCountries < ActiveRecord::Migration
|
|
2
|
+
def self.up
|
|
3
|
+
create_table :countries, :force => true do |t|
|
|
4
|
+
t.string "name", :limit => 128, :default => "", :null => false
|
|
5
|
+
t.string "abbreviation", :limit => 3, :default => "", :null => false
|
|
6
|
+
t.integer "sort", :default => 1000, :null => false
|
|
7
|
+
end
|
|
8
|
+
add_index :countries, :name
|
|
9
|
+
add_index :countries, :abbreviation
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def self.down
|
|
13
|
+
drop_table :countries
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
class CreateStates < ActiveRecord::Migration
|
|
2
|
+
def self.up
|
|
3
|
+
create_table :states, :force => true do |t|
|
|
4
|
+
t.string "name", :limit => 128, :default => "", :null => false
|
|
5
|
+
t.string "abbreviation", :limit => 3, :default => "", :null => false
|
|
6
|
+
t.integer "country_id", :limit => 8, :null => false
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
add_index :states, :country_id
|
|
10
|
+
add_index :states, :name
|
|
11
|
+
add_index :states, :abbreviation
|
|
12
|
+
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def self.down
|
|
16
|
+
drop_table :states
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
class CreateUsers < ActiveRecord::Migration
|
|
2
|
+
|
|
3
|
+
def self.up
|
|
4
|
+
create_table :users, :force => true do |t|
|
|
5
|
+
t.string :login
|
|
6
|
+
t.string :email
|
|
7
|
+
t.string :first_name
|
|
8
|
+
t.string :last_name
|
|
9
|
+
t.string :crypted_password
|
|
10
|
+
t.string :password_salt
|
|
11
|
+
t.string :persistence_token
|
|
12
|
+
t.string :single_access_token
|
|
13
|
+
t.string :perishable_token
|
|
14
|
+
t.integer :login_count, :null => false, :default => 0
|
|
15
|
+
t.integer :failed_login_count, :null => false, :default => 0
|
|
16
|
+
t.datetime :last_request_at
|
|
17
|
+
t.datetime :last_login_at
|
|
18
|
+
t.datetime :current_login_at
|
|
19
|
+
t.string :current_login_ip
|
|
20
|
+
t.string :last_login_ip
|
|
21
|
+
t.boolean :terms_of_service, :default => false, :null => false
|
|
22
|
+
t.string :time_zone, :default => "UTC"
|
|
23
|
+
t.datetime :disabled_at
|
|
24
|
+
t.datetime :activated_at
|
|
25
|
+
t.timestamps
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
add_index :users, :login
|
|
29
|
+
add_index :users, :email
|
|
30
|
+
add_index :users, :persistence_token
|
|
31
|
+
add_index :users, :perishable_token
|
|
32
|
+
add_index :users, :single_access_token
|
|
33
|
+
add_index :users, :last_request_at
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def self.down
|
|
37
|
+
drop_table :users
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
class CreateDomainThemes < ActiveRecord::Migration
|
|
2
|
+
def self.up
|
|
3
|
+
create_table :domain_themes, :force => true do |t|
|
|
4
|
+
t.string :uri
|
|
5
|
+
t.string :name
|
|
6
|
+
end
|
|
7
|
+
add_index :domain_themes, ["uri"]
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def self.down
|
|
11
|
+
drop_table :domain_themes
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'fileutils'
|
|
2
|
+
|
|
3
|
+
def ensure_dirs(file_name)
|
|
4
|
+
FileUtils.mkdir_p(File.dirname(file_name))
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
Given /^cms lite file "(.+)" contains "(.+)"$/ do |file_name, file_text|
|
|
8
|
+
ensure_dirs(file_name)
|
|
9
|
+
File.open(file_name, "w") do |file|
|
|
10
|
+
file.puts(file_text)
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
Given /^protected cms lite file "(.+)" contains "(.+)"$/ do |file_name, file_text|
|
|
15
|
+
ensure_dirs(file_name)
|
|
16
|
+
File.open(file_name, "w") do |file|
|
|
17
|
+
file.puts(file_text)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
def log_in_user(user, password)
|
|
2
|
+
visit(login_url)
|
|
3
|
+
fill_in("user_session_login", :with => user.login)
|
|
4
|
+
fill_in("user_session_password", :with => password)
|
|
5
|
+
click_button("Sign In")
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def log_in_with_login_and_role(login, role)
|
|
9
|
+
@user = Factory(:user, :login => login, :password => 'test')
|
|
10
|
+
@user.add_to_role(role)
|
|
11
|
+
log_in_user(@user, password)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
Before do
|
|
15
|
+
ActionMailer::Base.deliveries = []
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# Assumes password is 'asdfasdf'
|
|
20
|
+
Given /I log in as "(.*)"/ do |login|
|
|
21
|
+
password = "asdfasdf"
|
|
22
|
+
@user = User.find_by_login(login)
|
|
23
|
+
log_in_user(@user, password)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
Given /I log in as new user "(.*)" with password "(.*)"/ do |login, password|
|
|
27
|
+
@user = Factory(:user, :login => login, :password => password)
|
|
28
|
+
log_in_user(@user, password)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
Given /I log in as new user/ do
|
|
32
|
+
password = 'asdfasdf'
|
|
33
|
+
@user = Factory(:user, :password => password)
|
|
34
|
+
log_in_user(@user, password)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
Given /^I log in as "(.*)" with role "(.*)"$/ do |login, role|
|
|
38
|
+
log_in_with_login_and_role(login, role)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
Given /^I am not logged in$/ do
|
|
42
|
+
post '/logout'
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
Then /^I should see the login$/ do
|
|
46
|
+
response.body.should =~ /sign_in/m
|
|
47
|
+
response.body.should =~ /user_session_login/m
|
|
48
|
+
response.body.should =~ /user_session_password/m
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
#features/step_definitions/common_steps.rb
|
|
53
|
+
# On page/record
|
|
54
|
+
Given /^I am on "([^"]*)"$/ do |path|
|
|
55
|
+
visit path
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
Then /^I should be on "([^"]*)"$/ do |path|
|
|
59
|
+
current_path.should == path
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
Given /^I am on "([^"]*)" "([^"]*)"$/ do |model,number|
|
|
63
|
+
visit polymorphic_path(record_from_strings(model,number))
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
Then /^I should be on "([^"]*)" "([^"]*)"$/ do |model,number|
|
|
67
|
+
current_path.should == polymorphic_path(record_from_strings(model,number))
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Existing
|
|
71
|
+
Given /^a "([^"]*)" exists for "([^"]*)" "([^"]*)"$/ do |associated,model,number|
|
|
72
|
+
record = record_from_strings(model,number)
|
|
73
|
+
record.send(associated.underscore+'=',valid(associated))
|
|
74
|
+
record.save!
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Support
|
|
78
|
+
def current_path
|
|
79
|
+
response.request.request_uri
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def record_from_strings(model,number)
|
|
83
|
+
model.constantize.find(:first,:offset=>number.to_i-1)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
|