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
data/test/{rails_root/test/unit/feed_parent_test.rb → rails_test/spec/models/feed_parent_spec.rb}
RENAMED
@@ -10,13 +10,13 @@
|
|
10
10
|
# updated_at :datetime
|
11
11
|
#
|
12
12
|
|
13
|
-
require File.dirname(__FILE__) + '/../
|
13
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
14
14
|
|
15
|
-
|
15
|
+
describe FeedParent do
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
describe "A feed parent instance" do
|
18
|
+
it { should belong_to :feed }
|
19
|
+
it { should belong_to :ownable }
|
20
20
|
end
|
21
21
|
|
22
22
|
end
|
@@ -33,129 +33,125 @@
|
|
33
33
|
# etag :string(255)
|
34
34
|
#
|
35
35
|
|
36
|
-
require File.dirname(__FILE__) + '/../
|
36
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
37
37
|
|
38
38
|
# Used to test muck_content_permission
|
39
|
-
|
39
|
+
describe Feed do
|
40
40
|
|
41
|
-
|
42
|
-
|
41
|
+
describe "A feed instance" do
|
42
|
+
before do
|
43
43
|
@feed = Factory(:feed)
|
44
44
|
end
|
45
45
|
|
46
|
-
|
46
|
+
it { should have_many :feed_parents }
|
47
|
+
it { should have_many :entries }
|
48
|
+
it { should belong_to :contributor }
|
49
|
+
it { should belong_to :default_language }
|
50
|
+
it { should belong_to :service }
|
47
51
|
|
48
|
-
|
49
|
-
|
50
|
-
should_belong_to :contributor
|
51
|
-
should_belong_to :default_language
|
52
|
-
should_belong_to :service
|
52
|
+
it { should validate_presence_of :uri }
|
53
|
+
it { should validate_uniqueness_of :uri }
|
53
54
|
|
54
|
-
|
55
|
-
|
55
|
+
it { should scope_by_title }
|
56
|
+
it { should scope_newer_than }
|
57
|
+
it { should scope_by_newest }
|
56
58
|
|
57
|
-
|
58
|
-
|
59
|
-
should_scope_by_newest
|
60
|
-
|
61
|
-
should "set 24 hours as default interval" do
|
62
|
-
assert_equal @feed.harvest_interval_hours, 24
|
59
|
+
it "should set 24 hours as default interval" do
|
60
|
+
@feed.harvest_interval_hours.should == 24
|
63
61
|
end
|
64
62
|
|
65
|
-
should
|
63
|
+
it "should set harvest interval by hours" do
|
66
64
|
@feed.harvest_interval_hours = 10
|
67
|
-
|
65
|
+
@feed.harvest_interval.should == 10 * 3600
|
68
66
|
end
|
69
67
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
setup do
|
68
|
+
describe "named scope" do
|
69
|
+
describe "banned" do
|
70
|
+
before do
|
74
71
|
@feed = Factory(:feed, :status => MuckServices::Status::BANNED)
|
75
72
|
@feed_not = Factory(:feed)
|
76
73
|
end
|
77
|
-
should
|
78
|
-
|
74
|
+
it "should find feeds that are banned" do
|
75
|
+
Feed.banned.should include(@feed)
|
79
76
|
end
|
80
|
-
should
|
81
|
-
|
77
|
+
it "should not find feeds that are not banned" do
|
78
|
+
Feed.banned.should_not include(@feed_not)
|
82
79
|
end
|
83
80
|
end
|
84
|
-
|
85
|
-
|
86
|
-
setup do
|
81
|
+
describe "valid" do
|
82
|
+
before do
|
87
83
|
@feed = Factory(:feed, :status => 0)
|
88
84
|
@feed_not = Factory(:feed, :status => MuckServices::Status::BANNED)
|
89
85
|
end
|
90
|
-
should
|
91
|
-
|
86
|
+
it "should find valid feeds" do
|
87
|
+
Feed.valid.should include(@feed)
|
92
88
|
end
|
93
|
-
should
|
94
|
-
|
89
|
+
it "should not find invalid feeds" do
|
90
|
+
Feed.valid.should_not include(@feed_not)
|
95
91
|
end
|
96
92
|
end
|
97
93
|
end
|
98
94
|
|
99
95
|
end
|
100
96
|
|
101
|
-
|
102
|
-
|
97
|
+
describe "Feed status" do
|
98
|
+
before do
|
103
99
|
@feed = Factory(:feed)
|
104
100
|
end
|
105
|
-
should
|
101
|
+
it "should be banned" do
|
106
102
|
@feed.status = MuckServices::Status::BANNED
|
107
|
-
|
103
|
+
@feed.banned?.should be_true
|
108
104
|
end
|
109
|
-
should
|
105
|
+
it "should be approved" do
|
110
106
|
@feed.status = MuckServices::Status::APPROVED
|
111
|
-
|
107
|
+
@feed.banned?.should be_false
|
112
108
|
end
|
113
|
-
should
|
109
|
+
it "should be pending" do
|
114
110
|
@feed.status = MuckServices::Status::PENDING
|
115
|
-
|
111
|
+
@feed.pending?.should be_true
|
116
112
|
end
|
117
113
|
end
|
118
114
|
|
119
|
-
|
120
|
-
|
115
|
+
describe "Get feed information" do
|
116
|
+
it "shouldGet feed information" do
|
121
117
|
Feed.gather_information(TEST_URI)
|
122
118
|
end
|
123
|
-
|
119
|
+
it "shouldDiscover feeds from url" do
|
124
120
|
Feed.discover_feeds(TEST_URI)
|
125
121
|
end
|
126
|
-
|
127
|
-
|
122
|
+
it "shouldDiscover feeds from xml url" do
|
123
|
+
Feed.discover_feeds(TEST_XML_URI)[0].url.should == TEST_XML_URI
|
128
124
|
end
|
129
125
|
end
|
130
126
|
|
131
|
-
|
132
|
-
|
127
|
+
describe "Harvest feed" do
|
128
|
+
before do
|
133
129
|
@feed = Factory(:feed, :uri => TEST_RSS_URI, :display_uri => TEST_URI)
|
134
130
|
end
|
135
|
-
should
|
131
|
+
it "should get new entries" do
|
136
132
|
entries = @feed.harvest
|
137
|
-
|
133
|
+
entries.length.should > 0
|
138
134
|
end
|
139
135
|
end
|
140
136
|
|
141
|
-
|
142
|
-
|
137
|
+
describe "Delete feed if unused" do
|
138
|
+
before do
|
143
139
|
@user = Factory(:user)
|
144
140
|
@identity_user = Factory(:user)
|
145
141
|
@delete_feed = Factory(:feed, :contributor => @user)
|
146
142
|
@dont_delete_feed = Factory(:feed, :contributor => @user)
|
147
143
|
@identity_user.own_feeds << @dont_delete_feed
|
148
144
|
end
|
149
|
-
should
|
150
|
-
|
145
|
+
it "should delete feed" do
|
146
|
+
@delete_feed.delete_if_unused(@user).should be_true
|
151
147
|
end
|
152
|
-
should
|
153
|
-
|
148
|
+
it "should not delete feed" do
|
149
|
+
@dont_delete_feed.delete_if_unused(@user).should be_false
|
154
150
|
end
|
155
151
|
end
|
156
152
|
|
157
|
-
|
158
|
-
|
153
|
+
describe "global feed and references" do
|
154
|
+
before do
|
159
155
|
@global_feed = Factory(:feed)
|
160
156
|
@user = Factory(:user)
|
161
157
|
@feed = Factory(:feed)
|
@@ -169,38 +165,38 @@ class FeedTest < ActiveSupport::TestCase
|
|
169
165
|
@aggregation.feeds << @aggregation_feed
|
170
166
|
end
|
171
167
|
|
172
|
-
|
173
|
-
|
174
|
-
should
|
175
|
-
|
168
|
+
describe "referenced feed" do
|
169
|
+
describe "feed" do
|
170
|
+
it "should be non-global" do
|
171
|
+
@feed.global?.should be_false
|
176
172
|
end
|
177
|
-
should
|
178
|
-
|
173
|
+
it "should be in use" do
|
174
|
+
@feed.in_use?.should be_true
|
179
175
|
end
|
180
176
|
end
|
181
|
-
|
182
|
-
should
|
183
|
-
|
177
|
+
describe "identity feed" do
|
178
|
+
it "should be non-global" do
|
179
|
+
@identity_feed.global?.should be_false
|
184
180
|
end
|
185
|
-
should
|
186
|
-
|
181
|
+
it "should be in use" do
|
182
|
+
@identity_feed.in_use?.should be_true
|
187
183
|
end
|
188
184
|
end
|
189
|
-
|
190
|
-
should
|
191
|
-
|
185
|
+
describe "aggregation feed" do
|
186
|
+
it "should be non-global" do
|
187
|
+
@aggregation_feed.global?.should be_false
|
192
188
|
end
|
193
|
-
should
|
194
|
-
|
189
|
+
it "should be in use" do
|
190
|
+
@aggregation_feed.in_use?.should be_true
|
195
191
|
end
|
196
192
|
end
|
197
193
|
end
|
198
|
-
|
199
|
-
should
|
200
|
-
|
194
|
+
describe "global feed" do
|
195
|
+
it "should be a global feed" do
|
196
|
+
@global_feed.global?.should be_true
|
201
197
|
end
|
202
|
-
should
|
203
|
-
|
198
|
+
it "should not be in use" do
|
199
|
+
@global_feed.in_use?.should be_false
|
204
200
|
end
|
205
201
|
end
|
206
202
|
end
|
@@ -8,11 +8,11 @@
|
|
8
8
|
# ownable_type :string(255) not null
|
9
9
|
#
|
10
10
|
|
11
|
-
require File.dirname(__FILE__) + '/../
|
11
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
describe IdentityFeed do
|
14
|
+
describe "identity feed" do
|
15
|
+
it { should belong_to :ownable }
|
16
|
+
it { should belong_to :feed }
|
17
17
|
end
|
18
18
|
end
|
@@ -0,0 +1,78 @@
|
|
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__) + '/../spec_helper'
|
19
|
+
|
20
|
+
# Used to test muck_content_permission
|
21
|
+
describe OaiEndpoint do
|
22
|
+
|
23
|
+
describe "An oai endpoint instance" do
|
24
|
+
before do
|
25
|
+
@oai_endpoint = Factory(:oai_endpoint)
|
26
|
+
end
|
27
|
+
|
28
|
+
it { should belong_to :contributor }
|
29
|
+
it { should belong_to :default_language }
|
30
|
+
it { should validate_presence_of :uri }
|
31
|
+
it { should scope_by_title }
|
32
|
+
it { should scope_newer_than }
|
33
|
+
it { should scope_by_newest }
|
34
|
+
|
35
|
+
describe "named scope" do
|
36
|
+
describe "banned" do
|
37
|
+
before do
|
38
|
+
@oai_endpoint = Factory(:oai_endpoint, :status => MuckServices::Status::BANNED)
|
39
|
+
@oai_endpoint_not = Factory(:oai_endpoint)
|
40
|
+
end
|
41
|
+
it "should find oai_endpoints that are banned" do
|
42
|
+
OaiEndpoint.banned.should include(@oai_endpoint)
|
43
|
+
end
|
44
|
+
it "should not find oai_endpoints that are not banned" do
|
45
|
+
OaiEndpoint.banned.should_not include(@oai_endpoint_not)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
describe "valid" do
|
49
|
+
before do
|
50
|
+
@oai_endpoint = Factory(:oai_endpoint, :status => 0)
|
51
|
+
@oai_endpoint_not = Factory(:oai_endpoint, :status => MuckServices::Status::BANNED)
|
52
|
+
end
|
53
|
+
it "should find valid oai_endpoints" do
|
54
|
+
OaiEndpoint.valid.should include(@oai_endpoint)
|
55
|
+
end
|
56
|
+
it "should not find invalid oai_endpoints" do
|
57
|
+
OaiEndpoint.valid.should_not include(@oai_endpoint_not)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
63
|
+
|
64
|
+
describe "banned/unbanned" do
|
65
|
+
before do
|
66
|
+
@oai_endpoint = Factory(:oai_endpoint)
|
67
|
+
end
|
68
|
+
it "should be banned" do
|
69
|
+
@oai_endpoint.status = -1
|
70
|
+
@oai_endpoint.banned?.should be_true
|
71
|
+
end
|
72
|
+
it "should not be banned" do
|
73
|
+
@oai_endpoint.status = 0
|
74
|
+
@oai_endpoint.banned?.should be_false
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
+
|
3
|
+
describe PersonalRecommendation do
|
4
|
+
describe "personal recommendations" do
|
5
|
+
before do
|
6
|
+
@user = Factory(:user)
|
7
|
+
end
|
8
|
+
|
9
|
+
describe "include MuckServices::Models::MuckRecommendationOwner" do
|
10
|
+
before do
|
11
|
+
@entry = Factory(:entry)
|
12
|
+
end
|
13
|
+
it "should create a personal recommendation" do
|
14
|
+
recommendation = @user.personal_recommendations.build(:destination => @entry)
|
15
|
+
recommendation.save.should be_true
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe "include MuckServices::Models::MuckRecommendation" do
|
20
|
+
before do
|
21
|
+
@recommended_user = Factory(:user)
|
22
|
+
end
|
23
|
+
it "should make user recommended" do
|
24
|
+
recommendation = @user.personal_recommendations.create(:destination => @recommended_user)
|
25
|
+
@recommended_user.recommended_to.should include(recommendation)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe "named scopes" do
|
30
|
+
before 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
|
+
it { should scope_newer_than }
|
39
|
+
it { should scope_by_newest }
|
40
|
+
|
41
|
+
describe "entries" do
|
42
|
+
it "should return an entry" do
|
43
|
+
@user.personal_recommendations.entries_only.should include(@entry_recommendation)
|
44
|
+
end
|
45
|
+
it "should not return a user" do
|
46
|
+
@user.personal_recommendations.entries_only.should_not include(@user_recommendation)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
describe "users" do
|
50
|
+
it "should return an user" do
|
51
|
+
@user.personal_recommendations.users.should include(@user_recommendation)
|
52
|
+
end
|
53
|
+
it "should not return an entry" do
|
54
|
+
@user.personal_recommendations.users.should_not include(@entry_recommendation)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
@@ -11,19 +11,17 @@
|
|
11
11
|
# avg_time_at_dest :integer(4) default(60)
|
12
12
|
#
|
13
13
|
|
14
|
-
require File.dirname(__FILE__) + '/../
|
14
|
+
require File.dirname(__FILE__) + '/../spec_helper'
|
15
15
|
|
16
|
-
|
16
|
+
describe Recommendation do
|
17
17
|
|
18
|
-
|
19
|
-
|
18
|
+
describe "recommendation" do
|
19
|
+
before do
|
20
20
|
@recommendation = Factory(:recommendation)
|
21
21
|
end
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
should_belong_to :entry
|
26
|
-
should_belong_to :dest_entry
|
23
|
+
it { should belong_to :entry }
|
24
|
+
it { should belong_to :dest_entry }
|
27
25
|
end
|
28
26
|
|
29
27
|
end
|
@@ -0,0 +1,19 @@
|
|
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__) + '/../spec_helper'
|
11
|
+
|
12
|
+
describe ServiceCategory do
|
13
|
+
|
14
|
+
describe "service category instance" do
|
15
|
+
it { should have_many :services }
|
16
|
+
it { should scope_sorted }
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|