admin_assistant 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/admin_assistant.gemspec +1 -285
- metadata +3 -287
- data/test_rails_app/README +0 -256
- data/test_rails_app/Rakefile +0 -13
- data/test_rails_app/app/controllers/admin/appointments2_controller.rb +0 -15
- data/test_rails_app/app/controllers/admin/appointments_controller.rb +0 -11
- data/test_rails_app/app/controllers/admin/blog_posts2_controller.rb +0 -138
- data/test_rails_app/app/controllers/admin/blog_posts3_controller.rb +0 -76
- data/test_rails_app/app/controllers/admin/blog_posts4_controller.rb +0 -21
- data/test_rails_app/app/controllers/admin/blog_posts5_controller.rb +0 -27
- data/test_rails_app/app/controllers/admin/blog_posts6_controller.rb +0 -10
- data/test_rails_app/app/controllers/admin/blog_posts_controller.rb +0 -8
- data/test_rails_app/app/controllers/admin/blog_posts_custom_new_and_edit_controller.rb +0 -15
- data/test_rails_app/app/controllers/admin/blog_posts_read_only_controller.rb +0 -19
- data/test_rails_app/app/controllers/admin/bookmarks_controller.rb +0 -11
- data/test_rails_app/app/controllers/admin/comments2_controller.rb +0 -14
- data/test_rails_app/app/controllers/admin/comments_controller.rb +0 -12
- data/test_rails_app/app/controllers/admin/file_column_images2_controller.rb +0 -10
- data/test_rails_app/app/controllers/admin/file_column_images_controller.rb +0 -6
- data/test_rails_app/app/controllers/admin/images2_controller.rb +0 -11
- data/test_rails_app/app/controllers/admin/images_controller.rb +0 -6
- data/test_rails_app/app/controllers/admin/misconfigured1_controller.rb +0 -7
- data/test_rails_app/app/controllers/admin/not_migrated_yets_controller.rb +0 -9
- data/test_rails_app/app/controllers/admin/product_categories2_controller.rb +0 -7
- data/test_rails_app/app/controllers/admin/product_categories_controller.rb +0 -5
- data/test_rails_app/app/controllers/admin/products2_controller.rb +0 -15
- data/test_rails_app/app/controllers/admin/products_controller.rb +0 -31
- data/test_rails_app/app/controllers/admin/television_airings_controller.rb +0 -5
- data/test_rails_app/app/controllers/admin/television_time_slots_controller.rb +0 -5
- data/test_rails_app/app/controllers/admin/users2_controller.rb +0 -10
- data/test_rails_app/app/controllers/admin/users_controller.rb +0 -63
- data/test_rails_app/app/controllers/application.rb +0 -16
- data/test_rails_app/app/controllers/application_controller.rb +0 -16
- data/test_rails_app/app/controllers/blog_posts_controller.rb +0 -5
- data/test_rails_app/app/helpers/admin/appointments2_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/appointments_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/blog_posts2_helper.rb +0 -27
- data/test_rails_app/app/helpers/admin/blog_posts3_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/blog_posts4_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/blog_posts6_helper.rb +0 -16
- data/test_rails_app/app/helpers/admin/blog_posts_custom_new_and_edit_helper.rb +0 -29
- data/test_rails_app/app/helpers/admin/blog_posts_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/blog_posts_read_only_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/bookmarks_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/comments2_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/comments_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/file_column_images2_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/file_column_images_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/images2_helper.rb +0 -8
- data/test_rails_app/app/helpers/admin/images_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/misconfigured1_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/not_migrated_yets_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/product_categories2_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/product_categories_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/products2_helper.rb +0 -3
- data/test_rails_app/app/helpers/admin/products_helper.rb +0 -6
- data/test_rails_app/app/helpers/admin/television_airings_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/television_time_slots_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/users2_helper.rb +0 -2
- data/test_rails_app/app/helpers/admin/users_helper.rb +0 -25
- data/test_rails_app/app/helpers/application_helper.rb +0 -3
- data/test_rails_app/app/helpers/blog_posts_helper.rb +0 -2
- data/test_rails_app/app/models/appointment.rb +0 -5
- data/test_rails_app/app/models/blog_post.rb +0 -14
- data/test_rails_app/app/models/blog_post_tag.rb +0 -6
- data/test_rails_app/app/models/bookmark.rb +0 -6
- data/test_rails_app/app/models/comment.rb +0 -4
- data/test_rails_app/app/models/file_column_image.rb +0 -3
- data/test_rails_app/app/models/image.rb +0 -3
- data/test_rails_app/app/models/not_migrated_yet.rb +0 -2
- data/test_rails_app/app/models/product.rb +0 -7
- data/test_rails_app/app/models/product_category.rb +0 -9
- data/test_rails_app/app/models/tag.rb +0 -4
- data/test_rails_app/app/models/television_airing.rb +0 -3
- data/test_rails_app/app/models/television_time_slot.rb +0 -11
- data/test_rails_app/app/models/user.rb +0 -14
- data/test_rails_app/app/views/admin/appointments/_subject_input.html.erb +0 -2
- data/test_rails_app/app/views/admin/appointments2/_time_input.html.erb +0 -31
- data/test_rails_app/app/views/admin/blog_posts2/_after_form.html.erb +0 -5
- data/test_rails_app/app/views/admin/blog_posts2/_after_index.html.erb +0 -1
- data/test_rails_app/app/views/admin/blog_posts2/_after_tags_input.html.erb +0 -16
- data/test_rails_app/app/views/admin/blog_posts2/_before_index.html.erb +0 -2
- data/test_rails_app/app/views/admin/blog_posts5/_after_index_header.html.erb +0 -8
- data/test_rails_app/app/views/admin/blog_posts_read_only/_body_for_show.html.erb +0 -1
- data/test_rails_app/app/views/admin/products/_name_input.html.erb +0 -2
- data/test_rails_app/app/views/admin/products/_percent_off_input.html.erb +0 -2
- data/test_rails_app/app/views/admin/products/_price_input.html.erb +0 -10
- data/test_rails_app/app/views/blog_posts/show.html.erb +0 -13
- data/test_rails_app/app/views/layouts/admin.html.erb +0 -31
- data/test_rails_app/config/boot.rb +0 -109
- data/test_rails_app/config/database.yml +0 -28
- data/test_rails_app/config/environment.rb +0 -78
- data/test_rails_app/config/environments/development.rb +0 -17
- data/test_rails_app/config/environments/production.rb +0 -24
- data/test_rails_app/config/environments/test.rb +0 -24
- data/test_rails_app/config/initializers/inflections.rb +0 -10
- data/test_rails_app/config/initializers/mime_types.rb +0 -5
- data/test_rails_app/config/initializers/new_rails_defaults.rb +0 -17
- data/test_rails_app/config/locales/en.yml +0 -5
- data/test_rails_app/config/routes.rb +0 -43
- data/test_rails_app/db/migrate/20090213215514_create_blog_posts.rb +0 -12
- data/test_rails_app/db/migrate/20090217225542_add_body_to_blog_posts.rb +0 -9
- data/test_rails_app/db/migrate/20090221220917_create_tags.rb +0 -13
- data/test_rails_app/db/migrate/20090221220947_create_blog_post_tags.rb +0 -14
- data/test_rails_app/db/migrate/20090222162204_add_textile_to_blog_posts.rb +0 -9
- data/test_rails_app/db/migrate/20090222163231_add_published_at_to_blog_posts.rb +0 -9
- data/test_rails_app/db/migrate/20090301191722_create_images.rb +0 -16
- data/test_rails_app/db/migrate/20090305165345_create_accounts.rb +0 -14
- data/test_rails_app/db/migrate/20090307225027_rename_accounts_to_users.rb +0 -9
- data/test_rails_app/db/migrate/20090307225750_add_user_id_to_blog_posts.rb +0 -9
- data/test_rails_app/db/migrate/20090309185114_change_blog_posts_textile.rb +0 -9
- data/test_rails_app/db/migrate/20090309193635_create_products.rb +0 -14
- data/test_rails_app/db/migrate/20090309203056_create_comments.rb +0 -15
- data/test_rails_app/db/migrate/20090323005947_create_file_column_images.rb +0 -12
- data/test_rails_app/db/migrate/20090326160049_add_birthday_to_users.rb +0 -9
- data/test_rails_app/db/migrate/20090326223606_add_state_to_users.rb +0 -9
- data/test_rails_app/db/migrate/20090503134004_add_file_column_image_to_products.rb +0 -9
- data/test_rails_app/db/migrate/20090617173651_create_bookmarks.rb +0 -15
- data/test_rails_app/db/migrate/20090624165355_add_tags_string_to_blog_post.rb +0 -9
- data/test_rails_app/db/migrate/20090625144313_add_avatar_fields_to_user.rb +0 -11
- data/test_rails_app/db/migrate/20090629202956_add_merged_into_to_blog_posts.rb +0 -9
- data/test_rails_app/db/migrate/20090701171857_add_force_textile_to_users.rb +0 -9
- data/test_rails_app/db/migrate/20090704163647_add_deleted_at_to_products.rb +0 -9
- data/test_rails_app/db/migrate/20090704173800_add_sale_fields_to_products.rb +0 -13
- data/test_rails_app/db/migrate/20090714024501_create_product_categories.rb +0 -15
- data/test_rails_app/db/migrate/20090819162835_add_admin_level_to_users.rb +0 -9
- data/test_rails_app/db/migrate/20091115134559_add_first_and_last_names_to_users.rb +0 -11
- data/test_rails_app/db/migrate/20091221011256_add_position_to_product_categories.rb +0 -9
- data/test_rails_app/db/migrate/20091222160814_create_appointments.rb +0 -14
- data/test_rails_app/db/migrate/20091227224547_add_user_id_to_appointments.rb +0 -9
- data/test_rails_app/db/migrate/20100214213359_create_television_time_slots.rb +0 -13
- data/test_rails_app/db/migrate/20100214213451_create_television_airings.rb +0 -15
- data/test_rails_app/doc/README_FOR_APP +0 -5
- data/test_rails_app/lib/tasks/rspec.rake +0 -163
- data/test_rails_app/public/404.html +0 -30
- data/test_rails_app/public/422.html +0 -30
- data/test_rails_app/public/500.html +0 -33
- data/test_rails_app/public/dispatch.cgi +0 -10
- data/test_rails_app/public/dispatch.fcgi +0 -24
- data/test_rails_app/public/dispatch.rb +0 -10
- data/test_rails_app/public/favicon.ico +0 -0
- data/test_rails_app/public/images/rails.png +0 -0
- data/test_rails_app/public/index.html +0 -274
- data/test_rails_app/public/javascripts/application.js +0 -2
- data/test_rails_app/public/javascripts/controls.js +0 -963
- data/test_rails_app/public/javascripts/dragdrop.js +0 -973
- data/test_rails_app/public/javascripts/effects.js +0 -1128
- data/test_rails_app/public/javascripts/prototype.js +0 -4320
- data/test_rails_app/public/robots.txt +0 -5
- data/test_rails_app/public/stylesheets/admin.css +0 -3
- data/test_rails_app/public/stylesheets/scaffold.css +0 -54
- data/test_rails_app/script/about +0 -4
- data/test_rails_app/script/autospec +0 -5
- data/test_rails_app/script/console +0 -3
- data/test_rails_app/script/dbconsole +0 -3
- data/test_rails_app/script/destroy +0 -3
- data/test_rails_app/script/generate +0 -3
- data/test_rails_app/script/performance/benchmarker +0 -3
- data/test_rails_app/script/performance/profiler +0 -3
- data/test_rails_app/script/performance/request +0 -3
- data/test_rails_app/script/plugin +0 -3
- data/test_rails_app/script/populate_tables.rb +0 -49
- data/test_rails_app/script/process/inspector +0 -3
- data/test_rails_app/script/process/reaper +0 -3
- data/test_rails_app/script/process/spawner +0 -3
- data/test_rails_app/script/runner +0 -3
- data/test_rails_app/script/server +0 -3
- data/test_rails_app/script/spec +0 -5
- data/test_rails_app/script/spec_server +0 -125
- data/test_rails_app/spec/controllers/admin/appointments2_controller_spec.rb +0 -88
- data/test_rails_app/spec/controllers/admin/appointments_controller_spec.rb +0 -419
- data/test_rails_app/spec/controllers/admin/blog_posts2_controller_spec.rb +0 -1021
- data/test_rails_app/spec/controllers/admin/blog_posts3_controller_spec.rb +0 -532
- data/test_rails_app/spec/controllers/admin/blog_posts4_controller_spec.rb +0 -231
- data/test_rails_app/spec/controllers/admin/blog_posts5_controller_spec.rb +0 -77
- data/test_rails_app/spec/controllers/admin/blog_posts6_controller_spec.rb +0 -49
- data/test_rails_app/spec/controllers/admin/blog_posts_controller_spec.rb +0 -987
- data/test_rails_app/spec/controllers/admin/blog_posts_custom_new_and_edit_controller_spec.rb +0 -99
- data/test_rails_app/spec/controllers/admin/blog_posts_read_only_controller_spec.rb +0 -94
- data/test_rails_app/spec/controllers/admin/bookmarks_controller_spec.rb +0 -505
- data/test_rails_app/spec/controllers/admin/comments2_controller_spec.rb +0 -70
- data/test_rails_app/spec/controllers/admin/comments_controller_spec.rb +0 -82
- data/test_rails_app/spec/controllers/admin/file_column_images2_controller_spec.rb +0 -25
- data/test_rails_app/spec/controllers/admin/file_column_images_controller_spec.rb +0 -82
- data/test_rails_app/spec/controllers/admin/images2_controller_spec.rb +0 -44
- data/test_rails_app/spec/controllers/admin/images_controller_spec.rb +0 -97
- data/test_rails_app/spec/controllers/admin/misconfigured1_controller_spec.rb +0 -21
- data/test_rails_app/spec/controllers/admin/not_migrated_yets_controller_spec.rb +0 -10
- data/test_rails_app/spec/controllers/admin/product_categories2_controller_spec.rb +0 -215
- data/test_rails_app/spec/controllers/admin/product_categories_controller_spec.rb +0 -19
- data/test_rails_app/spec/controllers/admin/products2_controller_spec.rb +0 -203
- data/test_rails_app/spec/controllers/admin/products_controller_spec.rb +0 -255
- data/test_rails_app/spec/controllers/admin/television_airings_controller_spec.rb +0 -32
- data/test_rails_app/spec/controllers/admin/television_time_slots_controller_spec.rb +0 -10
- data/test_rails_app/spec/controllers/admin/users2_controller_spec.rb +0 -65
- data/test_rails_app/spec/controllers/admin/users_controller_spec.rb +0 -344
- data/test_rails_app/spec/controllers/blog_posts_controller_spec.rb +0 -13
- data/test_rails_app/spec/data/ruby_throated.jpg +0 -0
- data/test_rails_app/spec/data/tweenbot.jpg +0 -0
- data/test_rails_app/spec/fixtures/appointments.yml +0 -9
- data/test_rails_app/spec/fixtures/blog_post_tags.yml +0 -9
- data/test_rails_app/spec/fixtures/blog_posts.yml +0 -7
- data/test_rails_app/spec/fixtures/bookmarks.yml +0 -11
- data/test_rails_app/spec/fixtures/comments.yml +0 -11
- data/test_rails_app/spec/fixtures/file_column_images.yml +0 -7
- data/test_rails_app/spec/fixtures/images.yml +0 -7
- data/test_rails_app/spec/fixtures/not_migrated_yets.yml +0 -7
- data/test_rails_app/spec/fixtures/product_categories.yml +0 -7
- data/test_rails_app/spec/fixtures/products.yml +0 -9
- data/test_rails_app/spec/fixtures/tags.yml +0 -7
- data/test_rails_app/spec/fixtures/television_airings.yml +0 -11
- data/test_rails_app/spec/fixtures/television_time_slots.yml +0 -7
- data/test_rails_app/spec/fixtures/users.yml +0 -9
- data/test_rails_app/spec/helpers/admin/appointments2_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/appointments_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/blog_posts2_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/blog_posts3_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/blog_posts4_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/blog_posts_custom_new_and_edit_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/blog_posts_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/blog_posts_read_only_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/bookmarks_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/comments2_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/comments_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/file_column_images2_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/file_column_images_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/images2_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/images_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/misconfigured1_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/not_migrated_yets_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/product_categories2_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/product_categories_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/products2_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/products_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/television_airings_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/television_time_slots_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/users2_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/admin/users_helper_spec.rb +0 -11
- data/test_rails_app/spec/helpers/blog_posts_helper_spec.rb +0 -11
- data/test_rails_app/spec/models/appointment_spec.rb +0 -16
- data/test_rails_app/spec/models/blog_post_spec.rb +0 -13
- data/test_rails_app/spec/models/blog_post_tag_spec.rb +0 -14
- data/test_rails_app/spec/models/bookmark_spec.rb +0 -15
- data/test_rails_app/spec/models/comment_spec.rb +0 -15
- data/test_rails_app/spec/models/file_column_image_spec.rb +0 -12
- data/test_rails_app/spec/models/image_spec.rb +0 -12
- data/test_rails_app/spec/models/not_migrated_yet_spec.rb +0 -15
- data/test_rails_app/spec/models/product_category_spec.rb +0 -15
- data/test_rails_app/spec/models/product_spec.rb +0 -14
- data/test_rails_app/spec/models/tag_spec.rb +0 -13
- data/test_rails_app/spec/models/television_airing_spec.rb +0 -15
- data/test_rails_app/spec/models/television_time_slot_spec.rb +0 -13
- data/test_rails_app/spec/models/user_spec.rb +0 -14
- data/test_rails_app/spec/rcov.opts +0 -2
- data/test_rails_app/spec/spec.opts +0 -4
- data/test_rails_app/spec/spec_helper.rb +0 -88
- data/test_rails_app/spec/spec_or_test_helper.rb +0 -49
- data/test_rails_app/test/fixtures/file_column_images.yml +0 -7
- data/test_rails_app/test/integration/admin_blog_posts2_integration_test.rb +0 -16
- data/test_rails_app/test/integration/admin_blog_posts5_integration_test.rb +0 -19
- data/test_rails_app/test/integration/admin_blog_posts_integration_test.rb +0 -25
- data/test_rails_app/test/test_helper.rb +0 -28
- data/test_rails_app/vendor/plugins/file_column/CHANGELOG +0 -69
- data/test_rails_app/vendor/plugins/file_column/README +0 -54
- data/test_rails_app/vendor/plugins/file_column/Rakefile +0 -36
- data/test_rails_app/vendor/plugins/file_column/TODO +0 -6
- data/test_rails_app/vendor/plugins/file_column/init.rb +0 -13
- data/test_rails_app/vendor/plugins/file_column/lib/file_column.rb +0 -723
- data/test_rails_app/vendor/plugins/file_column/lib/file_column_helper.rb +0 -150
- data/test_rails_app/vendor/plugins/file_column/lib/file_compat.rb +0 -28
- data/test_rails_app/vendor/plugins/file_column/lib/magick_file_column.rb +0 -260
- data/test_rails_app/vendor/plugins/file_column/lib/rails_file_column.rb +0 -19
- data/test_rails_app/vendor/plugins/file_column/lib/test_case.rb +0 -124
- data/test_rails_app/vendor/plugins/file_column/lib/validations.rb +0 -112
- data/test_rails_app/vendor/plugins/file_column/test/abstract_unit.rb +0 -63
- data/test_rails_app/vendor/plugins/file_column/test/connection.rb +0 -17
- data/test_rails_app/vendor/plugins/file_column/test/file_column_helper_test.rb +0 -97
- data/test_rails_app/vendor/plugins/file_column/test/file_column_test.rb +0 -650
- data/test_rails_app/vendor/plugins/file_column/test/fixtures/entry.rb +0 -32
- data/test_rails_app/vendor/plugins/file_column/test/fixtures/invalid-image.jpg +0 -1
- data/test_rails_app/vendor/plugins/file_column/test/fixtures/kerb.jpg +0 -0
- data/test_rails_app/vendor/plugins/file_column/test/fixtures/mysql.sql +0 -25
- data/test_rails_app/vendor/plugins/file_column/test/fixtures/schema.rb +0 -10
- data/test_rails_app/vendor/plugins/file_column/test/fixtures/skanthak.png +0 -0
- data/test_rails_app/vendor/plugins/file_column/test/magick_test.rb +0 -380
- data/test_rails_app/vendor/plugins/file_column/test/magick_view_only_test.rb +0 -21
@@ -1,419 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Admin::AppointmentsController do
|
4
|
-
integrate_views
|
5
|
-
|
6
|
-
describe '#create with 2 new appointments' do
|
7
|
-
before :all do
|
8
|
-
User.destroy_all
|
9
|
-
@user1 = User.create! :username => random_word
|
10
|
-
@user2 = User.create! :username => random_word
|
11
|
-
end
|
12
|
-
|
13
|
-
before :each do
|
14
|
-
Appointment.destroy_all
|
15
|
-
post(
|
16
|
-
:create,
|
17
|
-
:appointment => {
|
18
|
-
'a' => {
|
19
|
-
'subject' => 'Lunch with Dick', 'time(1i)' => '2010',
|
20
|
-
'time(2i)' => '1', 'time(3i)' => '4', 'time(4i)' => '12',
|
21
|
-
'time(5i)' => '00', 'user_id' => @user1.id
|
22
|
-
},
|
23
|
-
'b' => {
|
24
|
-
'subject' => '', 'time(1i)' => '', 'time(2i)' => '',
|
25
|
-
'time(3i)' => '', 'time(4i)' => '', 'time(5i)' => ''
|
26
|
-
},
|
27
|
-
'c' => {
|
28
|
-
'subject' => 'Dinner with Jane', 'time(1i)' => '2010',
|
29
|
-
'time(2i)' => '1', 'time(3i)' => '6', 'time(4i)' => '20',
|
30
|
-
'time(5i)' => '00', 'user_id' => @user2.id
|
31
|
-
},
|
32
|
-
'd' => {
|
33
|
-
'subject' => '', 'time(1i)' => '', 'time(2i)' => '',
|
34
|
-
'time(3i)' => '', 'time(4i)' => '', 'time(5i)' => ''
|
35
|
-
},
|
36
|
-
'e' => {
|
37
|
-
'subject' => '', 'time(1i)' => '', 'time(2i)' => '',
|
38
|
-
'time(3i)' => '', 'time(4i)' => '', 'time(5i)' => ''
|
39
|
-
},
|
40
|
-
'f' => {
|
41
|
-
'subject' => '', 'time(1i)' => '', 'time(2i)' => '',
|
42
|
-
'time(3i)' => '', 'time(4i)' => '', 'time(5i)' => ''
|
43
|
-
},
|
44
|
-
'g' => {
|
45
|
-
'subject' => '', 'time(1i)' => '', 'time(2i)' => '',
|
46
|
-
'time(3i)' => '', 'time(4i)' => '', 'time(5i)' => ''
|
47
|
-
},
|
48
|
-
'h' => {
|
49
|
-
'subject' => '', 'time(1i)' => '', 'time(2i)' => '',
|
50
|
-
'time(3i)' => '', 'time(4i)' => '', 'time(5i)' => ''
|
51
|
-
},
|
52
|
-
'i' => {
|
53
|
-
'subject' => '', 'time(1i)' => '', 'time(2i)' => '',
|
54
|
-
'time(3i)' => '', 'time(4i)' => '', 'time(5i)' => ''
|
55
|
-
},
|
56
|
-
'j' => {
|
57
|
-
'subject' => '', 'time(1i)' => '', 'time(2i)' => '',
|
58
|
-
'time(3i)' => '', 'time(4i)' => '', 'time(5i)' => ''
|
59
|
-
}
|
60
|
-
}
|
61
|
-
)
|
62
|
-
response.should_not be_error
|
63
|
-
end
|
64
|
-
|
65
|
-
it 'should create those two new appointments' do
|
66
|
-
Appointment.count.should == 2
|
67
|
-
Appointment.all.any? { |appt|
|
68
|
-
appt.subject == 'Lunch with Dick' and
|
69
|
-
appt.time == Time.utc(2010, 1, 4, 12, 0) and appt.user == @user1
|
70
|
-
}.should be_true
|
71
|
-
Appointment.all.any? { |appt|
|
72
|
-
appt.subject == 'Dinner with Jane' and
|
73
|
-
appt.time == Time.utc(2010, 1, 6, 20, 0) and appt.user == @user2
|
74
|
-
}.should be_true
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
describe '#create while missing a user_id' do
|
79
|
-
before :each do
|
80
|
-
post(
|
81
|
-
:create,
|
82
|
-
:appointment => {
|
83
|
-
'a' => {
|
84
|
-
'subject' => 'Lunch with Dick', 'time(1i)' => '2010',
|
85
|
-
'time(2i)' => '1', 'time(3i)' => '4', 'time(4i)' => '12',
|
86
|
-
'time(5i)' => '00', 'user_id' => ''
|
87
|
-
},
|
88
|
-
'b' => {
|
89
|
-
'subject' => '', 'time(1i)' => '', 'time(2i)' => '',
|
90
|
-
'time(3i)' => '', 'time(4i)' => '', 'time(5i)' => ''
|
91
|
-
},
|
92
|
-
'c' => {
|
93
|
-
'subject' => '', 'time(1i)' => '', 'time(2i)' => '',
|
94
|
-
'time(3i)' => '', 'time(4i)' => '', 'time(5i)' => ''
|
95
|
-
},
|
96
|
-
'd' => {
|
97
|
-
'subject' => '', 'time(1i)' => '', 'time(2i)' => '',
|
98
|
-
'time(3i)' => '', 'time(4i)' => '', 'time(5i)' => ''
|
99
|
-
},
|
100
|
-
'e' => {
|
101
|
-
'subject' => '', 'time(1i)' => '', 'time(2i)' => '',
|
102
|
-
'time(3i)' => '', 'time(4i)' => '', 'time(5i)' => ''
|
103
|
-
},
|
104
|
-
'f' => {
|
105
|
-
'subject' => '', 'time(1i)' => '', 'time(2i)' => '',
|
106
|
-
'time(3i)' => '', 'time(4i)' => '', 'time(5i)' => ''
|
107
|
-
},
|
108
|
-
'g' => {
|
109
|
-
'subject' => '', 'time(1i)' => '', 'time(2i)' => '',
|
110
|
-
'time(3i)' => '', 'time(4i)' => '', 'time(5i)' => ''
|
111
|
-
},
|
112
|
-
'h' => {
|
113
|
-
'subject' => '', 'time(1i)' => '', 'time(2i)' => '',
|
114
|
-
'time(3i)' => '', 'time(4i)' => '', 'time(5i)' => ''
|
115
|
-
},
|
116
|
-
'i' => {
|
117
|
-
'subject' => '', 'time(1i)' => '', 'time(2i)' => '',
|
118
|
-
'time(3i)' => '', 'time(4i)' => '', 'time(5i)' => ''
|
119
|
-
},
|
120
|
-
'j' => {
|
121
|
-
'subject' => '', 'time(1i)' => '', 'time(2i)' => '',
|
122
|
-
'time(3i)' => '', 'time(4i)' => '', 'time(5i)' => ''
|
123
|
-
}
|
124
|
-
}
|
125
|
-
)
|
126
|
-
response.should_not be_error
|
127
|
-
end
|
128
|
-
|
129
|
-
it 'should show an error for user_id' do
|
130
|
-
response.should be_success
|
131
|
-
response.body.should match(/User can't be blank/)
|
132
|
-
end
|
133
|
-
end
|
134
|
-
|
135
|
-
describe '#index' do
|
136
|
-
before :all do
|
137
|
-
user = User.first
|
138
|
-
user || User.create!(:username => random_word)
|
139
|
-
if Appointment.count == 0
|
140
|
-
Appointment.create!(
|
141
|
-
:subject => 'Lunch', :time => Time.utc(2010,2,18,13,0,0),
|
142
|
-
:user => user
|
143
|
-
)
|
144
|
-
end
|
145
|
-
end
|
146
|
-
|
147
|
-
before :each do
|
148
|
-
get :index
|
149
|
-
end
|
150
|
-
|
151
|
-
it 'should show a search range widget' do
|
152
|
-
response.should have_tag('form#search_form') do
|
153
|
-
%w(gt lt).each do |comparator|
|
154
|
-
1.upto(5) do |num|
|
155
|
-
name = "search[time][#{comparator}(#{num}i)]"
|
156
|
-
with_tag('select[name=?]', name) do
|
157
|
-
with_tag "option[value='']"
|
158
|
-
end
|
159
|
-
end
|
160
|
-
end
|
161
|
-
end
|
162
|
-
end
|
163
|
-
end
|
164
|
-
|
165
|
-
describe '#index when searching for an appointment after a specific time' do
|
166
|
-
before :all do
|
167
|
-
@user = User.first
|
168
|
-
@user ||= User.create! :username => random_word
|
169
|
-
@yesterday = 1.day.ago.to_date.to_time.utc
|
170
|
-
@yesterdays_appt = Appointment.find_by_time @yesterday
|
171
|
-
@yesterdays_appt ||= Appointment.create!(
|
172
|
-
:subject => random_word, :user => @user, :time => @yesterday
|
173
|
-
)
|
174
|
-
@today = Time.now.to_date.to_time.utc
|
175
|
-
@todays_appt = Appointment.find_by_time @today
|
176
|
-
@todays_appt ||= Appointment.create!(
|
177
|
-
:subject => random_word, :user => @user, :time => @today
|
178
|
-
)
|
179
|
-
@tomorrow = 1.day.from_now.to_date.to_time.utc
|
180
|
-
@tomorrows_appt = Appointment.find_by_time @tomorrow
|
181
|
-
@tomorrows_appt ||= Appointment.create!(
|
182
|
-
:subject => random_word, :user => @user, :time => @tomorrow
|
183
|
-
)
|
184
|
-
end
|
185
|
-
|
186
|
-
before :each do
|
187
|
-
get(
|
188
|
-
:index,
|
189
|
-
:search => {:time => {
|
190
|
-
'gt(1i)' => @today.year, 'gt(2i)' => @today.month,
|
191
|
-
'gt(3i)' => @today.day, 'gt(4i)' => @today.hour, 'gt(5i)' => '00',
|
192
|
-
'lt(1i)' => '', 'lt(2i)' => '', 'lt(3i)' => '', 'lt(4i)' => '',
|
193
|
-
'lt(5i)' => ''
|
194
|
-
}}
|
195
|
-
)
|
196
|
-
response.should be_success
|
197
|
-
end
|
198
|
-
|
199
|
-
it 'should prefill the search form fields' do
|
200
|
-
response.should have_tag('form#search_form') do
|
201
|
-
with_tag('select[name=?]', 'search[time][gt(1i)]') do
|
202
|
-
with_tag('option[value=?][selected=selected]', @today.year)
|
203
|
-
end
|
204
|
-
with_tag('select[name=?]', 'search[time][gt(2i)]') do
|
205
|
-
with_tag('option[value=?][selected=selected]', @today.month)
|
206
|
-
end
|
207
|
-
with_tag('select[name=?]', 'search[time][gt(3i)]') do
|
208
|
-
with_tag('option[value=?][selected=selected]', @today.day)
|
209
|
-
end
|
210
|
-
with_tag('select[name=?]', 'search[time][gt(4i)]') do
|
211
|
-
with_tag(
|
212
|
-
'option[value=?][selected=selected]', sprintf('%02d', @today.hour)
|
213
|
-
)
|
214
|
-
end
|
215
|
-
with_tag('select[name=?]', 'search[time][gt(5i)]') do
|
216
|
-
with_tag('option[value=?][selected=selected]', '00')
|
217
|
-
end
|
218
|
-
end
|
219
|
-
end
|
220
|
-
|
221
|
-
it 'should not show an appointment before that time' do
|
222
|
-
response.should_not have_tag('td', :text => @yesterdays_appt.subject)
|
223
|
-
end
|
224
|
-
|
225
|
-
it 'should not show an appointment equal to that time' do
|
226
|
-
response.should_not have_tag('td', :text => @todays_appt.subject)
|
227
|
-
end
|
228
|
-
|
229
|
-
it 'should show an appointment after that time' do
|
230
|
-
response.should have_tag('td', :text => @tomorrows_appt.subject)
|
231
|
-
end
|
232
|
-
end
|
233
|
-
|
234
|
-
describe '#index when searching for an appointment before a specific time' do
|
235
|
-
before :all do
|
236
|
-
Appointment.destroy_all if Appointment.count > 20
|
237
|
-
@user = User.first
|
238
|
-
@user ||= User.create! :username => random_word
|
239
|
-
@yesterday = 1.day.ago.to_date.to_time.utc
|
240
|
-
@yesterdays_appt = Appointment.find_by_time @yesterday
|
241
|
-
@yesterdays_appt ||= Appointment.create!(
|
242
|
-
:subject => random_word, :user => @user, :time => @yesterday
|
243
|
-
)
|
244
|
-
@today = Time.now.to_date.to_time.utc
|
245
|
-
@todays_appt = Appointment.find_by_time @today
|
246
|
-
@todays_appt ||= Appointment.create!(
|
247
|
-
:subject => random_word, :user => @user, :time => @today
|
248
|
-
)
|
249
|
-
@tomorrow = 1.day.from_now.to_date.to_time.utc
|
250
|
-
@tomorrows_appt = Appointment.find_by_time @tomorrow
|
251
|
-
@tomorrows_appt ||= Appointment.create!(
|
252
|
-
:subject => random_word, :user => @user, :time => @tomorrow
|
253
|
-
)
|
254
|
-
end
|
255
|
-
|
256
|
-
before :each do
|
257
|
-
get(
|
258
|
-
:index,
|
259
|
-
:search => {:time => {
|
260
|
-
'gt(1i)' => '', 'gt(2i)' => '', 'gt(3i)' => '', 'gt(4i)' => '',
|
261
|
-
'gt(5i)' => '', 'lt(1i)' => @today.year, 'lt(2i)' => @today.month,
|
262
|
-
'lt(3i)' => @today.day, 'lt(4i)' => @today.hour, 'lt(5i)' => '00'
|
263
|
-
}}
|
264
|
-
)
|
265
|
-
response.should be_success
|
266
|
-
end
|
267
|
-
|
268
|
-
it 'should prefill the search form fields' do
|
269
|
-
response.should have_tag('form#search_form') do
|
270
|
-
with_tag('select[name=?]', 'search[time][lt(1i)]') do
|
271
|
-
with_tag('option[value=?][selected=selected]', @today.year)
|
272
|
-
end
|
273
|
-
with_tag('select[name=?]', 'search[time][lt(2i)]') do
|
274
|
-
with_tag('option[value=?][selected=selected]', @today.month)
|
275
|
-
end
|
276
|
-
with_tag('select[name=?]', 'search[time][lt(3i)]') do
|
277
|
-
with_tag('option[value=?][selected=selected]', @today.day)
|
278
|
-
end
|
279
|
-
with_tag('select[name=?]', 'search[time][lt(4i)]') do
|
280
|
-
with_tag(
|
281
|
-
'option[value=?][selected=selected]', sprintf('%02d', @today.hour)
|
282
|
-
)
|
283
|
-
end
|
284
|
-
with_tag('select[name=?]', 'search[time][lt(5i)]') do
|
285
|
-
with_tag('option[value=?][selected=selected]', '00')
|
286
|
-
end
|
287
|
-
end
|
288
|
-
end
|
289
|
-
|
290
|
-
it 'should show an appointment before that time' do
|
291
|
-
response.should have_tag('td', :text => @yesterdays_appt.subject)
|
292
|
-
end
|
293
|
-
|
294
|
-
it 'should not show an appointment equal to that time' do
|
295
|
-
response.should_not have_tag('td', :text => @todays_appt.subject)
|
296
|
-
end
|
297
|
-
|
298
|
-
it 'should not show an appointment after that time' do
|
299
|
-
response.should_not have_tag('td', :text => @tomorrows_appt.subject)
|
300
|
-
end
|
301
|
-
end
|
302
|
-
|
303
|
-
describe '#index when searching for an appointment within a time range' do
|
304
|
-
before :all do
|
305
|
-
Appointment.destroy_all if Appointment.count > 20
|
306
|
-
@user = User.first
|
307
|
-
@user ||= User.create! :username => random_word
|
308
|
-
@yesterday = 1.day.ago.to_date.to_time.utc
|
309
|
-
@yesterdays_appt = Appointment.find_by_time @yesterday
|
310
|
-
@yesterdays_appt ||= Appointment.create!(
|
311
|
-
:subject => random_word, :user => @user, :time => @yesterday
|
312
|
-
)
|
313
|
-
@today = Time.now.to_date.to_time.utc
|
314
|
-
@todays_appt = Appointment.find_by_time @today
|
315
|
-
@todays_appt ||= Appointment.create!(
|
316
|
-
:subject => random_word, :user => @user, :time => @today
|
317
|
-
)
|
318
|
-
@tomorrow = 1.day.from_now.to_date.to_time.utc
|
319
|
-
@tomorrows_appt = Appointment.find_by_time @tomorrow
|
320
|
-
@tomorrows_appt ||= Appointment.create!(
|
321
|
-
:subject => random_word, :user => @user, :time => @tomorrow
|
322
|
-
)
|
323
|
-
end
|
324
|
-
|
325
|
-
before :each do
|
326
|
-
get(
|
327
|
-
:index,
|
328
|
-
:search => {:time => {
|
329
|
-
'gt(1i)' => @yesterday.year, 'gt(2i)' => @yesterday.month,
|
330
|
-
'gt(3i)' => @yesterday.day, 'gt(4i)' => @yesterday.hour,
|
331
|
-
'gt(5i)' => '', 'lt(1i)' => @tomorrow.year,
|
332
|
-
'lt(2i)' => @tomorrow.month, 'lt(3i)' => @tomorrow.day,
|
333
|
-
'lt(4i)' => @tomorrow.hour, 'lt(5i)' => '00'
|
334
|
-
}}
|
335
|
-
)
|
336
|
-
response.should be_success
|
337
|
-
end
|
338
|
-
|
339
|
-
it 'should prefill the search form fields' do
|
340
|
-
response.should have_tag('form#search_form') do
|
341
|
-
with_tag('select[name=?]', 'search[time][gt(1i)]') do
|
342
|
-
with_tag('option[value=?][selected=selected]', @yesterday.year)
|
343
|
-
end
|
344
|
-
with_tag('select[name=?]', 'search[time][gt(2i)]') do
|
345
|
-
with_tag('option[value=?][selected=selected]', @yesterday.month)
|
346
|
-
end
|
347
|
-
with_tag('select[name=?]', 'search[time][gt(3i)]') do
|
348
|
-
with_tag('option[value=?][selected=selected]', @yesterday.day)
|
349
|
-
end
|
350
|
-
with_tag('select[name=?]', 'search[time][gt(4i)]') do
|
351
|
-
with_tag(
|
352
|
-
'option[value=?][selected=selected]',
|
353
|
-
sprintf('%02d', @yesterday.hour)
|
354
|
-
)
|
355
|
-
end
|
356
|
-
with_tag('select[name=?]', 'search[time][gt(5i)]') do
|
357
|
-
with_tag('option[value=?][selected=selected]', '00')
|
358
|
-
end
|
359
|
-
with_tag('select[name=?]', 'search[time][lt(1i)]') do
|
360
|
-
with_tag('option[value=?][selected=selected]', @tomorrow.year)
|
361
|
-
end
|
362
|
-
with_tag('select[name=?]', 'search[time][lt(2i)]') do
|
363
|
-
with_tag('option[value=?][selected=selected]', @tomorrow.month)
|
364
|
-
end
|
365
|
-
with_tag('select[name=?]', 'search[time][lt(3i)]') do
|
366
|
-
with_tag('option[value=?][selected=selected]', @tomorrow.day)
|
367
|
-
end
|
368
|
-
with_tag('select[name=?]', 'search[time][lt(4i)]') do
|
369
|
-
with_tag(
|
370
|
-
'option[value=?][selected=selected]',
|
371
|
-
sprintf('%02d', @tomorrow.hour)
|
372
|
-
)
|
373
|
-
end
|
374
|
-
with_tag('select[name=?]', 'search[time][lt(5i)]') do
|
375
|
-
with_tag('option[value=?][selected=selected]', '00')
|
376
|
-
end
|
377
|
-
end
|
378
|
-
end
|
379
|
-
|
380
|
-
it 'should not show an appointment before that range' do
|
381
|
-
response.should_not have_tag('td', :text => @yesterdays_appt.subject)
|
382
|
-
end
|
383
|
-
|
384
|
-
it 'should show an appointment in that range' do
|
385
|
-
response.should have_tag('td', :text => @todays_appt.subject)
|
386
|
-
end
|
387
|
-
|
388
|
-
it 'should not show an appointment after that range' do
|
389
|
-
response.should_not have_tag('td', :text => @tomorrows_appt.subject)
|
390
|
-
end
|
391
|
-
end
|
392
|
-
|
393
|
-
describe '#new' do
|
394
|
-
before :all do
|
395
|
-
User.destroy_all
|
396
|
-
@user = User.create! :username => random_word
|
397
|
-
end
|
398
|
-
|
399
|
-
before :each do
|
400
|
-
get :new
|
401
|
-
end
|
402
|
-
|
403
|
-
it 'should show prefixes in the subject field' do
|
404
|
-
response.should have_tag('td', :text => /Prefix a/) do
|
405
|
-
with_tag('input[name=?]', 'appointment[a][subject]')
|
406
|
-
end
|
407
|
-
end
|
408
|
-
|
409
|
-
it 'should sensibly prefix the datetime fields' do
|
410
|
-
response.should have_tag('select[name=?]', 'appointment[a][time(1i)]')
|
411
|
-
end
|
412
|
-
|
413
|
-
it 'should include a user selector' do
|
414
|
-
response.should have_tag('select[name=?]', 'appointment[a][user_id]') do
|
415
|
-
with_tag 'option[value=?]', @user.id, :text => /#{@user.username}/
|
416
|
-
end
|
417
|
-
end
|
418
|
-
end
|
419
|
-
end
|