wafflemix 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +96 -0
- data/Rakefile +40 -0
- data/app/assets/javascripts/mercury/page_editor.js.coffee +254 -0
- data/app/assets/javascripts/wafflemix/admin/admin.js.coffee +73 -0
- data/app/assets/javascripts/wafflemix/admin/admin_js.js +16 -0
- data/app/assets/javascripts/wafflemix/admin/bootstrap-datepicker.js +454 -0
- data/app/assets/javascripts/wafflemix/admin/jquery.nested_sortable.js +608 -0
- data/app/assets/javascripts/wafflemix/application.js +43 -0
- data/app/assets/javascripts/wafflemix/assets.js +2 -0
- data/app/assets/javascripts/wafflemix/contact_forms.js +2 -0
- data/app/assets/javascripts/wafflemix/mercury.js +469 -0
- data/app/assets/javascripts/wafflemix/pages.js +2 -0
- data/app/assets/javascripts/wafflemix/portfolios.js +2 -0
- data/app/assets/javascripts/wafflemix/posts.js +2 -0
- data/app/assets/javascripts/wafflemix/roles.js +2 -0
- data/app/assets/javascripts/wafflemix/users.js +2 -0
- data/app/assets/stylesheets/wafflemix/admin/admin.css.sass +76 -0
- data/app/assets/stylesheets/wafflemix/admin/bootstrap-datepicker.css +7 -0
- data/app/assets/stylesheets/wafflemix/application.css +15 -0
- data/app/assets/stylesheets/wafflemix/assets.css +4 -0
- data/app/assets/stylesheets/wafflemix/clearfix.css +20 -0
- data/app/assets/stylesheets/wafflemix/contact_forms.css +4 -0
- data/app/assets/stylesheets/wafflemix/main.css.sass +11 -0
- data/app/assets/stylesheets/wafflemix/mercury.css +23 -0
- data/app/assets/stylesheets/wafflemix/pages.css +4 -0
- data/app/assets/stylesheets/wafflemix/partials/_base.css.sass +131 -0
- data/app/assets/stylesheets/wafflemix/portfolios.css +4 -0
- data/app/assets/stylesheets/wafflemix/posts.css +4 -0
- data/app/assets/stylesheets/wafflemix/roles.css +4 -0
- data/app/assets/stylesheets/wafflemix/users.css +4 -0
- data/app/controllers/wafflemix/admin/assets_controller.rb +95 -0
- data/app/controllers/wafflemix/admin/categories_controller.rb +77 -0
- data/app/controllers/wafflemix/admin/contact_forms_controller.rb +77 -0
- data/app/controllers/wafflemix/admin/content_sections_controller.rb +85 -0
- data/app/controllers/wafflemix/admin/pages_controller.rb +93 -0
- data/app/controllers/wafflemix/admin/portfolios_controller.rb +93 -0
- data/app/controllers/wafflemix/admin/posts_controller.rb +82 -0
- data/app/controllers/wafflemix/admin/roles_controller.rb +77 -0
- data/app/controllers/wafflemix/admin/slides_controller.rb +88 -0
- data/app/controllers/wafflemix/admin/users_controller.rb +78 -0
- data/app/controllers/wafflemix/application_controller.rb +11 -0
- data/app/controllers/wafflemix/assets_controller.rb +71 -0
- data/app/controllers/wafflemix/categories_controller.rb +34 -0
- data/app/controllers/wafflemix/contact_forms_controller.rb +47 -0
- data/app/controllers/wafflemix/pages_controller.rb +56 -0
- data/app/controllers/wafflemix/portfolios_controller.rb +35 -0
- data/app/controllers/wafflemix/posts_controller.rb +52 -0
- data/app/helpers/wafflemix/admin/slides_helper.rb +11 -0
- data/app/helpers/wafflemix/application_helper.rb +88 -0
- data/app/helpers/wafflemix/assets_helper.rb +4 -0
- data/app/helpers/wafflemix/categories_helper.rb +4 -0
- data/app/helpers/wafflemix/contact_forms_helper.rb +4 -0
- data/app/helpers/wafflemix/content_sections_helper.rb +4 -0
- data/app/helpers/wafflemix/pages_helper.rb +23 -0
- data/app/helpers/wafflemix/portfolios_helper.rb +11 -0
- data/app/helpers/wafflemix/posts_helper.rb +5 -0
- data/app/helpers/wafflemix/roles_helper.rb +4 -0
- data/app/helpers/wafflemix/users_helper.rb +4 -0
- data/app/models/user.rb +10 -0
- data/app/models/wafflemix/Categorical.rb +8 -0
- data/app/models/wafflemix/asset.rb +22 -0
- data/app/models/wafflemix/category.rb +8 -0
- data/app/models/wafflemix/contact_form.rb +19 -0
- data/app/models/wafflemix/content_section.rb +21 -0
- data/app/models/wafflemix/image.rb +8 -0
- data/app/models/wafflemix/meta_content.rb +5 -0
- data/app/models/wafflemix/page.rb +39 -0
- data/app/models/wafflemix/portfolio.rb +16 -0
- data/app/models/wafflemix/post.rb +33 -0
- data/app/models/wafflemix/role.rb +10 -0
- data/app/models/wafflemix/slide.rb +14 -0
- data/app/models/wafflemix/user.rb +11 -0
- data/app/models/wafflemix/user_role.rb +8 -0
- data/app/views/devise/_links.erb +25 -0
- data/app/views/devise/confirmations/new.html.erb +12 -0
- data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/devise/passwords/edit.html.erb +16 -0
- data/app/views/devise/passwords/new.html.erb +12 -0
- data/app/views/devise/registrations/edit.html.erb +25 -0
- data/app/views/devise/registrations/new.html.erb +18 -0
- data/app/views/devise/sessions/new.html.erb +17 -0
- data/app/views/devise/unlocks/new.html.erb +12 -0
- data/app/views/layouts/mercury.html.erb +24 -0
- data/app/views/layouts/wafflemix/admin.html.erb +19 -0
- data/app/views/layouts/wafflemix/example_layout.html.erb +35 -0
- data/app/views/wafflemix/admin/assets/_form.html.erb +22 -0
- data/app/views/wafflemix/admin/assets/add_image.js.erb +1 -0
- data/app/views/wafflemix/admin/assets/edit.html.erb +6 -0
- data/app/views/wafflemix/admin/assets/index.html.erb +41 -0
- data/app/views/wafflemix/admin/assets/new.html.erb +5 -0
- data/app/views/wafflemix/admin/assets/show.html.erb +20 -0
- data/app/views/wafflemix/admin/categories/_form.html.erb +29 -0
- data/app/views/wafflemix/admin/categories/edit.html.erb +6 -0
- data/app/views/wafflemix/admin/categories/index.html.erb +36 -0
- data/app/views/wafflemix/admin/categories/new.html.erb +5 -0
- data/app/views/wafflemix/admin/categories/show.html.erb +25 -0
- data/app/views/wafflemix/admin/contact_forms/_form.html.erb +15 -0
- data/app/views/wafflemix/admin/contact_forms/edit.html.erb +6 -0
- data/app/views/wafflemix/admin/contact_forms/index.html.erb +38 -0
- data/app/views/wafflemix/admin/contact_forms/new.html.erb +5 -0
- data/app/views/wafflemix/admin/contact_forms/show.html.erb +25 -0
- data/app/views/wafflemix/admin/content_sections/_form.html.erb +33 -0
- data/app/views/wafflemix/admin/content_sections/create.js.erb +3 -0
- data/app/views/wafflemix/admin/content_sections/destroy.js.erb +4 -0
- data/app/views/wafflemix/admin/content_sections/edit.html.erb +6 -0
- data/app/views/wafflemix/admin/content_sections/index.html.erb +29 -0
- data/app/views/wafflemix/admin/content_sections/new.html.erb +5 -0
- data/app/views/wafflemix/admin/content_sections/show.html.erb +25 -0
- data/app/views/wafflemix/admin/pages/_form.html.erb +47 -0
- data/app/views/wafflemix/admin/pages/_page.html.erb +15 -0
- data/app/views/wafflemix/admin/pages/edit.html.erb +3 -0
- data/app/views/wafflemix/admin/pages/index.html.erb +21 -0
- data/app/views/wafflemix/admin/pages/new.html.erb +3 -0
- data/app/views/wafflemix/admin/pages/show.html.erb +40 -0
- data/app/views/wafflemix/admin/portfolios/_form.html.erb +174 -0
- data/app/views/wafflemix/admin/portfolios/_portfolio.html.erb +11 -0
- data/app/views/wafflemix/admin/portfolios/edit.html.erb +5 -0
- data/app/views/wafflemix/admin/portfolios/index.html.erb +21 -0
- data/app/views/wafflemix/admin/portfolios/new.html.erb +5 -0
- data/app/views/wafflemix/admin/portfolios/show.html.erb +20 -0
- data/app/views/wafflemix/admin/posts/_form.html.erb +191 -0
- data/app/views/wafflemix/admin/posts/edit.html.erb +5 -0
- data/app/views/wafflemix/admin/posts/index.html.erb +38 -0
- data/app/views/wafflemix/admin/posts/new.html.erb +3 -0
- data/app/views/wafflemix/admin/posts/show.html.erb +20 -0
- data/app/views/wafflemix/admin/roles/_form.html.erb +21 -0
- data/app/views/wafflemix/admin/roles/edit.html.erb +6 -0
- data/app/views/wafflemix/admin/roles/index.html.erb +34 -0
- data/app/views/wafflemix/admin/roles/new.html.erb +5 -0
- data/app/views/wafflemix/admin/roles/show.html.erb +10 -0
- data/app/views/wafflemix/admin/slides/_form.html.erb +170 -0
- data/app/views/wafflemix/admin/slides/_slide.html.erb +11 -0
- data/app/views/wafflemix/admin/slides/edit.html.erb +5 -0
- data/app/views/wafflemix/admin/slides/index.html.erb +21 -0
- data/app/views/wafflemix/admin/slides/new.html.erb +5 -0
- data/app/views/wafflemix/admin/slides/show.html.erb +10 -0
- data/app/views/wafflemix/admin/users/_form.html.erb +29 -0
- data/app/views/wafflemix/admin/users/edit.html.erb +6 -0
- data/app/views/wafflemix/admin/users/index.html.erb +36 -0
- data/app/views/wafflemix/admin/users/new.html.erb +5 -0
- data/app/views/wafflemix/admin/users/show.html.erb +14 -0
- data/app/views/wafflemix/categories/index.erb +16 -0
- data/app/views/wafflemix/categories/show.html.erb +16 -0
- data/app/views/wafflemix/contact_forms/_form.html.erb +33 -0
- data/app/views/wafflemix/contact_forms/new.html.erb +19 -0
- data/app/views/wafflemix/contact_forms/show.html.erb +25 -0
- data/app/views/wafflemix/pages/home.html.erb +7 -0
- data/app/views/wafflemix/pages/index.html.erb +31 -0
- data/app/views/wafflemix/pages/show.html.erb +14 -0
- data/app/views/wafflemix/portfolios/index.html.erb +21 -0
- data/app/views/wafflemix/portfolios/show.html.erb +36 -0
- data/app/views/wafflemix/posts/_sidebar.html.erb +12 -0
- data/app/views/wafflemix/posts/index.html.erb +16 -0
- data/app/views/wafflemix/posts/show.html.erb +40 -0
- data/app/views/wafflemix/posts/tagged.html.erb +16 -0
- data/config/initializers/devise.rb +227 -0
- data/config/initializers/dragonfly.rb +16 -0
- data/config/initializers/formtastic.rb +78 -0
- data/config/initializers/spam_filter.rb +4 -0
- data/config/locales/devise.en.yml +57 -0
- data/config/routes.rb +55 -0
- data/db/migrate/20120814113226_create_wafflemix_pages.rb +19 -0
- data/db/migrate/20120901141321_create_wafflemix_users.rb +29 -0
- data/db/migrate/20120901150334_create_wafflemix_assets.rb +11 -0
- data/db/migrate/20120901151421_create_wafflemix_roles.rb +9 -0
- data/db/migrate/20120901151704_create_wafflemix_user_roles.rb +13 -0
- data/db/migrate/20120915124116_add_ancestry_to_pages.rb +7 -0
- data/db/migrate/20120918100336_create_wafflemix_categories.rb +15 -0
- data/db/migrate/20120923131130_create_wafflemix_slides.rb +11 -0
- data/db/migrate/20120923131307_create_wafflemix_content_sections.rb +12 -0
- data/db/migrate/20120923135949_add_position_to_slides.rb +5 -0
- data/db/migrate/20121005124419_update_asset_table.rb +10 -0
- data/db/migrate/20121113131239_create_wafflemix_posts.rb +15 -0
- data/db/migrate/20121113132413_add_translation_table_for_posts.rb +9 -0
- data/db/migrate/20121114135432_update_draft_to_boolean_on_posts.rb +11 -0
- data/db/migrate/20121120125114_add_page_translations.rb +9 -0
- data/db/migrate/20121205221122_acts_as_taggable_on_migration.rb +30 -0
- data/db/migrate/20121206132733_re_do_categories.rb +19 -0
- data/db/migrate/20121206132923_add_new_categories_table.rb +11 -0
- data/db/migrate/20121206133026_add_category_joins_table.rb +14 -0
- data/db/migrate/20121211095114_finalize_asset_table.rb +11 -0
- data/db/migrate/20121211095847_store_asset_url.rb +5 -0
- data/db/migrate/20130202161212_create_wafflemix_images.rb +11 -0
- data/db/migrate/20130202182435_add_extra_fields_to_slides.rb +6 -0
- data/db/migrate/20130204225256_create_wafflemix_portfolios.rb +11 -0
- data/db/migrate/20130204230818_add_ancestry_to_portfolio.rb +6 -0
- data/db/migrate/20130216190558_create_wafflemix_meta_contents.rb +13 -0
- data/db/migrate/20130219121412_create_wafflemix_contact_forms.rb +12 -0
- data/db/migrate/20130219130609_add_spam_to_contact_forms.rb +5 -0
- data/lib/tasks/wafflemix_tasks.rake +15 -0
- data/lib/templates/erb/scaffold/_form.html.erb +11 -0
- data/lib/wafflemix/engine.rb +9 -0
- data/lib/wafflemix/version.rb +3 -0
- data/lib/wafflemix.rb +17 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config/application.rb +64 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +39 -0
- data/test/dummy/config/environments/production.rb +69 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/local_s3.rb +3 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +5 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/schema.rb +87 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/fixtures/wafflemix/assets.yml +11 -0
- data/test/fixtures/wafflemix/categories.yml +13 -0
- data/test/fixtures/wafflemix/contact_forms.yml +13 -0
- data/test/fixtures/wafflemix/content_sections.yml +13 -0
- data/test/fixtures/wafflemix/images.yml +11 -0
- data/test/fixtures/wafflemix/meta_contents.yml +15 -0
- data/test/fixtures/wafflemix/pages.yml +19 -0
- data/test/fixtures/wafflemix/portfolios.yml +11 -0
- data/test/fixtures/wafflemix/posts.yml +11 -0
- data/test/fixtures/wafflemix/roles.yml +7 -0
- data/test/fixtures/wafflemix/slides.yml +7 -0
- data/test/fixtures/wafflemix/user_roles.yml +9 -0
- data/test/fixtures/wafflemix/users.yml +11 -0
- data/test/functional/wafflemix/assets_controller_test.rb +51 -0
- data/test/functional/wafflemix/categories_controller_test.rb +51 -0
- data/test/functional/wafflemix/contact_forms_controller_test.rb +51 -0
- data/test/functional/wafflemix/content_sections_controller_test.rb +51 -0
- data/test/functional/wafflemix/pages_controller_test.rb +51 -0
- data/test/functional/wafflemix/portfolios_controller_test.rb +51 -0
- data/test/functional/wafflemix/posts_controller_test.rb +51 -0
- data/test/functional/wafflemix/roles_controller_test.rb +51 -0
- data/test/functional/wafflemix/slides_controller_test.rb +51 -0
- data/test/functional/wafflemix/users_controller_test.rb +51 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/test_helper.rb +15 -0
- data/test/unit/helpers/wafflemix/assets_helper_test.rb +6 -0
- data/test/unit/helpers/wafflemix/categories_helper_test.rb +6 -0
- data/test/unit/helpers/wafflemix/contact_forms_helper_test.rb +6 -0
- data/test/unit/helpers/wafflemix/content_sections_helper_test.rb +6 -0
- data/test/unit/helpers/wafflemix/pages_helper_test.rb +6 -0
- data/test/unit/helpers/wafflemix/portfolios_helper_test.rb +6 -0
- data/test/unit/helpers/wafflemix/posts_helper_test.rb +6 -0
- data/test/unit/helpers/wafflemix/roles_helper_test.rb +6 -0
- data/test/unit/helpers/wafflemix/slides_helper_test.rb +6 -0
- data/test/unit/helpers/wafflemix/users_helper_test.rb +6 -0
- data/test/unit/wafflemix/asset_test.rb +9 -0
- data/test/unit/wafflemix/category_test.rb +9 -0
- data/test/unit/wafflemix/contact_form_test.rb +9 -0
- data/test/unit/wafflemix/content_section_test.rb +9 -0
- data/test/unit/wafflemix/image_test.rb +9 -0
- data/test/unit/wafflemix/meta_content_test.rb +9 -0
- data/test/unit/wafflemix/page_test.rb +9 -0
- data/test/unit/wafflemix/portfolio_test.rb +9 -0
- data/test/unit/wafflemix/post_test.rb +9 -0
- data/test/unit/wafflemix/role_test.rb +9 -0
- data/test/unit/wafflemix/slide_test.rb +9 -0
- data/test/unit/wafflemix/user_role_test.rb +9 -0
- data/test/unit/wafflemix/user_test.rb +9 -0
- data/test/wafflemix_test.rb +7 -0
- metadata +654 -0
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Wafflemix
|
4
|
+
class CategoriesControllerTest < ActionController::TestCase
|
5
|
+
setup do
|
6
|
+
@category = categories(:one)
|
7
|
+
end
|
8
|
+
|
9
|
+
test "should get index" do
|
10
|
+
get :index
|
11
|
+
assert_response :success
|
12
|
+
assert_not_nil assigns(:categories)
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should get new" do
|
16
|
+
get :new
|
17
|
+
assert_response :success
|
18
|
+
end
|
19
|
+
|
20
|
+
test "should create category" do
|
21
|
+
assert_difference('Category.count') do
|
22
|
+
post :create, category: { ancestry: @category.ancestry, categorical: @category.categorical, name: @category.name, position: @category.position }
|
23
|
+
end
|
24
|
+
|
25
|
+
assert_redirected_to category_path(assigns(:category))
|
26
|
+
end
|
27
|
+
|
28
|
+
test "should show category" do
|
29
|
+
get :show, id: @category
|
30
|
+
assert_response :success
|
31
|
+
end
|
32
|
+
|
33
|
+
test "should get edit" do
|
34
|
+
get :edit, id: @category
|
35
|
+
assert_response :success
|
36
|
+
end
|
37
|
+
|
38
|
+
test "should update category" do
|
39
|
+
put :update, id: @category, category: { ancestry: @category.ancestry, categorical: @category.categorical, name: @category.name, position: @category.position }
|
40
|
+
assert_redirected_to category_path(assigns(:category))
|
41
|
+
end
|
42
|
+
|
43
|
+
test "should destroy category" do
|
44
|
+
assert_difference('Category.count', -1) do
|
45
|
+
delete :destroy, id: @category
|
46
|
+
end
|
47
|
+
|
48
|
+
assert_redirected_to categories_path
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Wafflemix
|
4
|
+
class ContactFormsControllerTest < ActionController::TestCase
|
5
|
+
setup do
|
6
|
+
@contact_form = contact_forms(:one)
|
7
|
+
end
|
8
|
+
|
9
|
+
test "should get index" do
|
10
|
+
get :index
|
11
|
+
assert_response :success
|
12
|
+
assert_not_nil assigns(:contact_forms)
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should get new" do
|
16
|
+
get :new
|
17
|
+
assert_response :success
|
18
|
+
end
|
19
|
+
|
20
|
+
test "should create contact_form" do
|
21
|
+
assert_difference('ContactForm.count') do
|
22
|
+
post :create, contact_form: { email: @contact_form.email, message: @contact_form.message, name: @contact_form.name, subject: @contact_form.subject }
|
23
|
+
end
|
24
|
+
|
25
|
+
assert_redirected_to contact_form_path(assigns(:contact_form))
|
26
|
+
end
|
27
|
+
|
28
|
+
test "should show contact_form" do
|
29
|
+
get :show, id: @contact_form
|
30
|
+
assert_response :success
|
31
|
+
end
|
32
|
+
|
33
|
+
test "should get edit" do
|
34
|
+
get :edit, id: @contact_form
|
35
|
+
assert_response :success
|
36
|
+
end
|
37
|
+
|
38
|
+
test "should update contact_form" do
|
39
|
+
put :update, id: @contact_form, contact_form: { email: @contact_form.email, message: @contact_form.message, name: @contact_form.name, subject: @contact_form.subject }
|
40
|
+
assert_redirected_to contact_form_path(assigns(:contact_form))
|
41
|
+
end
|
42
|
+
|
43
|
+
test "should destroy contact_form" do
|
44
|
+
assert_difference('ContactForm.count', -1) do
|
45
|
+
delete :destroy, id: @contact_form
|
46
|
+
end
|
47
|
+
|
48
|
+
assert_redirected_to contact_forms_path
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Wafflemix
|
4
|
+
class ContentSectionsControllerTest < ActionController::TestCase
|
5
|
+
setup do
|
6
|
+
@content_section = content_sections(:one)
|
7
|
+
end
|
8
|
+
|
9
|
+
test "should get index" do
|
10
|
+
get :index
|
11
|
+
assert_response :success
|
12
|
+
assert_not_nil assigns(:content_sections)
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should get new" do
|
16
|
+
get :new
|
17
|
+
assert_response :success
|
18
|
+
end
|
19
|
+
|
20
|
+
test "should create content_section" do
|
21
|
+
assert_difference('ContentSection.count') do
|
22
|
+
post :create, content_section: { content: @content_section.content, contentable_id: @content_section.contentable_id, contentable_type: @content_section.contentable_type, name: @content_section.name }
|
23
|
+
end
|
24
|
+
|
25
|
+
assert_redirected_to content_section_path(assigns(:content_section))
|
26
|
+
end
|
27
|
+
|
28
|
+
test "should show content_section" do
|
29
|
+
get :show, id: @content_section
|
30
|
+
assert_response :success
|
31
|
+
end
|
32
|
+
|
33
|
+
test "should get edit" do
|
34
|
+
get :edit, id: @content_section
|
35
|
+
assert_response :success
|
36
|
+
end
|
37
|
+
|
38
|
+
test "should update content_section" do
|
39
|
+
put :update, id: @content_section, content_section: { content: @content_section.content, contentable_id: @content_section.contentable_id, contentable_type: @content_section.contentable_type, name: @content_section.name }
|
40
|
+
assert_redirected_to content_section_path(assigns(:content_section))
|
41
|
+
end
|
42
|
+
|
43
|
+
test "should destroy content_section" do
|
44
|
+
assert_difference('ContentSection.count', -1) do
|
45
|
+
delete :destroy, id: @content_section
|
46
|
+
end
|
47
|
+
|
48
|
+
assert_redirected_to content_sections_path
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Wafflemix
|
4
|
+
class PagesControllerTest < ActionController::TestCase
|
5
|
+
setup do
|
6
|
+
@page = pages(:one)
|
7
|
+
end
|
8
|
+
|
9
|
+
test "should get index" do
|
10
|
+
get :index
|
11
|
+
assert_response :success
|
12
|
+
assert_not_nil assigns(:pages)
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should get new" do
|
16
|
+
get :new
|
17
|
+
assert_response :success
|
18
|
+
end
|
19
|
+
|
20
|
+
test "should create page" do
|
21
|
+
assert_difference('Page.count') do
|
22
|
+
post :create, page: { deletable: @page.deletable, draft: @page.draft, link_url: @page.link_url, parent_id: @page.parent_id, position: @page.position, show_in_menu: @page.show_in_menu, skip_to_first: @page.skip_to_first }
|
23
|
+
end
|
24
|
+
|
25
|
+
assert_redirected_to page_path(assigns(:page))
|
26
|
+
end
|
27
|
+
|
28
|
+
test "should show page" do
|
29
|
+
get :show, id: @page
|
30
|
+
assert_response :success
|
31
|
+
end
|
32
|
+
|
33
|
+
test "should get edit" do
|
34
|
+
get :edit, id: @page
|
35
|
+
assert_response :success
|
36
|
+
end
|
37
|
+
|
38
|
+
test "should update page" do
|
39
|
+
put :update, id: @page, page: { deletable: @page.deletable, draft: @page.draft, link_url: @page.link_url, parent_id: @page.parent_id, position: @page.position, show_in_menu: @page.show_in_menu, skip_to_first: @page.skip_to_first }
|
40
|
+
assert_redirected_to page_path(assigns(:page))
|
41
|
+
end
|
42
|
+
|
43
|
+
test "should destroy page" do
|
44
|
+
assert_difference('Page.count', -1) do
|
45
|
+
delete :destroy, id: @page
|
46
|
+
end
|
47
|
+
|
48
|
+
assert_redirected_to pages_path
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Wafflemix
|
4
|
+
class PortfoliosControllerTest < ActionController::TestCase
|
5
|
+
setup do
|
6
|
+
@portfolio = portfolios(:one)
|
7
|
+
end
|
8
|
+
|
9
|
+
test "should get index" do
|
10
|
+
get :index
|
11
|
+
assert_response :success
|
12
|
+
assert_not_nil assigns(:portfolios)
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should get new" do
|
16
|
+
get :new
|
17
|
+
assert_response :success
|
18
|
+
end
|
19
|
+
|
20
|
+
test "should create portfolio" do
|
21
|
+
assert_difference('Portfolio.count') do
|
22
|
+
post :create, portfolio: { content: @portfolio.content, intro: @portfolio.intro, title: @portfolio.title }
|
23
|
+
end
|
24
|
+
|
25
|
+
assert_redirected_to portfolio_path(assigns(:portfolio))
|
26
|
+
end
|
27
|
+
|
28
|
+
test "should show portfolio" do
|
29
|
+
get :show, id: @portfolio
|
30
|
+
assert_response :success
|
31
|
+
end
|
32
|
+
|
33
|
+
test "should get edit" do
|
34
|
+
get :edit, id: @portfolio
|
35
|
+
assert_response :success
|
36
|
+
end
|
37
|
+
|
38
|
+
test "should update portfolio" do
|
39
|
+
put :update, id: @portfolio, portfolio: { content: @portfolio.content, intro: @portfolio.intro, title: @portfolio.title }
|
40
|
+
assert_redirected_to portfolio_path(assigns(:portfolio))
|
41
|
+
end
|
42
|
+
|
43
|
+
test "should destroy portfolio" do
|
44
|
+
assert_difference('Portfolio.count', -1) do
|
45
|
+
delete :destroy, id: @portfolio
|
46
|
+
end
|
47
|
+
|
48
|
+
assert_redirected_to portfolios_path
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Wafflemix
|
4
|
+
class PostsControllerTest < ActionController::TestCase
|
5
|
+
setup do
|
6
|
+
@post = posts(:one)
|
7
|
+
end
|
8
|
+
|
9
|
+
test "should get index" do
|
10
|
+
get :index
|
11
|
+
assert_response :success
|
12
|
+
assert_not_nil assigns(:posts)
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should get new" do
|
16
|
+
get :new
|
17
|
+
assert_response :success
|
18
|
+
end
|
19
|
+
|
20
|
+
test "should create post" do
|
21
|
+
assert_difference('Post.count') do
|
22
|
+
post :create, post: { draft: @post.draft, link_url: @post.link_url, published_at: @post.published_at }
|
23
|
+
end
|
24
|
+
|
25
|
+
assert_redirected_to post_path(assigns(:post))
|
26
|
+
end
|
27
|
+
|
28
|
+
test "should show post" do
|
29
|
+
get :show, id: @post
|
30
|
+
assert_response :success
|
31
|
+
end
|
32
|
+
|
33
|
+
test "should get edit" do
|
34
|
+
get :edit, id: @post
|
35
|
+
assert_response :success
|
36
|
+
end
|
37
|
+
|
38
|
+
test "should update post" do
|
39
|
+
put :update, id: @post, post: { draft: @post.draft, link_url: @post.link_url, published_at: @post.published_at }
|
40
|
+
assert_redirected_to post_path(assigns(:post))
|
41
|
+
end
|
42
|
+
|
43
|
+
test "should destroy post" do
|
44
|
+
assert_difference('Post.count', -1) do
|
45
|
+
delete :destroy, id: @post
|
46
|
+
end
|
47
|
+
|
48
|
+
assert_redirected_to posts_path
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Wafflemix
|
4
|
+
class RolesControllerTest < ActionController::TestCase
|
5
|
+
setup do
|
6
|
+
@role = roles(:one)
|
7
|
+
end
|
8
|
+
|
9
|
+
test "should get index" do
|
10
|
+
get :index
|
11
|
+
assert_response :success
|
12
|
+
assert_not_nil assigns(:roles)
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should get new" do
|
16
|
+
get :new
|
17
|
+
assert_response :success
|
18
|
+
end
|
19
|
+
|
20
|
+
test "should create role" do
|
21
|
+
assert_difference('Role.count') do
|
22
|
+
post :create, role: { name: @role.name }
|
23
|
+
end
|
24
|
+
|
25
|
+
assert_redirected_to role_path(assigns(:role))
|
26
|
+
end
|
27
|
+
|
28
|
+
test "should show role" do
|
29
|
+
get :show, id: @role
|
30
|
+
assert_response :success
|
31
|
+
end
|
32
|
+
|
33
|
+
test "should get edit" do
|
34
|
+
get :edit, id: @role
|
35
|
+
assert_response :success
|
36
|
+
end
|
37
|
+
|
38
|
+
test "should update role" do
|
39
|
+
put :update, id: @role, role: { name: @role.name }
|
40
|
+
assert_redirected_to role_path(assigns(:role))
|
41
|
+
end
|
42
|
+
|
43
|
+
test "should destroy role" do
|
44
|
+
assert_difference('Role.count', -1) do
|
45
|
+
delete :destroy, id: @role
|
46
|
+
end
|
47
|
+
|
48
|
+
assert_redirected_to roles_path
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Wafflemix
|
4
|
+
class SlidesControllerTest < ActionController::TestCase
|
5
|
+
setup do
|
6
|
+
@slide = slides(:one)
|
7
|
+
end
|
8
|
+
|
9
|
+
test "should get index" do
|
10
|
+
get :index
|
11
|
+
assert_response :success
|
12
|
+
assert_not_nil assigns(:slides)
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should get new" do
|
16
|
+
get :new
|
17
|
+
assert_response :success
|
18
|
+
end
|
19
|
+
|
20
|
+
test "should create slide" do
|
21
|
+
assert_difference('Slide.count') do
|
22
|
+
post :create, slide: { name: @slide.name }
|
23
|
+
end
|
24
|
+
|
25
|
+
assert_redirected_to slide_path(assigns(:slide))
|
26
|
+
end
|
27
|
+
|
28
|
+
test "should show slide" do
|
29
|
+
get :show, id: @slide
|
30
|
+
assert_response :success
|
31
|
+
end
|
32
|
+
|
33
|
+
test "should get edit" do
|
34
|
+
get :edit, id: @slide
|
35
|
+
assert_response :success
|
36
|
+
end
|
37
|
+
|
38
|
+
test "should update slide" do
|
39
|
+
put :update, id: @slide, slide: { name: @slide.name }
|
40
|
+
assert_redirected_to slide_path(assigns(:slide))
|
41
|
+
end
|
42
|
+
|
43
|
+
test "should destroy slide" do
|
44
|
+
assert_difference('Slide.count', -1) do
|
45
|
+
delete :destroy, id: @slide
|
46
|
+
end
|
47
|
+
|
48
|
+
assert_redirected_to slides_path
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Wafflemix
|
4
|
+
class UsersControllerTest < ActionController::TestCase
|
5
|
+
setup do
|
6
|
+
@user = users(:one)
|
7
|
+
end
|
8
|
+
|
9
|
+
test "should get index" do
|
10
|
+
get :index
|
11
|
+
assert_response :success
|
12
|
+
assert_not_nil assigns(:users)
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should get new" do
|
16
|
+
get :new
|
17
|
+
assert_response :success
|
18
|
+
end
|
19
|
+
|
20
|
+
test "should create user" do
|
21
|
+
assert_difference('User.count') do
|
22
|
+
post :create, user: { email: @user.email, password: @user.password, username: @user.username }
|
23
|
+
end
|
24
|
+
|
25
|
+
assert_redirected_to user_path(assigns(:user))
|
26
|
+
end
|
27
|
+
|
28
|
+
test "should show user" do
|
29
|
+
get :show, id: @user
|
30
|
+
assert_response :success
|
31
|
+
end
|
32
|
+
|
33
|
+
test "should get edit" do
|
34
|
+
get :edit, id: @user
|
35
|
+
assert_response :success
|
36
|
+
end
|
37
|
+
|
38
|
+
test "should update user" do
|
39
|
+
put :update, id: @user, user: { email: @user.email, password: @user.password, username: @user.username }
|
40
|
+
assert_redirected_to user_path(assigns(:user))
|
41
|
+
end
|
42
|
+
|
43
|
+
test "should destroy user" do
|
44
|
+
assert_difference('User.count', -1) do
|
45
|
+
delete :destroy, id: @user
|
46
|
+
end
|
47
|
+
|
48
|
+
assert_redirected_to users_path
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
|
4
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
|
+
require "rails/test_help"
|
6
|
+
|
7
|
+
Rails.backtrace_cleaner.remove_silencers!
|
8
|
+
|
9
|
+
# Load support files
|
10
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
11
|
+
|
12
|
+
# Load fixtures from the engine
|
13
|
+
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
|
14
|
+
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
15
|
+
end
|