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,108 +1,108 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
2
2
|
|
3
|
-
|
3
|
+
describe Muck::IdentityFeedsController do
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
render_views
|
6
|
+
|
7
|
+
describe "identity feeds controller" do
|
8
8
|
|
9
|
-
|
9
|
+
before do
|
10
10
|
@user = Factory(:user)
|
11
11
|
@service = Factory(:service)
|
12
12
|
activate_authlogic
|
13
13
|
login_as @user
|
14
14
|
end
|
15
15
|
|
16
|
-
|
17
|
-
|
16
|
+
describe "GET index" do
|
17
|
+
before do
|
18
18
|
get :index, :user_id => @user.to_param
|
19
19
|
end
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
it { should_not set_the_flash }
|
21
|
+
it { should respond_with :success }
|
22
|
+
it { should render_template :index }
|
23
23
|
end
|
24
24
|
|
25
|
-
|
26
|
-
|
25
|
+
describe "GET new" do
|
26
|
+
before do
|
27
27
|
get :new, :user_id => @user.to_param, :service_id => @service.to_param
|
28
28
|
end
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
it { should_not set_the_flash }
|
30
|
+
it { should respond_with :success }
|
31
|
+
it { should render_template :new }
|
32
32
|
end
|
33
33
|
|
34
|
-
|
35
|
-
|
34
|
+
describe "POST create using bogus service and bogus uri" do
|
35
|
+
before do
|
36
36
|
@service = Factory(:service)
|
37
37
|
@uri = 'http://www.example.com'
|
38
38
|
post :create, :service_id => @service.to_param, :uri => @uri, :user_id => @user
|
39
39
|
end
|
40
|
-
|
41
|
-
|
40
|
+
it { should set_the_flash.to(I18n.t('muck.services.no_feeds_at_uri')) }
|
41
|
+
it { should redirect_to( user_identity_feeds_url(@user.id) ) }
|
42
42
|
end
|
43
43
|
|
44
|
-
|
45
|
-
|
44
|
+
describe "POST create using bogus service and username" do
|
45
|
+
before do
|
46
46
|
@service = Factory(:service)
|
47
47
|
post :create, :service_id => @service.to_param, :username => 'test', :user_id => @user, :uri => 'http://www.example.com'
|
48
48
|
end
|
49
|
-
|
50
|
-
|
49
|
+
it { should set_the_flash.to(I18n.t('muck.services.no_feeds_from_username')) }
|
50
|
+
it { should redirect_to( user_identity_feeds_url(@user.id) ) }
|
51
51
|
end
|
52
52
|
|
53
|
-
|
54
|
-
|
53
|
+
describe "POST create using uri" do
|
54
|
+
before do
|
55
55
|
@service = Factory(:service)
|
56
56
|
@uri = TEST_URI
|
57
57
|
post :create, :service_id => @service.to_param, :uri => @uri, :user_id => @user
|
58
58
|
end
|
59
|
-
should
|
59
|
+
it "should set success in the flash" do
|
60
60
|
ensure_flash_contains(I18n.t('muck.services.successfully_added_uri_feed'))
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
-
|
65
|
-
|
64
|
+
describe "POST create using valid service username" do
|
65
|
+
before do
|
66
66
|
@service = Factory(:service, :uri_data_template => TEST_USERNAME_TEMPLATE)
|
67
67
|
@username = 'jbasdf'
|
68
68
|
end
|
69
|
-
|
70
|
-
|
69
|
+
describe "html" do
|
70
|
+
before do
|
71
71
|
post :create, :service_id => @service.to_param, :username => @username, :user_id => @user, :uri => 'http://www.example.com'
|
72
72
|
end
|
73
|
-
|
74
|
-
|
73
|
+
it { should set_the_flash.to(I18n.t('muck.services.successfully_added_username_feed', :service => '')) }
|
74
|
+
it { should redirect_to( user_identity_feeds_url(@user.id) ) }
|
75
75
|
end
|
76
|
-
|
77
|
-
|
76
|
+
describe "json" do
|
77
|
+
before do
|
78
78
|
post :create, :service_id => @service.to_param, :username => @username, :user_id => @user, :format => 'json'
|
79
79
|
end
|
80
|
-
|
80
|
+
it { should respond_with :success }
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
84
|
-
|
85
|
-
|
84
|
+
describe "POST create using valid service username - duplicate" do
|
85
|
+
before do
|
86
86
|
@service = Factory(:service, :uri_data_template => TEST_USERNAME_TEMPLATE)
|
87
87
|
@username = 'jbasdf'
|
88
88
|
post :create, :service_id => @service.to_param, :username => @username, :user_id => @user, :uri => 'http://www.example.com'
|
89
89
|
post :create, :service_id => @service.to_param, :username => @username, :user_id => @user, :uri => 'http://www.example.com'
|
90
90
|
end
|
91
|
-
|
92
|
-
|
91
|
+
it { should set_the_flash.to(I18n.t('muck.services.already_added_username_feed', :service => '', :username => 'jbasdf')) } # really do have to hard code the string here. @username is nil
|
92
|
+
it { should redirect_to( user_identity_feeds_url(@user.id) ) }
|
93
93
|
end
|
94
94
|
|
95
|
-
|
96
|
-
|
95
|
+
describe "POST create using uri - duplicate" do
|
96
|
+
before do
|
97
97
|
@service = Factory(:service)
|
98
98
|
@uri = TEST_URI
|
99
99
|
post :create, :service_id => @service.to_param, :uri => @uri, :user_id => @user
|
100
100
|
post :create, :service_id => @service.to_param, :uri => @uri, :user_id => @user
|
101
101
|
end
|
102
|
-
should
|
102
|
+
it "should set already added in the flash" do
|
103
103
|
ensure_flash_contains(I18n.t('muck.services.already_added_uri_feed', :uri => @uri))
|
104
104
|
end
|
105
|
-
|
105
|
+
it { should redirect_to( user_identity_feeds_url(@user.id) ) }
|
106
106
|
end
|
107
107
|
|
108
108
|
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
+
|
3
|
+
describe Muck::OaiEndpointsController do
|
4
|
+
|
5
|
+
render_views
|
6
|
+
|
7
|
+
describe "oai endpoints controller" do
|
8
|
+
|
9
|
+
describe "logged in as admin" do
|
10
|
+
before do
|
11
|
+
@user = Factory(:user)
|
12
|
+
activate_authlogic
|
13
|
+
login_as @user
|
14
|
+
end
|
15
|
+
describe "GET new" do
|
16
|
+
before do
|
17
|
+
get :new
|
18
|
+
end
|
19
|
+
it { should_not set_the_flash }
|
20
|
+
it { should respond_with :success }
|
21
|
+
it { should render_template :new }
|
22
|
+
end
|
23
|
+
describe "POST create" do
|
24
|
+
before do
|
25
|
+
post :create, :oai_endpoint => { :uri => 'http://www.example.com', :title => 'example' }
|
26
|
+
end
|
27
|
+
it { should set_the_flash.to(I18n.t('muck.services.oai_endpoint_successfully_created')) }
|
28
|
+
it { should redirect_to( oai_endpoint_url(assigns(:oai_endpoint)) ) }
|
29
|
+
end
|
30
|
+
describe "GET show" do
|
31
|
+
before do
|
32
|
+
@oai_endpoint = Factory(:oai_endpoint)
|
33
|
+
get :show, :id => @oai_endpoint.to_param
|
34
|
+
end
|
35
|
+
it { should_not set_the_flash }
|
36
|
+
it { should respond_with :success }
|
37
|
+
it { should render_template :show }
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
+
|
3
|
+
describe Muck::TopicsController do
|
4
|
+
|
5
|
+
render_views
|
6
|
+
|
7
|
+
describe "topics controller" do
|
8
|
+
|
9
|
+
before do
|
10
|
+
bootstrap_services
|
11
|
+
end
|
12
|
+
|
13
|
+
describe "GET new" do
|
14
|
+
before do
|
15
|
+
get :new
|
16
|
+
end
|
17
|
+
it { should_not set_the_flash }
|
18
|
+
it { should respond_with :success }
|
19
|
+
it { should render_template :new }
|
20
|
+
end
|
21
|
+
|
22
|
+
describe "GET rss_discovery with term defined" do
|
23
|
+
before do
|
24
|
+
get :rss_discovery, :id => 'ruby,rails'
|
25
|
+
end
|
26
|
+
it { should_not set_the_flash }
|
27
|
+
it { should respond_with :success }
|
28
|
+
it { should render_template :rss_discovery }
|
29
|
+
end
|
30
|
+
|
31
|
+
describe "GET show with term defined" do
|
32
|
+
before do
|
33
|
+
get :show, :id => 'ruby,rails'
|
34
|
+
end
|
35
|
+
it { should_not set_the_flash }
|
36
|
+
it { should respond_with :success }
|
37
|
+
it { should render_template :show }
|
38
|
+
end
|
39
|
+
|
40
|
+
describe "GET show without terms" do
|
41
|
+
before do
|
42
|
+
get :show, :id => ' '
|
43
|
+
end
|
44
|
+
it { should set_the_flash.to(I18n.t('muck.services.no_terms_error')) }
|
45
|
+
it { should redirect_to( new_topic_path ) }
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
+
|
3
|
+
describe Muck::VisitsController do
|
4
|
+
|
5
|
+
render_views
|
6
|
+
|
7
|
+
describe "visits controller" do
|
8
|
+
|
9
|
+
describe "GET show" do
|
10
|
+
before do
|
11
|
+
@entry = Factory(:entry)
|
12
|
+
get :show, :id => @entry.to_param, :format => 'html'
|
13
|
+
end
|
14
|
+
it { should_not set_the_flash }
|
15
|
+
it { should respond_with :success }
|
16
|
+
it { should render_template :show }
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -1,10 +1,15 @@
|
|
1
|
-
Factory.define :share do |f|
|
1
|
+
Factory.define :service_share, :class => 'share' do |f|
|
2
2
|
f.uri { Factory.next(:uri) }
|
3
3
|
f.title { Factory.next(:title) }
|
4
4
|
f.shared_by {|a| a.association(:user)}
|
5
5
|
f.entry {|a| a.association(:entry)}
|
6
6
|
end
|
7
7
|
|
8
|
+
Factory.define :personal_recommendation do |r|
|
9
|
+
r.personal_recommendable {|a| a.association(:user)}
|
10
|
+
r.destination {|a| a.association(:entry)}
|
11
|
+
end
|
12
|
+
|
8
13
|
Factory.define :recommendation do |r|
|
9
14
|
r.entry {|a| a.association(:entry)}
|
10
15
|
r.dest_entry {|a| a.association(:entry)}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
+
require 'services_mailer'
|
3
|
+
|
4
|
+
describe ServicesMailer do
|
5
|
+
|
6
|
+
describe "deliver emails" do
|
7
|
+
|
8
|
+
before do
|
9
|
+
ActionMailer::Base.delivery_method = :test
|
10
|
+
ActionMailer::Base.perform_deliveries = true
|
11
|
+
ActionMailer::Base.deliveries = []
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should send notification feed added email" do
|
15
|
+
feed = Factory(:feed)
|
16
|
+
email = ServicesMailer.notification_feed_added(feed).deliver
|
17
|
+
ActionMailer::Base.deliveries.should_not be_empty
|
18
|
+
[MuckEngine.configuration.admin_email].should == email.to
|
19
|
+
[MuckEngine.configuration.from_email].should == email.from
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should send notification oai endpoint added email" do
|
23
|
+
oai_endpoint = Factory(:oai_endpoint)
|
24
|
+
email = ServicesMailer.notification_oai_endpoint_added(oai_endpoint).deliver
|
25
|
+
ActionMailer::Base.deliveries.should_not be_empty
|
26
|
+
[MuckEngine.configuration.admin_email].should == email.to
|
27
|
+
[MuckEngine.configuration.from_email].should == email.from
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
@@ -8,19 +8,16 @@
|
|
8
8
|
# feed_type :string(255) default("Feed")
|
9
9
|
#
|
10
10
|
|
11
|
-
require File.dirname(__FILE__) + '/../
|
11
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
12
12
|
|
13
|
-
|
13
|
+
describe AggregationFeed do
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
describe "aggregation feed" do
|
16
|
+
before do
|
17
17
|
@aggregation_feed = Factory(:aggregation_feed)
|
18
18
|
end
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
should_belong_to :aggregation
|
23
|
-
should_belong_to :feed
|
19
|
+
it { should belong_to :aggregation }
|
20
|
+
it { should belong_to :feed }
|
24
21
|
end
|
25
22
|
|
26
23
|
end
|
data/test/{rails_root/test/unit/aggregation_test.rb → rails_test/spec/models/aggregation_spec.rb}
RENAMED
@@ -14,71 +14,71 @@
|
|
14
14
|
# feed_count :integer(4) default(0)
|
15
15
|
#
|
16
16
|
|
17
|
-
require File.dirname(__FILE__) + '/../
|
17
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
18
18
|
|
19
|
-
|
19
|
+
describe Aggregation do
|
20
20
|
|
21
|
-
|
22
|
-
|
21
|
+
describe "aggregation" do
|
22
|
+
before do
|
23
23
|
@aggregation = Factory(:aggregation)
|
24
24
|
end
|
25
25
|
|
26
|
-
subject { @aggregation }
|
27
26
|
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
|
28
|
+
it { should belong_to :ownable }
|
29
|
+
it { should have_many :aggregation_feeds }
|
30
|
+
it { should have_many :feeds }
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
it { should scope_by_title }
|
33
|
+
it { should scope_newer_than }
|
34
|
+
it { should scope_by_newest }
|
35
35
|
|
36
|
-
|
37
|
-
|
36
|
+
describe "filter feed types" do
|
37
|
+
before do
|
38
38
|
build_music_service
|
39
39
|
Aggregation.delete_all
|
40
40
|
@aggregation = Factory(:aggregation, :terms => 'autumn')
|
41
41
|
@aggregation.add_feeds(nil, nil, true) # Generate all feeds
|
42
42
|
end
|
43
|
-
should
|
43
|
+
it "should get all feeds" do
|
44
44
|
assert @aggregation.all_feeds.length > 0
|
45
45
|
assert @aggregation.all_feeds.any?{ |feed| feed.service.photo? }
|
46
46
|
assert @aggregation.all_feeds.any?{ |feed| feed.service.video? }
|
47
47
|
assert @aggregation.all_feeds.any?{ |feed| feed.service.bookmark? }
|
48
48
|
assert @aggregation.all_feeds.any?{ |feed| feed.service.general? }
|
49
49
|
end
|
50
|
-
should
|
50
|
+
it "should only get photo feeds" do
|
51
51
|
assert @aggregation.photo_feeds(true).length > 0
|
52
52
|
assert @aggregation.photo_feeds.all?{ |feed| feed.service.photo? }
|
53
53
|
end
|
54
|
-
should
|
54
|
+
it "should only get video feeds" do
|
55
55
|
assert @aggregation.video_feeds(true).length > 0
|
56
56
|
assert @aggregation.video_feeds.all?{ |feed| feed.service.video? }
|
57
57
|
end
|
58
|
-
should
|
58
|
+
it "should only get bookmark feeds" do
|
59
59
|
assert @aggregation.bookmark_feeds(true).length > 0
|
60
60
|
assert @aggregation.bookmark_feeds.all?{ |feed| feed.service.bookmark? }
|
61
61
|
end
|
62
|
-
should
|
62
|
+
it "should only get music feeds" do
|
63
63
|
assert @aggregation.music_feeds(true).length > 0
|
64
64
|
assert @aggregation.music_feeds.all?{ |feed| feed.service.music? }
|
65
65
|
end
|
66
|
-
should
|
66
|
+
it "should only get general feeds" do
|
67
67
|
assert @aggregation.general_feeds(true).length > 0
|
68
68
|
assert @aggregation.general_feeds.all?{ |feed| feed.service.general? }
|
69
69
|
end
|
70
70
|
|
71
71
|
end
|
72
72
|
|
73
|
-
|
74
|
-
|
73
|
+
describe "add_feeds_by_uri" do
|
74
|
+
before do
|
75
75
|
@uris = ['http://www.example.com', 'http://www.justinball.com']
|
76
76
|
@aggregation = Factory(:aggregation)
|
77
77
|
@aggregation.add_feeds_by_uri(nil, @uris)
|
78
78
|
@aggregation.reload
|
79
79
|
end
|
80
|
-
should
|
81
|
-
|
80
|
+
it "should add feeds" do
|
81
|
+
@aggregation.feeds.length.should == @uris.length
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
@@ -25,120 +25,116 @@
|
|
25
25
|
# comment_count :integer(4) default(0)
|
26
26
|
#
|
27
27
|
|
28
|
-
require File.dirname(__FILE__) + '/../
|
28
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
29
29
|
|
30
|
-
|
30
|
+
describe Entry do
|
31
31
|
|
32
|
-
|
33
|
-
|
32
|
+
describe "entry instance" do
|
33
|
+
before do
|
34
34
|
@entry = Factory(:entry)
|
35
35
|
end
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
should_belong_to :feed
|
40
|
-
|
37
|
+
it { should belong_to :feed }
|
41
38
|
|
42
|
-
|
43
|
-
should
|
39
|
+
describe "recommender_entry" do
|
40
|
+
it "should return an entry if the direct_link matches the specified uri" do
|
44
41
|
uri = Factory.next(:uri)
|
45
42
|
e = Factory.create(:entry, :direct_link => uri)
|
46
|
-
|
43
|
+
Entry.recommender_entry(uri).id.should == e.id
|
47
44
|
end
|
48
45
|
|
49
|
-
should
|
46
|
+
it "should return an entry if the permalink matches the specified uri" do
|
50
47
|
uri = Factory.next(:uri)
|
51
48
|
e = Factory.create(:entry, :permalink => uri)
|
52
|
-
|
49
|
+
Entry.recommender_entry(uri).id.should == e.id
|
53
50
|
end
|
54
51
|
|
55
|
-
should
|
52
|
+
it "should return an empty entry with the specified uri if the specified uri doesn't match" do
|
56
53
|
uri = Factory.next(:uri)
|
57
54
|
e = Factory.create(:entry, :permalink => uri)
|
58
|
-
|
59
|
-
|
55
|
+
Entry.recommender_entry(uri).should_not be_nil
|
56
|
+
Entry.recommender_entry(uri).permalink.should == uri
|
60
57
|
end
|
61
58
|
end
|
62
59
|
|
63
|
-
|
64
|
-
should
|
60
|
+
describe "resource_uri" do
|
61
|
+
it "should return the permalink when no direct_link is specified" do
|
65
62
|
@entry.direct_link = nil
|
66
|
-
|
63
|
+
@entry.resource_uri.should == @entry.permalink
|
67
64
|
end
|
68
65
|
|
69
|
-
should
|
66
|
+
it "should return the direct_link when a direct_link is specified" do
|
70
67
|
@entry.direct_link = Factory.next(:uri)
|
71
|
-
|
68
|
+
@entry.resource_uri.should == @entry.direct_link
|
72
69
|
end
|
73
70
|
end
|
74
71
|
|
75
|
-
|
76
|
-
# should
|
72
|
+
describe "search" do
|
73
|
+
# it "should search indexes for ruby" do
|
77
74
|
# Entry.search('ruby', 'all', 'en', 10, 0)
|
78
75
|
# end
|
79
|
-
should
|
80
|
-
|
81
|
-
Entry.search('ruby', 'all', 'foo', 10, 0)
|
82
|
-
|
76
|
+
it "should raise invalid language error" do
|
77
|
+
lambda{
|
78
|
+
Entry.search('ruby', 'all', 'foo', 10, 0)
|
79
|
+
}.should raise_error(MuckServices::Exceptions::LanguageNotSupported)
|
83
80
|
end
|
84
81
|
end
|
85
82
|
|
86
|
-
|
87
|
-
should
|
83
|
+
describe "normalized_uri" do
|
84
|
+
it "should remove the trailing file name from any url that ends in index.*" do
|
88
85
|
index_uri = 'http://example.com/some_dir/'
|
89
86
|
['html','aspx','shtm','htm','asp','php','cfm','jsp','shtml','jhtml'].each { |ext|
|
90
|
-
|
87
|
+
Entry.normalized_uri(index_uri + 'index.' + ext).should == index_uri
|
91
88
|
}
|
92
89
|
end
|
93
90
|
end
|
94
91
|
|
95
|
-
|
96
|
-
should
|
92
|
+
describe "recommendation requested omitting certain feeds" do
|
93
|
+
it "should not contain entries from those feeds" do
|
97
94
|
feed1_id = Factory(:feed).id
|
98
95
|
feed2_id = Factory(:feed).id
|
99
|
-
|
96
|
+
feed1_id.should_not == feed2_id
|
100
97
|
Recommendation.create(:entry_id => @entry.id, :dest_entry_id => Factory.create(:entry, :feed_id => feed1_id).id)
|
101
98
|
Recommendation.create(:entry_id => @entry.id, :dest_entry_id => Factory.create(:entry, :feed_id => feed2_id).id)
|
102
99
|
r = @entry.related_entries.top(false, 5, feed2_id.to_s)
|
103
|
-
|
100
|
+
r.length.should == 1
|
104
101
|
r.each { |e| assert_not_equal feed2_id, e.feed_id}
|
105
102
|
end
|
106
103
|
end
|
107
104
|
|
108
|
-
|
109
|
-
|
110
|
-
setup do
|
105
|
+
describe "with 3 recommendations" do
|
106
|
+
before do
|
111
107
|
3.times { |n| Recommendation.create(:entry_id => @entry.id,
|
112
108
|
:dest_entry_id => Factory(:entry).id, :relevance => n.to_f/10.0) }
|
113
109
|
end
|
114
110
|
|
115
|
-
should
|
116
|
-
|
111
|
+
it "should have 3 related_entries" do
|
112
|
+
@entry.related_entries.top.length.should == 3
|
117
113
|
end
|
118
114
|
|
119
|
-
should
|
120
|
-
|
115
|
+
it "should return only 2 if specified" do
|
116
|
+
@entry.related_entries.top(true,2).length.should == 2
|
121
117
|
end
|
122
118
|
|
123
|
-
should
|
119
|
+
it "should return results in order of relevance by default" do
|
124
120
|
related_entries = @entry.related_entries.top
|
125
|
-
|
126
|
-
|
121
|
+
related_entries[1].relevance.should < related_entries[0].relevance
|
122
|
+
related_entries[2].relevance.should < related_entries[1].relevance
|
127
123
|
end
|
128
124
|
|
129
125
|
end
|
130
126
|
|
131
|
-
|
132
|
-
should
|
127
|
+
describe "recommendation requested without details" do
|
128
|
+
it "should not have an author" do
|
133
129
|
Recommendation.create(:entry_id => @entry.id,
|
134
130
|
:dest_entry_id => Factory.create(:entry, :author => Factory.next(:name)).id,
|
135
131
|
:relevance => '.3')
|
136
|
-
|
137
|
-
@entry.related_entries.top.first.author
|
138
|
-
|
132
|
+
lambda{
|
133
|
+
@entry.related_entries.top.first.author
|
134
|
+
}.should raise_error
|
139
135
|
end
|
140
136
|
|
141
|
-
should
|
137
|
+
it "should have basic fields" do
|
142
138
|
title = Factory.next(:name)
|
143
139
|
collection = Factory.next(:name)
|
144
140
|
feed_id = Factory(:feed, :short_title => collection).id
|
@@ -147,18 +143,18 @@ class EntryTest < ActiveSupport::TestCase
|
|
147
143
|
recommendation_id = Recommendation.create(:entry_id => @entry.id, :relevance => relevance,
|
148
144
|
:dest_entry_id => dest_entry_id).id.to_s
|
149
145
|
r = @entry.related_entries.top(true).first
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
end
|
146
|
+
lambda do
|
147
|
+
r.recommendation_id.should == recommendation_id
|
148
|
+
r.relevance.to_f.should == relevance.to_f
|
149
|
+
r.title.should == title
|
150
|
+
r.collection.should == collection
|
151
|
+
r.dest_entry_id.should_not be_nil
|
152
|
+
end.should_not raise_error
|
157
153
|
end
|
158
154
|
end
|
159
155
|
|
160
|
-
|
161
|
-
should
|
156
|
+
describe "recommendation requested with details" do
|
157
|
+
it "should have basic and detailed fields" do
|
162
158
|
title = Factory.next(:name)
|
163
159
|
collection = Factory.next(:name)
|
164
160
|
author = Factory.next(:name)
|
@@ -176,21 +172,21 @@ class EntryTest < ActiveSupport::TestCase
|
|
176
172
|
recommendation_id = Recommendation.create(:entry_id => @entry.id, :relevance => relevance,
|
177
173
|
:avg_time_at_dest => average_time_at_dest, :clicks => clicks, :dest_entry_id => dest_entry_id).id.to_s
|
178
174
|
r = @entry.related_entries.top(true).first
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
#
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
end
|
175
|
+
lambda do
|
176
|
+
r.recommendation_id.should == recommendation_id
|
177
|
+
r.relevance.to_f.should == relevance.to_f
|
178
|
+
r.title.should == title
|
179
|
+
r.collection.should == collection
|
180
|
+
r.dest_entry_id.should_not be_nil
|
181
|
+
|
182
|
+
r.author.should == author
|
183
|
+
# r.published_at.should == published_at
|
184
|
+
r.clicks.to_i.should == clicks
|
185
|
+
r.permalink.should == permalink
|
186
|
+
r.direct_uri.should == direct_uri
|
187
|
+
r.average_time_at_dest.to_i.should == average_time_at_dest
|
188
|
+
r.description.should == description
|
189
|
+
end.should_not raise_error
|
194
190
|
end
|
195
191
|
end
|
196
192
|
|