muck-services 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +6 -9
- data/VERSION +1 -1
- data/muck-services.gemspec +241 -362
- metadata +9 -241
- data/.gitignore +0 -30
- data/test/rails_test/app/controllers/application_controller.rb +0 -24
- data/test/rails_test/app/controllers/default_controller.rb +0 -7
- data/test/rails_test/app/helpers/application_helper.rb +0 -3
- data/test/rails_test/app/models/activity.rb +0 -24
- data/test/rails_test/app/models/comment.rb +0 -23
- data/test/rails_test/app/models/country.rb +0 -13
- data/test/rails_test/app/models/language.rb +0 -15
- data/test/rails_test/app/models/share.rb +0 -20
- data/test/rails_test/app/models/state.rb +0 -13
- data/test/rails_test/app/models/user.rb +0 -45
- data/test/rails_test/app/models/user_session.rb +0 -2
- data/test/rails_test/config/application.rb +0 -42
- data/test/rails_test/config/boot.rb +0 -13
- data/test/rails_test/config/environment.rb +0 -5
- data/test/rails_test/config/environments/development.rb +0 -26
- data/test/rails_test/config/environments/production.rb +0 -49
- data/test/rails_test/config/environments/test.rb +0 -35
- data/test/rails_test/config/initializers/backtrace_silencers.rb +0 -7
- data/test/rails_test/config/initializers/inflections.rb +0 -10
- data/test/rails_test/config/initializers/mce_options.rb +0 -83
- data/test/rails_test/config/initializers/mime_types.rb +0 -5
- data/test/rails_test/config/initializers/muck.rb +0 -66
- data/test/rails_test/config/initializers/secret_token.rb +0 -7
- data/test/rails_test/config/initializers/session_store.rb +0 -8
- data/test/rails_test/config/routes.rb +0 -12
- data/test/rails_test/db/migrate/20090320174818_create_muck_permissions_and_roles.rb +0 -16
- data/test/rails_test/db/migrate/20090327231918_create_users.rb +0 -40
- data/test/rails_test/db/migrate/20090402033319_add_muck_activities.rb +0 -36
- data/test/rails_test/db/migrate/20090402234137_create_languages.rb +0 -18
- data/test/rails_test/db/migrate/20090426041056_create_countries.rb +0 -15
- data/test/rails_test/db/migrate/20090426041103_create_states.rb +0 -18
- data/test/rails_test/db/migrate/20090512013727_create_profiles.rb +0 -21
- data/test/rails_test/db/migrate/20090517040220_create_uploads.rb +0 -38
- data/test/rails_test/db/migrate/20090602191243_create_muck_raker.rb +0 -322
- data/test/rails_test/db/migrate/20090613173314_create_comments.rb +0 -24
- data/test/rails_test/db/migrate/20090619211125_create_tag_clouds.rb +0 -19
- data/test/rails_test/db/migrate/20090623181458_add_grain_size_to_entries.rb +0 -16
- data/test/rails_test/db/migrate/20090623193525_add_grain_size_to_tag_clouds.rb +0 -12
- data/test/rails_test/db/migrate/20090703055724_add_contents.rb +0 -49
- data/test/rails_test/db/migrate/20090703175825_denormalize_entries_subjects.rb +0 -42
- data/test/rails_test/db/migrate/20090704220055_create_slugs.rb +0 -18
- data/test/rails_test/db/migrate/20090716035935_change_tag_cloud_grain_sizes.rb +0 -9
- data/test/rails_test/db/migrate/20090717173900_add_contributor_to_feeds.rb +0 -9
- data/test/rails_test/db/migrate/20090717175825_normalize_entries_subjects.rb +0 -47
- data/test/rails_test/db/migrate/20090721043213_change_services_title_to_name.rb +0 -9
- data/test/rails_test/db/migrate/20090721054927_remove_services_not_null_from_feeds.rb +0 -9
- data/test/rails_test/db/migrate/20090723050510_create_feed_parents.rb +0 -17
- data/test/rails_test/db/migrate/20090728165716_add_etag_to_feeds.rb +0 -9
- data/test/rails_test/db/migrate/20090730044139_add_comment_cache.rb +0 -9
- data/test/rails_test/db/migrate/20090730045848_add_comment_cache_to_entries.rb +0 -9
- data/test/rails_test/db/migrate/20090730154102_allow_null_user.rb +0 -9
- data/test/rails_test/db/migrate/20090803185323_create_shares.rb +0 -16
- data/test/rails_test/db/migrate/20090804184247_add_comment_count_to_shares.rb +0 -9
- data/test/rails_test/db/migrate/20090804211240_add_entry_id_to_shares.rb +0 -9
- data/test/rails_test/db/migrate/20090804231857_add_shares_uri_index.rb +0 -9
- data/test/rails_test/db/migrate/20090806230610_add_layout_to_contents.rb +0 -9
- data/test/rails_test/db/migrate/20090808175401_add_contents_comment_counter_cache.rb +0 -9
- data/test/rails_test/db/migrate/20090818204527_add_activity_indexes.rb +0 -9
- data/test/rails_test/db/migrate/20090819030523_add_attachable_to_activities.rb +0 -13
- data/test/rails_test/db/migrate/20090826220530_change_services_sequence_to_sort.rb +0 -9
- data/test/rails_test/db/migrate/20090826225652_create_identity_feeds.rb +0 -14
- data/test/rails_test/db/migrate/20090827005105_add_identity_fields_to_services.rb +0 -13
- data/test/rails_test/db/migrate/20090827015308_create_service_categories.rb +0 -12
- data/test/rails_test/db/migrate/20090827221502_add_prompt_and_template_to_services.rb +0 -11
- data/test/rails_test/db/migrate/20090915041650_aggregations_to_polymorphic.rb +0 -15
- data/test/rails_test/db/migrate/20090922174200_update_oai_endpoints.rb +0 -13
- data/test/rails_test/db/migrate/20090922231552_add_dates_to_oai_endpoints.rb +0 -11
- data/test/rails_test/db/migrate/20090923150807_rename_name_in_aggregation.rb +0 -9
- data/test/rails_test/db/migrate/20090924200750_add_uri_data_template_to_services.rb +0 -9
- data/test/rails_test/db/migrate/20091006183742_add_feed_count_to_aggregation.rb +0 -9
- data/test/rails_test/db/migrate/20091022150615_add_uri_key_to_services.rb +0 -9
- data/test/rails_test/db/migrate/20091115011828_add_aggregations_for_personal_recs.rb +0 -9
- data/test/rails_test/db/migrate/20091116094447_rename_action_table.rb +0 -38
- data/test/rails_test/db/migrate/20091118203605_add_default_feed_type_to_aggregation_feed.rb +0 -10
- data/test/rails_test/db/migrate/20091124203137_add_location_to_profiles.rb +0 -15
- data/test/rails_test/db/migrate/20091124205819_add_fields_to_profiles.rb +0 -21
- data/test/rails_test/db/migrate/20100123035450_create_access_codes.rb +0 -19
- data/test/rails_test/db/migrate/20100123233654_create_access_code_requests.rb +0 -14
- data/test/rails_test/db/migrate/20100206000906_remove_name_fields.rb +0 -15
- data/test/rails_test/db/migrate/20100903205928_add_dead_entry_fields.rb +0 -13
- data/test/rails_test/features/step_definitions/common_steps.rb +0 -93
- data/test/rails_test/features/step_definitions/visit_steps.rb +0 -6
- data/test/rails_test/features/step_definitions/web_steps.rb +0 -219
- data/test/rails_test/features/step_definitions/webrat_steps.rb +0 -128
- data/test/rails_test/features/support/custom_env.rb +0 -19
- data/test/rails_test/features/support/env.rb +0 -58
- data/test/rails_test/features/support/paths.rb +0 -33
- data/test/rails_test/lib/daemons/amazonaws.rb +0 -36
- data/test/rails_test/public/dispatch.rb +0 -10
- data/test/rails_test/spec/controllers/admin/feeds_controller_spec.rb +0 -38
- data/test/rails_test/spec/controllers/admin/oai_endpoints_controller_spec.rb +0 -30
- data/test/rails_test/spec/controllers/aggregation_feeds_controller_spec.rb +0 -67
- data/test/rails_test/spec/controllers/aggregations_controller_spec.rb +0 -89
- data/test/rails_test/spec/controllers/feed_previews_controller_spec.rb +0 -32
- data/test/rails_test/spec/controllers/feeds_controller_spec.rb +0 -78
- data/test/rails_test/spec/controllers/identity_feeds_controller_spec.rb +0 -110
- data/test/rails_test/spec/controllers/oai_endpoints_controller_spec.rb +0 -42
- data/test/rails_test/spec/controllers/topics_controller_spec.rb +0 -50
- data/test/rails_test/spec/controllers/visits_controller_spec.rb +0 -21
- data/test/rails_test/spec/factories.rb +0 -16
- data/test/rails_test/spec/mailers/services_mailer_spec.rb +0 -31
- data/test/rails_test/spec/models/aggregation_feed_spec.rb +0 -23
- data/test/rails_test/spec/models/aggregation_spec.rb +0 -87
- data/test/rails_test/spec/models/entry_spec.rb +0 -195
- data/test/rails_test/spec/models/feed_parent_spec.rb +0 -22
- data/test/rails_test/spec/models/feed_spec.rb +0 -204
- data/test/rails_test/spec/models/identity_feed_spec.rb +0 -18
- data/test/rails_test/spec/models/oai_endpoint_spec.rb +0 -78
- data/test/rails_test/spec/models/personal_recommendation_spec.rb +0 -60
- data/test/rails_test/spec/models/recommendation_spec.rb +0 -27
- data/test/rails_test/spec/models/service_category_spec.rb +0 -19
- data/test/rails_test/spec/models/service_spec.rb +0 -383
- data/test/rails_test/spec/models/share_spec.rb +0 -30
- data/test/rails_test/spec/models/tag_cloud_spec.rb +0 -23
- data/test/rails_test/spec/models/user_spec.rb +0 -45
- data/test/rails_test/spec/spec_helper.rb +0 -36
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
|
-
|
|
3
|
-
describe Muck::FeedPreviewsController do
|
|
4
|
-
|
|
5
|
-
render_views
|
|
6
|
-
|
|
7
|
-
describe "feed previews controller" do
|
|
8
|
-
|
|
9
|
-
describe "GET new" do
|
|
10
|
-
before do
|
|
11
|
-
get :new
|
|
12
|
-
end
|
|
13
|
-
it { should_not set_the_flash }
|
|
14
|
-
it { should respond_with :success }
|
|
15
|
-
it { should render_template :new }
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
describe "POST to select_feeds" do
|
|
19
|
-
before do
|
|
20
|
-
post :select_feeds, :feed => { :uri => TEST_URI }
|
|
21
|
-
end
|
|
22
|
-
it { should_not set_the_flash }
|
|
23
|
-
it { should respond_with :success }
|
|
24
|
-
it { should render_template :select_feeds }
|
|
25
|
-
it "should return feeds for the given uri" do
|
|
26
|
-
assert assigns(:feeds).length > 0
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
end
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
|
-
|
|
3
|
-
describe Muck::FeedsController do
|
|
4
|
-
|
|
5
|
-
render_views
|
|
6
|
-
|
|
7
|
-
describe "feeds controller" do
|
|
8
|
-
|
|
9
|
-
describe "GET index" do
|
|
10
|
-
before do
|
|
11
|
-
get :index
|
|
12
|
-
end
|
|
13
|
-
it { should_not set_the_flash }
|
|
14
|
-
it { should respond_with :success }
|
|
15
|
-
it { should render_template :index }
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
describe "GET show" do
|
|
19
|
-
before do
|
|
20
|
-
@feed = Factory(:feed)
|
|
21
|
-
get :show, :id => @feed.to_param, :format => 'html'
|
|
22
|
-
end
|
|
23
|
-
it { should_not set_the_flash }
|
|
24
|
-
it { should respond_with :success }
|
|
25
|
-
it { should render_template :show }
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
describe "logged in" do
|
|
29
|
-
before do
|
|
30
|
-
@admin = Factory(:user)
|
|
31
|
-
@admin_role = Factory(:role, :rolename => 'administrator')
|
|
32
|
-
@admin.roles << @admin_role
|
|
33
|
-
activate_authlogic
|
|
34
|
-
login_as @admin
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
describe "GET new" do
|
|
38
|
-
before do
|
|
39
|
-
get :new
|
|
40
|
-
end
|
|
41
|
-
it { should_not set_the_flash }
|
|
42
|
-
it { should respond_with :success }
|
|
43
|
-
it { should render_template :new }
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
describe "GET new_extended" do
|
|
47
|
-
before do
|
|
48
|
-
get :new_extended
|
|
49
|
-
end
|
|
50
|
-
it { should_not set_the_flash }
|
|
51
|
-
it { should respond_with :success }
|
|
52
|
-
it { should render_template :new_extended }
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
describe "POST create (simple)" do
|
|
56
|
-
before do
|
|
57
|
-
post :create, :feed => { :uri => TEST_RSS_URI }
|
|
58
|
-
end
|
|
59
|
-
it { should redirect_to( feed_path(assigns(:feed), :layout => true) ) }
|
|
60
|
-
it { should set_the_flash.to(I18n.t('muck.services.feed_successfully_created', :uri => TEST_RSS_URI)) }
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
describe "POST create (advanced)" do
|
|
64
|
-
before do
|
|
65
|
-
post :create, :feed => { :uri => TEST_RSS_URI,
|
|
66
|
-
:display_uri => 'http://www.example.com',
|
|
67
|
-
:title => 'test feed long',
|
|
68
|
-
:short_title => 'test feed',
|
|
69
|
-
:description => 'foo bar' }
|
|
70
|
-
end
|
|
71
|
-
it { should set_the_flash.to(I18n.t('muck.services.feed_successfully_created', :uri => TEST_RSS_URI)) }
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
end
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
|
-
|
|
3
|
-
describe Muck::IdentityFeedsController do
|
|
4
|
-
|
|
5
|
-
render_views
|
|
6
|
-
|
|
7
|
-
describe "identity feeds controller" do
|
|
8
|
-
|
|
9
|
-
before do
|
|
10
|
-
@user = Factory(:user)
|
|
11
|
-
@service = Factory(:service)
|
|
12
|
-
activate_authlogic
|
|
13
|
-
login_as @user
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
describe "GET index" do
|
|
17
|
-
before do
|
|
18
|
-
get :index, :user_id => @user.to_param
|
|
19
|
-
end
|
|
20
|
-
it { should_not set_the_flash }
|
|
21
|
-
it { should respond_with :success }
|
|
22
|
-
it { should render_template :index }
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
describe "GET new" do
|
|
26
|
-
before do
|
|
27
|
-
get :new, :user_id => @user.to_param, :service_id => @service.to_param
|
|
28
|
-
end
|
|
29
|
-
it { should_not set_the_flash }
|
|
30
|
-
it { should respond_with :success }
|
|
31
|
-
it { should render_template :new }
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
describe "POST create using bogus service and bogus uri" do
|
|
35
|
-
before do
|
|
36
|
-
@service = Factory(:service)
|
|
37
|
-
@uri = 'http://www.example.com'
|
|
38
|
-
post :create, :service_id => @service.to_param, :uri => @uri, :user_id => @user
|
|
39
|
-
end
|
|
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
|
-
end
|
|
43
|
-
|
|
44
|
-
describe "POST create using bogus service and username" do
|
|
45
|
-
before do
|
|
46
|
-
@service = Factory(:service)
|
|
47
|
-
post :create, :service_id => @service.to_param, :username => 'test', :user_id => @user, :uri => 'http://www.example.com'
|
|
48
|
-
end
|
|
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
|
-
end
|
|
52
|
-
|
|
53
|
-
describe "POST create using uri" do
|
|
54
|
-
before do
|
|
55
|
-
@service = Factory(:service)
|
|
56
|
-
@uri = TEST_URI
|
|
57
|
-
post :create, :service_id => @service.to_param, :uri => @uri, :user_id => @user
|
|
58
|
-
end
|
|
59
|
-
it "should set success in the flash" do
|
|
60
|
-
ensure_flash_contains(I18n.t('muck.services.successfully_added_uri_feed'))
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
describe "POST create using valid service username" do
|
|
65
|
-
before do
|
|
66
|
-
@service = Factory(:service, :uri_data_template => TEST_USERNAME_TEMPLATE)
|
|
67
|
-
@username = 'jbasdf'
|
|
68
|
-
end
|
|
69
|
-
describe "html" do
|
|
70
|
-
before do
|
|
71
|
-
post :create, :service_id => @service.to_param, :username => @username, :user_id => @user, :uri => 'http://www.example.com'
|
|
72
|
-
end
|
|
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
|
-
end
|
|
76
|
-
describe "json" do
|
|
77
|
-
before do
|
|
78
|
-
post :create, :service_id => @service.to_param, :username => @username, :user_id => @user, :format => 'json'
|
|
79
|
-
end
|
|
80
|
-
it { should respond_with :success }
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
|
|
84
|
-
describe "POST create using valid service username - duplicate" do
|
|
85
|
-
before do
|
|
86
|
-
@service = Factory(:service, :uri_data_template => TEST_USERNAME_TEMPLATE)
|
|
87
|
-
@username = 'jbasdf'
|
|
88
|
-
post :create, :service_id => @service.to_param, :username => @username, :user_id => @user, :uri => 'http://www.example.com'
|
|
89
|
-
post :create, :service_id => @service.to_param, :username => @username, :user_id => @user, :uri => 'http://www.example.com'
|
|
90
|
-
end
|
|
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
|
-
end
|
|
94
|
-
|
|
95
|
-
describe "POST create using uri - duplicate" do
|
|
96
|
-
before do
|
|
97
|
-
@service = Factory(:service)
|
|
98
|
-
@uri = TEST_URI
|
|
99
|
-
post :create, :service_id => @service.to_param, :uri => @uri, :user_id => @user
|
|
100
|
-
post :create, :service_id => @service.to_param, :uri => @uri, :user_id => @user
|
|
101
|
-
end
|
|
102
|
-
it "should set already added in the flash" do
|
|
103
|
-
ensure_flash_contains(I18n.t('muck.services.already_added_uri_feed', :uri => @uri))
|
|
104
|
-
end
|
|
105
|
-
it { should redirect_to( user_identity_feeds_url(@user.id) ) }
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
end
|
|
@@ -1,42 +0,0 @@
|
|
|
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
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
|
@@ -1,21 +0,0 @@
|
|
|
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,16 +0,0 @@
|
|
|
1
|
-
Factory.define :service_share, :class => 'share' do |f|
|
|
2
|
-
f.uri { Factory.next(:uri) }
|
|
3
|
-
f.title { Factory.next(:title) }
|
|
4
|
-
f.shared_by {|a| a.association(:user)}
|
|
5
|
-
f.entry {|a| a.association(:entry)}
|
|
6
|
-
end
|
|
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
|
-
|
|
13
|
-
Factory.define :recommendation do |r|
|
|
14
|
-
r.entry {|a| a.association(:entry)}
|
|
15
|
-
r.dest_entry {|a| a.association(:entry)}
|
|
16
|
-
end
|
|
@@ -1,31 +0,0 @@
|
|
|
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
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# == Schema Information
|
|
2
|
-
#
|
|
3
|
-
# Table name: aggregation_feeds
|
|
4
|
-
#
|
|
5
|
-
# id :integer(4) not null, primary key
|
|
6
|
-
# aggregation_id :integer(4)
|
|
7
|
-
# feed_id :integer(4)
|
|
8
|
-
# feed_type :string(255) default("Feed")
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
|
12
|
-
|
|
13
|
-
describe AggregationFeed do
|
|
14
|
-
|
|
15
|
-
describe "aggregation feed" do
|
|
16
|
-
before do
|
|
17
|
-
@aggregation_feed = Factory(:aggregation_feed)
|
|
18
|
-
end
|
|
19
|
-
it { should belong_to :aggregation }
|
|
20
|
-
it { should belong_to :feed }
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
end
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
# == Schema Information
|
|
2
|
-
#
|
|
3
|
-
# Table name: aggregations
|
|
4
|
-
#
|
|
5
|
-
# id :integer(4) not null, primary key
|
|
6
|
-
# terms :string(255)
|
|
7
|
-
# title :string(255)
|
|
8
|
-
# description :text
|
|
9
|
-
# top_tags :text
|
|
10
|
-
# created_at :datetime
|
|
11
|
-
# updated_at :datetime
|
|
12
|
-
# ownable_id :integer(4)
|
|
13
|
-
# ownable_type :string(255)
|
|
14
|
-
# feed_count :integer(4) default(0)
|
|
15
|
-
#
|
|
16
|
-
|
|
17
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
|
18
|
-
|
|
19
|
-
describe Aggregation do
|
|
20
|
-
|
|
21
|
-
describe "aggregation" do
|
|
22
|
-
before do
|
|
23
|
-
@aggregation = Factory(:aggregation)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
it { should belong_to :ownable }
|
|
29
|
-
it { should have_many :aggregation_feeds }
|
|
30
|
-
it { should have_many :feeds }
|
|
31
|
-
|
|
32
|
-
it { should scope_by_title }
|
|
33
|
-
it { should scope_newer_than }
|
|
34
|
-
it { should scope_by_newest }
|
|
35
|
-
|
|
36
|
-
describe "filter feed types" do
|
|
37
|
-
before do
|
|
38
|
-
build_music_service
|
|
39
|
-
Aggregation.delete_all
|
|
40
|
-
@aggregation = Factory(:aggregation, :terms => 'autumn')
|
|
41
|
-
@aggregation.add_feeds(nil, nil, true) # Generate all feeds
|
|
42
|
-
end
|
|
43
|
-
it "should get all feeds" do
|
|
44
|
-
assert @aggregation.all_feeds.length > 0
|
|
45
|
-
assert @aggregation.all_feeds.any?{ |feed| feed.service.photo? }
|
|
46
|
-
assert @aggregation.all_feeds.any?{ |feed| feed.service.video? }
|
|
47
|
-
assert @aggregation.all_feeds.any?{ |feed| feed.service.bookmark? }
|
|
48
|
-
assert @aggregation.all_feeds.any?{ |feed| feed.service.general? }
|
|
49
|
-
end
|
|
50
|
-
it "should only get photo feeds" do
|
|
51
|
-
assert @aggregation.photo_feeds(true).length > 0
|
|
52
|
-
assert @aggregation.photo_feeds.all?{ |feed| feed.service.photo? }
|
|
53
|
-
end
|
|
54
|
-
it "should only get video feeds" do
|
|
55
|
-
assert @aggregation.video_feeds(true).length > 0
|
|
56
|
-
assert @aggregation.video_feeds.all?{ |feed| feed.service.video? }
|
|
57
|
-
end
|
|
58
|
-
it "should only get bookmark feeds" do
|
|
59
|
-
assert @aggregation.bookmark_feeds(true).length > 0
|
|
60
|
-
assert @aggregation.bookmark_feeds.all?{ |feed| feed.service.bookmark? }
|
|
61
|
-
end
|
|
62
|
-
it "should only get music feeds" do
|
|
63
|
-
assert @aggregation.music_feeds(true).length > 0
|
|
64
|
-
assert @aggregation.music_feeds.all?{ |feed| feed.service.music? }
|
|
65
|
-
end
|
|
66
|
-
it "should only get general feeds" do
|
|
67
|
-
assert @aggregation.general_feeds(true).length > 0
|
|
68
|
-
assert @aggregation.general_feeds.all?{ |feed| feed.service.general? }
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
describe "add_feeds_by_uri" do
|
|
74
|
-
before do
|
|
75
|
-
@uris = ['http://www.example.com', 'http://www.justinball.com']
|
|
76
|
-
@aggregation = Factory(:aggregation)
|
|
77
|
-
@aggregation.add_feeds_by_uri(nil, @uris)
|
|
78
|
-
@aggregation.reload
|
|
79
|
-
end
|
|
80
|
-
it "should add feeds" do
|
|
81
|
-
@aggregation.feeds.length.should == @uris.length
|
|
82
|
-
end
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
end
|