muck-services 0.1.47 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -1
- data/LICENSE +1 -1
- data/README.rdoc +32 -48
- data/Rakefile +14 -16
- data/VERSION +1 -1
- data/app/controllers/admin/muck/feeds_controller.rb +1 -1
- data/app/controllers/muck/aggregations_controller.rb +4 -6
- data/app/controllers/muck/feed_previews_controller.rb +2 -10
- data/app/controllers/muck/feeds_controller.rb +1 -1
- data/app/controllers/muck/identity_feeds_controller.rb +2 -6
- data/app/controllers/muck/topics_controller.rb +3 -3
- data/app/controllers/muck/visits_controller.rb +3 -3
- data/app/helpers/muck_services_feeds_helper.rb +3 -3
- data/app/helpers/muck_services_service_helper.rb +2 -2
- data/app/models/aggregation.rb +4 -18
- data/app/models/entry.rb +2 -2
- data/app/models/feed.rb +7 -9
- data/app/models/oai_endpoint.rb +6 -6
- data/app/models/personal_recommendation.rb +4 -5
- data/app/models/service.rb +6 -6
- data/app/models/service_category.rb +1 -1
- data/app/models/services_mailer.rb +10 -12
- data/app/views/activity_templates/{_entry_comment.html.erb → _entry_comment.erb} +0 -0
- data/app/views/activity_templates/{_entry_share.html.erb → _entry_share.erb} +0 -0
- data/app/views/admin/feeds/index.html.erb +8 -9
- data/app/views/admin/oai_endpoints/index.html.erb +4 -4
- data/app/views/aggregations/{_feeds.html.erb → _feeds.erb} +0 -0
- data/app/views/aggregations/edit.html.erb +3 -3
- data/app/views/aggregations/index.html.erb +1 -1
- data/app/views/aggregations/new.html.erb +1 -1
- data/app/views/aggregations/preview.html.erb +1 -1
- data/app/views/feed_previews/{new.html.erb → new.erb} +0 -0
- data/app/views/feed_previews/{select_feeds.html.erb → select_feeds.erb} +0 -0
- data/app/views/feeds/_feed.html.erb +1 -1
- data/app/views/feeds/_feed_row.html.erb +1 -1
- data/app/views/feeds/_form.html.erb +2 -2
- data/app/views/feeds/edit.html.erb +2 -2
- data/app/views/feeds/index.html.erb +7 -8
- data/app/views/feeds/new.html.erb +2 -2
- data/app/views/feeds/new_extended.html.erb +2 -2
- data/app/views/feeds/new_oai_rss.html.erb +2 -2
- data/app/views/identity_feeds/{_form.html.erb → _form.erb} +1 -1
- data/app/views/oai_endpoints/_form.html.erb +2 -2
- data/app/views/oai_endpoints/_oai_endpoint_row.html.erb +1 -1
- data/app/views/parts/_add_feed.html.erb +1 -1
- data/app/views/services_mailer/{notification_feed_added.text.html.erb → notification_feed_added.html.erb} +0 -0
- data/app/views/services_mailer/{notification_feed_added.text.plain.erb → notification_feed_added.text.erb} +0 -0
- data/app/views/services_mailer/{notification_oai_endpoint_added.text.html.erb → notification_oai_endpoint_added.html.erb} +0 -0
- data/app/views/services_mailer/{notification_oai_endpoint_added.text.plain.erb → notification_oai_endpoint_added.text.erb} +0 -0
- data/app/views/topics/_form.html.erb +1 -1
- data/app/views/topics/new.html.erb +1 -1
- data/app/views/visits/_toolbar.html.erb +3 -3
- data/{locales → config/locales}/ar.yml +34 -34
- data/{locales → config/locales}/bg.yml +34 -34
- data/{locales → config/locales}/ca.yml +34 -34
- data/{locales → config/locales}/cs.yml +34 -34
- data/{locales → config/locales}/da.yml +34 -34
- data/{locales → config/locales}/de.yml +34 -34
- data/{locales → config/locales}/el.yml +34 -34
- data/{locales → config/locales}/en.yml +34 -36
- data/{locales → config/locales}/es.yml +34 -34
- data/{locales → config/locales}/et.yml +34 -34
- data/{locales → config/locales}/fa.yml +34 -34
- data/{locales → config/locales}/fi.yml +34 -34
- data/{locales → config/locales}/fr.yml +34 -34
- data/{locales → config/locales}/gl.yml +34 -34
- data/{locales → config/locales}/hi.yml +34 -34
- data/{locales → config/locales}/hr.yml +34 -34
- data/{locales → config/locales}/hu.yml +34 -34
- data/{locales → config/locales}/id.yml +34 -34
- data/{locales → config/locales}/it.yml +34 -34
- data/{locales → config/locales}/iw.yml +34 -34
- data/{locales → config/locales}/ja.yml +34 -34
- data/{locales → config/locales}/ko.yml +34 -34
- data/{locales → config/locales}/lt.yml +34 -34
- data/{locales → config/locales}/lv.yml +34 -34
- data/{locales → config/locales}/mt.yml +34 -34
- data/{locales → config/locales}/nl.yml +34 -34
- data/{locales → config/locales}/no.yml +34 -34
- data/{locales → config/locales}/pl.yml +34 -34
- data/{locales → config/locales}/pt-PT.yml +34 -34
- data/{locales → config/locales}/ro.yml +34 -34
- data/{locales → config/locales}/ru.yml +34 -34
- data/{locales → config/locales}/sk.yml +34 -34
- data/{locales → config/locales}/sl.yml +34 -34
- data/{locales → config/locales}/sq.yml +34 -34
- data/{locales → config/locales}/sr.yml +34 -34
- data/{locales → config/locales}/sv.yml +34 -34
- data/{locales → config/locales}/th.yml +34 -34
- data/{locales → config/locales}/tl.yml +34 -34
- data/{locales → config/locales}/tr.yml +34 -34
- data/{locales → config/locales}/uk.yml +34 -34
- data/{locales → config/locales}/vi.yml +34 -34
- data/{locales → config/locales}/zh-CN.yml +34 -34
- data/{locales → config/locales}/zh-TW.yml +34 -34
- data/{locales → config/locales}/zh.yml +34 -34
- data/config/routes.rb +73 -0
- data/lib/muck-services.rb +24 -0
- data/lib/muck-services/config.rb +36 -0
- data/lib/muck-services/engine.rb +32 -0
- data/lib/{muck_services → muck-services}/exceptions.rb +0 -0
- data/lib/{muck_services → muck-services}/languages.rb +0 -0
- data/lib/muck-services/models/aggregation_owner.rb +17 -0
- data/lib/muck-services/models/feed_owner.rb +24 -0
- data/lib/muck-services/models/feed_parent.rb +18 -0
- data/lib/muck-services/models/recommendation.rb +14 -0
- data/lib/muck-services/models/recommendation_owner.rb +15 -0
- data/lib/muck-services/models/services_comment.rb +24 -0
- data/lib/muck-services/models/services_share.rb +18 -0
- data/lib/{muck_services → muck-services}/muck_custom_form_builder.rb +1 -3
- data/lib/{muck_services → muck-services}/services.rb +0 -0
- data/lib/tasks/muck_services.rake +101 -0
- data/muck-services.gemspec +364 -520
- data/test/{rails_root → rails_test}/app/controllers/application_controller.rb +1 -9
- data/test/{rails_root → rails_test}/app/controllers/default_controller.rb +0 -0
- data/test/{rails_root → rails_test}/app/helpers/application_helper.rb +0 -0
- data/test/{rails_root → rails_test}/app/models/activity.rb +1 -1
- data/test/{rails_root → rails_test}/app/models/comment.rb +3 -3
- data/test/rails_test/app/models/country.rb +13 -0
- data/test/rails_test/app/models/language.rb +15 -0
- data/test/{rails_root → rails_test}/app/models/share.rb +3 -3
- data/test/rails_test/app/models/state.rb +13 -0
- data/test/{rails_root → rails_test}/app/models/user.rb +8 -8
- data/test/{rails_root → rails_test}/app/models/user_session.rb +0 -0
- data/test/rails_test/config/application.rb +42 -0
- data/test/rails_test/config/boot.rb +13 -0
- data/test/rails_test/config/environment.rb +5 -0
- data/test/rails_test/config/environments/development.rb +26 -0
- data/test/rails_test/config/environments/production.rb +49 -0
- data/test/rails_test/config/environments/test.rb +35 -0
- data/test/rails_test/config/initializers/backtrace_silencers.rb +7 -0
- data/test/{rails_root → rails_test}/config/initializers/inflections.rb +2 -2
- data/test/rails_test/config/initializers/mce_options.rb +83 -0
- data/test/{rails_root → rails_test}/config/initializers/mime_types.rb +0 -0
- data/test/rails_test/config/initializers/muck.rb +66 -0
- data/test/rails_test/config/initializers/secret_token.rb +7 -0
- data/test/rails_test/config/initializers/session_store.rb +8 -0
- data/test/rails_test/config/routes.rb +12 -0
- data/test/{rails_root → rails_test}/db/migrate/20090320174818_create_muck_permissions_and_roles.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090327231918_create_users.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090402033319_add_muck_activities.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090402234137_create_languages.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090426041056_create_countries.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090426041103_create_states.rb +0 -0
- data/test/rails_test/db/migrate/20090512013727_create_profiles.rb +21 -0
- data/test/rails_test/db/migrate/20090517040220_create_uploads.rb +38 -0
- data/test/{rails_root → rails_test}/db/migrate/20090602191243_create_muck_raker.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090613173314_create_comments.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090619211125_create_tag_clouds.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090623181458_add_grain_size_to_entries.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090623193525_add_grain_size_to_tag_clouds.rb +0 -0
- data/test/rails_test/db/migrate/20090703055724_add_contents.rb +49 -0
- data/test/{rails_root → rails_test}/db/migrate/20090703175825_denormalize_entries_subjects.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090704220055_create_slugs.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090716035935_change_tag_cloud_grain_sizes.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090717173900_add_contributor_to_feeds.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090717175825_normalize_entries_subjects.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090721043213_change_services_title_to_name.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090721054927_remove_services_not_null_from_feeds.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090723050510_create_feed_parents.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090728165716_add_etag_to_feeds.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090730044139_add_comment_cache.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090730045848_add_comment_cache_to_entries.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090730154102_allow_null_user.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090803185323_create_shares.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090804184247_add_comment_count_to_shares.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090804211240_add_entry_id_to_shares.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090804231857_add_shares_uri_index.rb +0 -0
- data/test/rails_test/db/migrate/20090806230610_add_layout_to_contents.rb +9 -0
- data/test/rails_test/db/migrate/20090808175401_add_contents_comment_counter_cache.rb +9 -0
- data/test/{rails_root → rails_test}/db/migrate/20090818204527_add_activity_indexes.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090819030523_add_attachable_to_activities.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090826220530_change_services_sequence_to_sort.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090826225652_create_identity_feeds.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090827005105_add_identity_fields_to_services.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090827015308_create_service_categories.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090827221502_add_prompt_and_template_to_services.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090915041650_aggregations_to_polymorphic.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090922174200_update_oai_endpoints.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090922231552_add_dates_to_oai_endpoints.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090923150807_rename_name_in_aggregation.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20090924200750_add_uri_data_template_to_services.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20091006183742_add_feed_count_to_aggregation.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20091022150615_add_uri_key_to_services.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20091115011828_add_aggregations_for_personal_recs.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20091116094447_rename_action_table.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20091118203605_add_default_feed_type_to_aggregation_feed.rb +0 -0
- data/test/rails_test/db/migrate/20091124203137_add_location_to_profiles.rb +15 -0
- data/test/rails_test/db/migrate/20091124205819_add_fields_to_profiles.rb +21 -0
- data/test/{rails_root → rails_test}/db/migrate/20100123035450_create_access_codes.rb +0 -0
- data/test/{rails_root → rails_test}/db/migrate/20100123233654_create_access_code_requests.rb +0 -0
- data/test/rails_test/db/migrate/20100206000906_remove_name_fields.rb +15 -0
- data/test/rails_test/db/migrate/20100903205928_add_dead_entry_fields.rb +13 -0
- data/test/{rails_root → rails_test}/features/step_definitions/common_steps.rb +0 -0
- data/test/{rails_root → rails_test}/features/step_definitions/visit_steps.rb +0 -0
- data/test/rails_test/features/step_definitions/web_steps.rb +219 -0
- data/test/{rails_root → rails_test}/features/step_definitions/webrat_steps.rb +0 -0
- data/test/rails_test/features/support/custom_env.rb +19 -0
- data/test/rails_test/features/support/env.rb +58 -0
- data/test/rails_test/features/support/paths.rb +33 -0
- data/test/rails_test/lib/daemons/amazonaws.rb +36 -0
- data/test/{rails_root → rails_test}/public/dispatch.rb +0 -0
- data/test/rails_test/spec/controllers/admin/feeds_controller_spec.rb +38 -0
- data/test/rails_test/spec/controllers/admin/oai_endpoints_controller_spec.rb +30 -0
- data/test/{rails_root/test/functional/aggregation_feeds_controller_test.rb → rails_test/spec/controllers/aggregation_feeds_controller_spec.rb} +24 -24
- data/test/rails_test/spec/controllers/aggregations_controller_spec.rb +89 -0
- data/test/rails_test/spec/controllers/feed_previews_controller_spec.rb +32 -0
- data/test/rails_test/spec/controllers/feeds_controller_spec.rb +78 -0
- data/test/{rails_root/test/functional/identity_feeds_controller_test.rb → rails_test/spec/controllers/identity_feeds_controller_spec.rb} +44 -44
- data/test/rails_test/spec/controllers/oai_endpoints_controller_spec.rb +42 -0
- data/test/rails_test/spec/controllers/topics_controller_spec.rb +50 -0
- data/test/rails_test/spec/controllers/visits_controller_spec.rb +21 -0
- data/test/{rails_root/test → rails_test/spec}/factories.rb +6 -1
- data/test/rails_test/spec/mailers/services_mailer_spec.rb +31 -0
- data/test/{rails_root/test/unit/aggregation_feed_test.rb → rails_test/spec/models/aggregation_feed_spec.rb} +6 -9
- data/test/{rails_root/test/unit/aggregation_test.rb → rails_test/spec/models/aggregation_spec.rb} +23 -23
- data/test/{rails_root/test/unit/entry_test.rb → rails_test/spec/models/entry_spec.rb} +70 -74
- data/test/{rails_root/test/unit/feed_parent_test.rb → rails_test/spec/models/feed_parent_spec.rb} +5 -5
- data/test/{rails_root/test/unit/feed_test.rb → rails_test/spec/models/feed_spec.rb} +77 -81
- data/test/{rails_root/test/unit/identity_feed_test.rb → rails_test/spec/models/identity_feed_spec.rb} +5 -5
- data/test/rails_test/spec/models/oai_endpoint_spec.rb +78 -0
- data/test/rails_test/spec/models/personal_recommendation_spec.rb +60 -0
- data/test/{rails_root/test/unit/recommendation_test.rb → rails_test/spec/models/recommendation_spec.rb} +6 -8
- data/test/rails_test/spec/models/service_category_spec.rb +19 -0
- data/test/rails_test/spec/models/service_spec.rb +383 -0
- data/test/{rails_root/test/unit/share_test.rb → rails_test/spec/models/share_spec.rb} +8 -11
- data/test/{rails_root/test/unit/tag_cloud_test.rb → rails_test/spec/models/tag_cloud_spec.rb} +4 -4
- data/test/{rails_root/test/unit/user_test.rb → rails_test/spec/models/user_spec.rb} +9 -11
- data/test/{rails_root/test/test_helper.rb → rails_test/spec/spec_helper.rb} +8 -19
- metadata +345 -470
- data/app/views/services_mailer/notification_feed_added.text.ar.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.ar.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.bg.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.bg.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.ca.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.ca.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.cs.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.cs.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.da.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.da.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.de.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.de.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.el.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.el.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.es.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.es.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.et.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.et.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.fa.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.fa.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.fi.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.fi.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.fr.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.fr.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.gl.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.gl.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.hi.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.hi.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.hr.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.hr.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.hu.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.hu.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.id.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.id.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.it.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.it.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.iw.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.iw.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.ja.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.ja.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.ko.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.ko.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.lt.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.lt.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.lv.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.lv.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.mt.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.mt.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.nl.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.nl.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.no.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.no.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.pl.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.pl.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.pt-PT.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.pt-PT.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.ro.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.ro.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.ru.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.ru.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.sk.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.sk.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.sl.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.sl.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.sq.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.sq.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.sr.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.sr.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.sv.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.sv.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.th.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.th.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.tl.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.tl.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.tr.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.tr.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.uk.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.uk.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.vi.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.vi.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.zh-CN.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.zh-CN.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.zh-TW.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.zh-TW.plain.erb +0 -7
- data/app/views/services_mailer/notification_feed_added.text.zh.html.erb +0 -4
- data/app/views/services_mailer/notification_feed_added.text.zh.plain.erb +0 -7
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ar.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ar.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.bg.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.bg.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ca.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ca.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.cs.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.cs.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.da.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.da.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.de.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.de.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.el.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.el.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.es.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.es.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.et.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.et.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.fa.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.fa.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.fi.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.fi.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.fr.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.fr.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.gl.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.gl.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.hi.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.hi.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.hr.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.hr.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.hu.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.hu.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.id.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.id.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.it.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.it.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.iw.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.iw.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ja.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ja.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ko.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ko.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.lt.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.lt.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.lv.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.lv.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.mt.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.mt.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.nl.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.nl.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.no.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.no.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.pl.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.pl.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.pt-PT.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.pt-PT.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ro.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ro.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ru.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.ru.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sk.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sk.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sl.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sl.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sq.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sq.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sr.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sr.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sv.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.sv.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.th.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.th.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.tl.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.tl.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.tr.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.tr.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.uk.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.uk.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.vi.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.vi.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.zh-CN.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.zh-CN.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.zh-TW.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.zh-TW.plain.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.zh.html.erb +0 -4
- data/app/views/services_mailer/notification_oai_endpoint_added.text.zh.plain.erb +0 -4
- data/config/muck_services_routes.rb +0 -43
- data/lib/active_record/acts/muck_aggregation_owner.rb +0 -30
- data/lib/active_record/acts/muck_feed_owner.rb +0 -36
- data/lib/active_record/acts/muck_feed_parent.rb +0 -23
- data/lib/active_record/acts/muck_recommendations.rb +0 -24
- data/lib/active_record/acts/muck_services_comment.rb +0 -40
- data/lib/active_record/acts/muck_services_share.rb +0 -32
- data/lib/muck_services.rb +0 -23
- data/lib/muck_services/initialize_routes.rb +0 -8
- data/lib/muck_services/tasks.rb +0 -117
- data/rails/init.rb +0 -18
- data/test/rails_root/config/boot.rb +0 -109
- data/test/rails_root/config/environment.rb +0 -41
- data/test/rails_root/config/environments/cucumber.rb +0 -21
- data/test/rails_root/config/environments/development.rb +0 -37
- data/test/rails_root/config/environments/production.rb +0 -1
- data/test/rails_root/config/environments/test.rb +0 -24
- data/test/rails_root/config/initializers/requires.rb +0 -13
- data/test/rails_root/config/initializers/session_store.rb +0 -8
- data/test/rails_root/config/routes.rb +0 -11
- data/test/rails_root/db/schema.rb +0 -504
- data/test/rails_root/features/support/env.rb +0 -14
- data/test/rails_root/features/support/paths.rb +0 -36
- data/test/rails_root/script/create_project.rb +0 -52
- data/test/rails_root/test/functional/admin/feeds_controller_test.rb +0 -37
- data/test/rails_root/test/functional/admin/oai_endpoints_controller_test.rb +0 -30
- data/test/rails_root/test/functional/aggregations_controller_test.rb +0 -89
- data/test/rails_root/test/functional/feed_previews_controller_test.rb +0 -32
- data/test/rails_root/test/functional/feeds_controller_test.rb +0 -78
- data/test/rails_root/test/functional/oai_endpoints_controller_test.rb +0 -42
- data/test/rails_root/test/functional/topics_controller_test.rb +0 -50
- data/test/rails_root/test/functional/visits_controller_test.rb +0 -21
- data/test/rails_root/test/unit/comment_test.rb +0 -38
- data/test/rails_root/test/unit/oai_endpoint_test.rb +0 -84
- data/test/rails_root/test/unit/personal_recommendation_test.rb +0 -78
- data/test/rails_root/test/unit/service_category_test.rb +0 -19
- data/test/rails_root/test/unit/service_test.rb +0 -386
- data/test/rails_root/test/unit/services_mailer_test.rb +0 -35
- data/test/rails_root/vendor/plugins/jrails/init.rb +0 -1
- data/test/rails_root/vendor/plugins/jrails/install.rb +0 -9
- data/test/rails_root/vendor/plugins/jrails/lib/jrails.rb +0 -421
- data/test/rails_root/vendor/plugins/jrails/rails/init.rb +0 -15
- data/test/rails_root/vendor/plugins/ssl_requirement/lib/ssl_requirement.rb +0 -62
- data/test/rails_root/vendor/plugins/ssl_requirement/test/ssl_requirement_test.rb +0 -132
@@ -1,21 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
-
|
3
|
-
class Muck::VisitsControllerTest < ActionController::TestCase
|
4
|
-
|
5
|
-
tests Muck::VisitsController
|
6
|
-
|
7
|
-
context "visits controller" do
|
8
|
-
|
9
|
-
context "GET show" do
|
10
|
-
setup do
|
11
|
-
@entry = Factory(:entry)
|
12
|
-
get :show, :id => @entry.to_param, :format => 'html'
|
13
|
-
end
|
14
|
-
should_not_set_the_flash
|
15
|
-
should_respond_with :success
|
16
|
-
should_render_template :show
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
# == Schema Information
|
2
|
-
#
|
3
|
-
# Table name: comments
|
4
|
-
#
|
5
|
-
# id :integer(4) not null, primary key
|
6
|
-
# commentable_id :integer(4) default(0)
|
7
|
-
# commentable_type :string(15) default("")
|
8
|
-
# body :text
|
9
|
-
# user_id :integer(4)
|
10
|
-
# parent_id :integer(4)
|
11
|
-
# lft :integer(4)
|
12
|
-
# rgt :integer(4)
|
13
|
-
# is_denied :integer(4) default(0), not null
|
14
|
-
# is_reviewed :boolean(1)
|
15
|
-
# created_at :datetime
|
16
|
-
# updated_at :datetime
|
17
|
-
#
|
18
|
-
|
19
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
20
|
-
|
21
|
-
class CommentTest < ActiveSupport::TestCase
|
22
|
-
|
23
|
-
context "comment instance" do
|
24
|
-
|
25
|
-
context "activities" do
|
26
|
-
setup do
|
27
|
-
@entry = Factory(:entry)
|
28
|
-
@user = Factory(:user)
|
29
|
-
end
|
30
|
-
should "add comment activity" do
|
31
|
-
assert_difference "Activity.count", 1 do
|
32
|
-
Comment.create(Factory.attributes_for(:comment, :commentable => @entry, :user => @user))
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
@@ -1,84 +0,0 @@
|
|
1
|
-
# == Schema Information
|
2
|
-
#
|
3
|
-
# Table name: oai_endpoints
|
4
|
-
#
|
5
|
-
# id :integer(4) not null, primary key
|
6
|
-
# uri :string(2083)
|
7
|
-
# display_uri :string(2083)
|
8
|
-
# metadata_prefix :string(255)
|
9
|
-
# title :string(1000)
|
10
|
-
# short_title :string(100)
|
11
|
-
# contributor_id :integer(4)
|
12
|
-
# status :integer(4)
|
13
|
-
# default_language_id :integer(4)
|
14
|
-
# created_at :datetime
|
15
|
-
# updated_at :datetime
|
16
|
-
#
|
17
|
-
|
18
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
19
|
-
|
20
|
-
# Used to test muck_content_permission
|
21
|
-
class OaiEndpointTest < ActiveSupport::TestCase
|
22
|
-
|
23
|
-
context "An oai endpoint instance" do
|
24
|
-
setup do
|
25
|
-
@oai_endpoint = Factory(:oai_endpoint)
|
26
|
-
end
|
27
|
-
|
28
|
-
subject { @oai_endpoint }
|
29
|
-
|
30
|
-
should_belong_to :contributor
|
31
|
-
should_belong_to :default_language
|
32
|
-
|
33
|
-
should_validate_presence_of :uri
|
34
|
-
|
35
|
-
should_scope_by_title
|
36
|
-
should_scope_recent
|
37
|
-
should_scope_by_newest
|
38
|
-
|
39
|
-
context "named scope" do
|
40
|
-
context "banned" do
|
41
|
-
# named_scope :banned, :conditions => ["status = ?", MuckServices::Status::BANNED]
|
42
|
-
setup do
|
43
|
-
@oai_endpoint = Factory(:oai_endpoint, :status => MuckServices::Status::BANNED)
|
44
|
-
@oai_endpoint_not = Factory(:oai_endpoint)
|
45
|
-
end
|
46
|
-
should "find oai_endpoints that are banned" do
|
47
|
-
assert OaiEndpoint.banned.include?(@oai_endpoint)
|
48
|
-
end
|
49
|
-
should "not find oai_endpoints that are not banned" do
|
50
|
-
assert !OaiEndpoint.banned.include?(@oai_endpoint_not)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
context "valid" do
|
54
|
-
# named_scope :valid, :conditions => "status >= 0", :include => [:default_language]
|
55
|
-
setup do
|
56
|
-
@oai_endpoint = Factory(:oai_endpoint, :status => 0)
|
57
|
-
@oai_endpoint_not = Factory(:oai_endpoint, :status => MuckServices::Status::BANNED)
|
58
|
-
end
|
59
|
-
should "find valid oai_endpoints" do
|
60
|
-
assert OaiEndpoint.valid.include?(@oai_endpoint)
|
61
|
-
end
|
62
|
-
should "not find invalid oai_endpoints" do
|
63
|
-
assert !OaiEndpoint.valid.include?(@oai_endpoint_not)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
end
|
69
|
-
|
70
|
-
context "banned/unbanned" do
|
71
|
-
setup do
|
72
|
-
@oai_endpoint = Factory(:oai_endpoint)
|
73
|
-
end
|
74
|
-
should "be banned" do
|
75
|
-
@oai_endpoint.status = -1
|
76
|
-
assert @oai_endpoint.banned?
|
77
|
-
end
|
78
|
-
should "not be banned" do
|
79
|
-
@oai_endpoint.status = 0
|
80
|
-
assert !@oai_endpoint.banned?
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
end
|
@@ -1,78 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
-
|
3
|
-
class PersonalRecommendationTest < ActiveSupport::TestCase
|
4
|
-
context "personal recommendations" do
|
5
|
-
setup do
|
6
|
-
@user = Factory(:user)
|
7
|
-
end
|
8
|
-
|
9
|
-
context "has_muck_recommendations" do
|
10
|
-
setup do
|
11
|
-
@entry = Factory(:entry)
|
12
|
-
end
|
13
|
-
should "create a personal recommendation" do
|
14
|
-
recommendation = @user.personal_recommendations.build(:destination => @entry)
|
15
|
-
assert recommendation.save
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
context "acts_as_muck_recommendation" do
|
20
|
-
setup do
|
21
|
-
@recommended_user = Factory(:user)
|
22
|
-
end
|
23
|
-
should "make user recommended" do
|
24
|
-
recommendation = @user.personal_recommendations.create(:destination => @recommended_user)
|
25
|
-
assert @recommended_user.recommended_to.include?(recommendation)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
context "named scopes" do
|
30
|
-
setup do
|
31
|
-
@entry = Factory(:entry)
|
32
|
-
@entry_old = Factory(:entry)
|
33
|
-
@recommended_user = Factory(:user)
|
34
|
-
@entry_recommendation = @user.personal_recommendations.create(:destination => @entry)
|
35
|
-
@user_recommendation = @user.personal_recommendations.create(:destination => @recommended_user, :created_at => 1.day.ago)
|
36
|
-
@old_recommendation = @user.personal_recommendations.create(:destination => @entry_old, :created_at => 3.weeks.ago)
|
37
|
-
end
|
38
|
-
|
39
|
-
context "entries" do
|
40
|
-
should "return an entry" do
|
41
|
-
assert @user.personal_recommendations.entries_only.include?(@entry_recommendation)
|
42
|
-
end
|
43
|
-
should "not return a user" do
|
44
|
-
assert !@user.personal_recommendations.entries_only.include?(@user_recommendation)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
context "users" do
|
48
|
-
should "return an user" do
|
49
|
-
assert @user.personal_recommendations.users.include?(@user_recommendation)
|
50
|
-
end
|
51
|
-
should "not return an entry" do
|
52
|
-
assert !@user.personal_recommendations.users.include?(@entry_recommendation)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
context "limited" do
|
56
|
-
should "only return a limited number of recommendations" do
|
57
|
-
assert_equal 1, @user.personal_recommendations.limit(1).length
|
58
|
-
end
|
59
|
-
end
|
60
|
-
context "recent" do
|
61
|
-
should "return recent recommendations" do
|
62
|
-
assert @user.personal_recommendations.recent.include?(@entry_recommendation)
|
63
|
-
end
|
64
|
-
should "not return old recommendations" do
|
65
|
-
assert !@user.personal_recommendations.recent.include?(@old_recommendation)
|
66
|
-
end
|
67
|
-
end
|
68
|
-
context "newest" do
|
69
|
-
should "order recommendations by newest" do
|
70
|
-
recommendations = @user.personal_recommendations.newest
|
71
|
-
assert recommendations[0].created_at > recommendations[1].created_at
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
end
|
76
|
-
|
77
|
-
end
|
78
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# == Schema Information
|
2
|
-
#
|
3
|
-
# Table name: service_categories
|
4
|
-
#
|
5
|
-
# id :integer(4) not null, primary key
|
6
|
-
# name :string(255) not null
|
7
|
-
# sort :integer(4) default(0)
|
8
|
-
#
|
9
|
-
|
10
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
11
|
-
|
12
|
-
class ServiceCategoryTest < ActiveSupport::TestCase
|
13
|
-
|
14
|
-
context "service category instance" do
|
15
|
-
should_have_many :services
|
16
|
-
should_scope_sorted
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
@@ -1,386 +0,0 @@
|
|
1
|
-
# == Schema Information
|
2
|
-
#
|
3
|
-
# Table name: services
|
4
|
-
#
|
5
|
-
# id :integer(4) not null, primary key
|
6
|
-
# uri :string(2083) default("")
|
7
|
-
# name :string(1000) default("")
|
8
|
-
# api_uri :string(2083) default("")
|
9
|
-
# uri_template :string(2083) default("")
|
10
|
-
# icon :string(2083) default("rss.gif")
|
11
|
-
# sort :integer(4)
|
12
|
-
# requires_password :boolean(1)
|
13
|
-
# use_for :string(255)
|
14
|
-
# service_category_id :integer(4)
|
15
|
-
# active :boolean(1) default(TRUE)
|
16
|
-
# prompt :string(255)
|
17
|
-
# template :string(255)
|
18
|
-
# uri_data_template :string(2083) default("")
|
19
|
-
# uri_key :string(255)
|
20
|
-
#
|
21
|
-
|
22
|
-
require File.dirname(__FILE__) + '/../test_helper'
|
23
|
-
|
24
|
-
class ServiceTest < ActiveSupport::TestCase
|
25
|
-
|
26
|
-
context "service instance" do
|
27
|
-
|
28
|
-
should_belong_to :service_category
|
29
|
-
should_scope_sorted
|
30
|
-
|
31
|
-
context "named scope" do
|
32
|
-
context "identity_services" do
|
33
|
-
# named_scope :identity_services, :conditions => ['use_for = ?', 'identity']
|
34
|
-
setup do
|
35
|
-
@service = Factory(:service, :use_for => 'identity')
|
36
|
-
@service_not = Factory(:service, :use_for => 'not')
|
37
|
-
end
|
38
|
-
should "find services that have use_for=='identity_services'" do
|
39
|
-
assert Service.identity_services.include?(@service)
|
40
|
-
end
|
41
|
-
should "not find services that where use_for!='identity_services'" do
|
42
|
-
assert !Service.identity_services.include?(@service_not)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
context "tag_services" do
|
46
|
-
# named_scope :tag_services, :conditions => ['use_for = ?', 'tags']
|
47
|
-
setup do
|
48
|
-
@service = Factory(:service, :use_for => 'tags')
|
49
|
-
@service_not = Factory(:service, :use_for => 'not')
|
50
|
-
end
|
51
|
-
should "find services that have use_for=='tags'" do
|
52
|
-
assert Service.tag_services.include?(@service)
|
53
|
-
end
|
54
|
-
should "not find services that where use_for!='tags'" do
|
55
|
-
assert !Service.tag_services.include?(@service_not)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
context "sorted_id" do
|
59
|
-
# named_scope :sorted_id, :order => "id ASC"
|
60
|
-
setup do
|
61
|
-
Service.delete_all
|
62
|
-
@first = Factory(:service)
|
63
|
-
@second = Factory(:service)
|
64
|
-
end
|
65
|
-
should "sort by 'sort' field" do
|
66
|
-
assert_equal @first, Service.sorted_id[0]
|
67
|
-
assert_equal @second, Service.sorted_id[1]
|
68
|
-
end
|
69
|
-
end
|
70
|
-
context "photo_services" do
|
71
|
-
# named_scope :photo_services, :conditions => ["service_categories.id = services.service_category_id AND service_categories.name = 'Photos'"], :include => ['service_category']
|
72
|
-
setup do
|
73
|
-
@service_category = Factory(:service_category, :name => 'Photos')
|
74
|
-
@service = Factory(:service, :service_category => @service_category)
|
75
|
-
@service_not = Factory(:service)
|
76
|
-
end
|
77
|
-
should "find services that have 'Photos' for a service category" do
|
78
|
-
assert Service.photo_services.include?(@service)
|
79
|
-
end
|
80
|
-
should "not find services that don't have 'Photos' for a service category" do
|
81
|
-
assert !Service.photo_services.include?(@service_not)
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
context "photos" do
|
87
|
-
setup do
|
88
|
-
service_category = Factory(:service_category, :name => 'Photos')
|
89
|
-
@service = Factory(:service, :service_category_id => service_category.id)
|
90
|
-
end
|
91
|
-
should "be a photo service" do
|
92
|
-
assert @service.photo?(true)
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
context "videos" do
|
97
|
-
setup do
|
98
|
-
service_category = Factory(:service_category, :name => 'Videos')
|
99
|
-
@service = Factory(:service, :service_category_id => service_category.id)
|
100
|
-
end
|
101
|
-
should "be a video service" do
|
102
|
-
assert @service.video?(true)
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
context "bookmarks" do
|
107
|
-
setup do
|
108
|
-
service_category = Factory(:service_category, :name => 'Bookmarks')
|
109
|
-
@service = Factory(:service, :service_category_id => service_category.id)
|
110
|
-
end
|
111
|
-
should "be a bookmark service" do
|
112
|
-
assert @service.bookmark?(true)
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
context "music" do
|
117
|
-
setup do
|
118
|
-
service_category = Factory(:service_category, :name => 'Music')
|
119
|
-
@service = Factory(:service, :service_category_id => service_category.id)
|
120
|
-
end
|
121
|
-
should "be a music service" do
|
122
|
-
assert @service.music?(true)
|
123
|
-
end
|
124
|
-
end
|
125
|
-
|
126
|
-
context "news" do
|
127
|
-
setup do
|
128
|
-
service_category = Factory(:service_category, :name => 'News')
|
129
|
-
@service = Factory(:service, :service_category_id => service_category.id)
|
130
|
-
end
|
131
|
-
should "be a news service" do
|
132
|
-
assert @service.news?(true)
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
context "blog" do
|
137
|
-
setup do
|
138
|
-
service_category = Factory(:service_category, :name => 'Blogging')
|
139
|
-
@service = Factory(:service, :service_category_id => service_category.id)
|
140
|
-
end
|
141
|
-
should "be a blog service" do
|
142
|
-
assert @service.blog?(true)
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
|
-
context "search" do
|
147
|
-
setup do
|
148
|
-
service_category = Factory(:service_category, :name => 'Search')
|
149
|
-
@service = Factory(:service, :service_category_id => service_category.id)
|
150
|
-
end
|
151
|
-
should "be a search service" do
|
152
|
-
assert @service.search?(true)
|
153
|
-
end
|
154
|
-
end
|
155
|
-
|
156
|
-
context "general" do
|
157
|
-
setup do
|
158
|
-
service_category = Factory(:service_category, :name => 'RSS')
|
159
|
-
@service = Factory(:service, :service_category_id => service_category.id)
|
160
|
-
end
|
161
|
-
should "be a general service" do
|
162
|
-
assert @service.general?(true)
|
163
|
-
end
|
164
|
-
end
|
165
|
-
|
166
|
-
end
|
167
|
-
|
168
|
-
context "identity services" do
|
169
|
-
should "generate uri using blog url" do
|
170
|
-
service = Factory(:service)
|
171
|
-
uris = service.generate_uris('', '', TEST_URI)
|
172
|
-
assert uris.map(&:url).include?(TEST_RSS_URI)
|
173
|
-
end
|
174
|
-
should "generate uri using username" do
|
175
|
-
service = Factory(:service, :uri_data_template => TEST_USERNAME_TEMPLATE)
|
176
|
-
uris = service.generate_uris('jbasdf', '', '')
|
177
|
-
assert uris.map(&:url).include?(TEST_USERNAME_TEMPLATE.sub('{username}', 'jbasdf'))
|
178
|
-
end
|
179
|
-
should "get twitter uri from username" do
|
180
|
-
service = Factory(:service, :uri_data_template => "http://www.twitter.com/{username}")
|
181
|
-
uris = service.generate_uris('jbasdf', '', '')
|
182
|
-
assert uris.map(&:url).include?("http://twitter.com/statuses/user_timeline/7219042.rss")
|
183
|
-
end
|
184
|
-
end
|
185
|
-
|
186
|
-
context "tag services" do
|
187
|
-
setup do
|
188
|
-
@user = Factory(:user)
|
189
|
-
@template = "http://example.com/{tag}.rss"
|
190
|
-
@uri_template = "http://example.com/{tag}"
|
191
|
-
@service = Factory(:service, :uri_data_template => @template, :uri_template => @uri_template, :use_for => 'tags')
|
192
|
-
end
|
193
|
-
should "generate urls for tag" do
|
194
|
-
tag = 'rails'
|
195
|
-
uris = Service.generate_tag_uris(tag)
|
196
|
-
assert uris.include?(@template.sub('{tag}', tag))
|
197
|
-
end
|
198
|
-
should "set display uri when building a feed" do
|
199
|
-
tag = 'identity'
|
200
|
-
feeds = Service.build_tag_feeds(tag, @user, nil, true)
|
201
|
-
assert feeds.any?{|feed| feed.display_uri == (@uri_template.sub('{tag}', tag))}
|
202
|
-
end
|
203
|
-
should "build a feed for every tag service" do
|
204
|
-
tag = 'cycling'
|
205
|
-
feeds = Service.build_tag_feeds(tag, @user, nil, true)
|
206
|
-
assert_equal Service.tag_services.length, feeds.length
|
207
|
-
assert feeds.any?{|feed| feed.uri == (@template.sub('{tag}', tag))}
|
208
|
-
end
|
209
|
-
should "build a limited number of feeds for tag" do
|
210
|
-
tag = 'ruby'
|
211
|
-
feeds = Service.build_tag_feeds(tag, @user, [@service.id], true)
|
212
|
-
assert_equal 1, feeds.length
|
213
|
-
assert feeds.any?{|feed| feed.uri == (@template.sub('{tag}', tag))}
|
214
|
-
end
|
215
|
-
should "create a feed for every tag service" do
|
216
|
-
tag = 'physics'
|
217
|
-
feeds = Service.create_tag_feeds(tag, @user, nil, true)
|
218
|
-
assert_equal Service.tag_services.length, feeds.length
|
219
|
-
assert feeds.any?{|feed| feed.uri == (@template.sub('{tag}', tag))}
|
220
|
-
end
|
221
|
-
should "create a limited number of feeds for tag" do
|
222
|
-
tag = 'math'
|
223
|
-
feeds = Service.create_tag_feeds(tag, @user, [@service.id], true)
|
224
|
-
assert_equal 1, feeds.length
|
225
|
-
assert feeds.any?{|feed| feed.uri == (@template.sub('{tag}', tag))}
|
226
|
-
end
|
227
|
-
end
|
228
|
-
|
229
|
-
context "Create feed from service" do
|
230
|
-
setup do
|
231
|
-
@login = 'jbasdf'
|
232
|
-
@password = ''
|
233
|
-
@uri_data_template = TEST_USERNAME_TEMPLATE
|
234
|
-
@service = Factory(:service, :uri_data_template => @uri_data_template)
|
235
|
-
@user = Factory(:user)
|
236
|
-
end
|
237
|
-
should "create feed from service" do
|
238
|
-
feeds = Service.create_tag_feeds_for_service(@service, '', @login, @password, @user.id)
|
239
|
-
feed = feeds[0]
|
240
|
-
assert_equal @uri_data_template.sub("{username}", @login), feed.uri
|
241
|
-
assert_equal @login, feed.login
|
242
|
-
assert_equal @password, feed.password
|
243
|
-
assert_equal @service.id, feed.service_id
|
244
|
-
end
|
245
|
-
should "create feed from service even with nil template" do
|
246
|
-
feeds = Service.create_tag_feeds_for_service(@service, '', @login, @password, @user.id)
|
247
|
-
feed = feeds[0]
|
248
|
-
assert_equal @uri_data_template.sub("{username}", @login), feed.uri
|
249
|
-
assert_equal @login, feed.login
|
250
|
-
assert_equal @password, feed.password
|
251
|
-
assert_equal @service.id, feed.service_id
|
252
|
-
end
|
253
|
-
end
|
254
|
-
|
255
|
-
context "Find service by uri" do
|
256
|
-
setup do
|
257
|
-
Service.delete_all
|
258
|
-
end
|
259
|
-
teardown do
|
260
|
-
bootstrap_services
|
261
|
-
end
|
262
|
-
should "find service when uri is shorter" do
|
263
|
-
foo_service = Factory(:service, :uri => 'http://www.foo.com')
|
264
|
-
service = Service.find_service_by_uri('foo.com', true)
|
265
|
-
assert_equal foo_service, service
|
266
|
-
end
|
267
|
-
should "find service uri is longer" do
|
268
|
-
example_service = Factory(:service, :uri => 'http://www.example.com')
|
269
|
-
service = Service.find_service_by_uri('http://www.example.com/other_stuff', true)
|
270
|
-
assert_equal example_service, service
|
271
|
-
end
|
272
|
-
end
|
273
|
-
|
274
|
-
context "build" do
|
275
|
-
setup do
|
276
|
-
@terms = "ruby"
|
277
|
-
@user = Factory(:user)
|
278
|
-
end
|
279
|
-
context "photo feeds" do
|
280
|
-
setup do
|
281
|
-
@feeds = Service.build_photo_feeds(@terms, @user.id)
|
282
|
-
end
|
283
|
-
should "only create photo feeds" do
|
284
|
-
assert @feeds.length > 0
|
285
|
-
assert @feeds.all? { |feed| feed.service.service_category.name == "Photos" }
|
286
|
-
end
|
287
|
-
end
|
288
|
-
context "video feeds" do
|
289
|
-
setup do
|
290
|
-
@feeds = Service.build_video_feeds(@terms, @user.id)
|
291
|
-
end
|
292
|
-
should "only create video feeds" do
|
293
|
-
assert @feeds.length > 0
|
294
|
-
assert @feeds.all? { |feed| feed.service.service_category.name == "Videos" }
|
295
|
-
end
|
296
|
-
end
|
297
|
-
context "bookmark feeds" do
|
298
|
-
setup do
|
299
|
-
@feeds = Service.build_bookmark_feeds(@terms, @user.id)
|
300
|
-
end
|
301
|
-
should "only create bookmark feeds" do
|
302
|
-
assert @feeds.length > 0
|
303
|
-
assert @feeds.all? { |feed| feed.service.service_category.name == "Bookmarks" }
|
304
|
-
end
|
305
|
-
end
|
306
|
-
context "music feeds" do
|
307
|
-
setup do
|
308
|
-
build_music_service
|
309
|
-
@feeds = Service.build_music_feeds(@terms, @user.id, nil, true) # We build the music service above so we have to force a cache refresh
|
310
|
-
end
|
311
|
-
should "only create music feeds" do
|
312
|
-
assert @feeds.length > 0
|
313
|
-
assert @feeds.all? { |feed| feed.service.service_category.name == "Music" }
|
314
|
-
end
|
315
|
-
end
|
316
|
-
context "news feeds" do
|
317
|
-
setup do
|
318
|
-
@feeds = Service.build_news_feeds(@terms, @user.id, nil, true) # We build the news service above so we have to force a cache refresh
|
319
|
-
end
|
320
|
-
should "only create news feeds" do
|
321
|
-
assert @feeds.length > 0
|
322
|
-
assert @feeds.all? { |feed| feed.service.service_category.name == "News" }
|
323
|
-
end
|
324
|
-
end
|
325
|
-
context "blog feeds" do
|
326
|
-
setup do
|
327
|
-
@feeds = Service.build_blog_feeds(@terms, @user.id, nil, true) # We build the blog service above so we have to force a cache refresh
|
328
|
-
end
|
329
|
-
should "only create blog feeds" do
|
330
|
-
assert @feeds.length > 0
|
331
|
-
assert @feeds.all? { |feed| feed.service.service_category.name == "Blogging" }
|
332
|
-
end
|
333
|
-
end
|
334
|
-
context "search feeds" do
|
335
|
-
setup do
|
336
|
-
@feeds = Service.build_search_feeds(@terms, @user.id, nil, true) # We build the search service above so we have to force a cache refresh
|
337
|
-
end
|
338
|
-
should "only create search feeds" do
|
339
|
-
assert @feeds.length > 0
|
340
|
-
assert @feeds.all? { |feed| feed.service.service_category.name == "Search" }
|
341
|
-
end
|
342
|
-
end
|
343
|
-
end
|
344
|
-
|
345
|
-
context "service types" do
|
346
|
-
setup do
|
347
|
-
build_music_service
|
348
|
-
end
|
349
|
-
should "get photo services" do
|
350
|
-
assert Service.get_photo_tag_services(true).length > 0
|
351
|
-
assert Service.get_photo_tag_services.all? { |service| service.service_category.name == "Photos" }
|
352
|
-
end
|
353
|
-
should "get video services" do
|
354
|
-
assert Service.get_video_tag_services(true).length > 0
|
355
|
-
assert Service.get_video_tag_services.all? { |service| service.service_category.name == "Videos" }
|
356
|
-
end
|
357
|
-
should "get bookmark services" do
|
358
|
-
assert Service.get_bookmark_tag_services(true).length > 0
|
359
|
-
assert Service.get_bookmark_tag_services.all? { |service| service.service_category.name == "Bookmarks" }
|
360
|
-
end
|
361
|
-
should "get music services" do
|
362
|
-
assert Service.get_music_tag_services(true).length > 0
|
363
|
-
assert Service.get_music_tag_services.all? { |service| service.service_category.name == "Music" }
|
364
|
-
end
|
365
|
-
should "get news services" do
|
366
|
-
assert Service.get_news_tag_services(true).length > 0
|
367
|
-
assert Service.get_news_tag_services.all? { |service| service.service_category.name == "News" }
|
368
|
-
end
|
369
|
-
should "get blog services" do
|
370
|
-
assert Service.get_blog_tag_services(true).length > 0
|
371
|
-
assert Service.get_blog_tag_services.all? { |service| service.service_category.name == "Blogging" }
|
372
|
-
end
|
373
|
-
should "get search services" do
|
374
|
-
assert Service.get_search_tag_services(true).length > 0
|
375
|
-
assert Service.get_search_tag_services.all? { |service| service.service_category.name == "Search" }
|
376
|
-
end
|
377
|
-
should "get general services" do
|
378
|
-
assert Service.get_general_tag_services(true).length > 0
|
379
|
-
assert !Service.get_general_tag_services.any? { |service| service.service_category.name == "Photos" }
|
380
|
-
assert !Service.get_general_tag_services.any? { |service| service.service_category.name == "Videos" }
|
381
|
-
assert !Service.get_general_tag_services.any? { |service| service.service_category.name == "Bookmarks" }
|
382
|
-
assert !Service.get_general_tag_services.any? { |service| service.service_category.name == "Music" }
|
383
|
-
end
|
384
|
-
end
|
385
|
-
|
386
|
-
end
|