muck-services 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. data/Rakefile +6 -9
  2. data/VERSION +1 -1
  3. data/muck-services.gemspec +241 -362
  4. metadata +9 -241
  5. data/.gitignore +0 -30
  6. data/test/rails_test/app/controllers/application_controller.rb +0 -24
  7. data/test/rails_test/app/controllers/default_controller.rb +0 -7
  8. data/test/rails_test/app/helpers/application_helper.rb +0 -3
  9. data/test/rails_test/app/models/activity.rb +0 -24
  10. data/test/rails_test/app/models/comment.rb +0 -23
  11. data/test/rails_test/app/models/country.rb +0 -13
  12. data/test/rails_test/app/models/language.rb +0 -15
  13. data/test/rails_test/app/models/share.rb +0 -20
  14. data/test/rails_test/app/models/state.rb +0 -13
  15. data/test/rails_test/app/models/user.rb +0 -45
  16. data/test/rails_test/app/models/user_session.rb +0 -2
  17. data/test/rails_test/config/application.rb +0 -42
  18. data/test/rails_test/config/boot.rb +0 -13
  19. data/test/rails_test/config/environment.rb +0 -5
  20. data/test/rails_test/config/environments/development.rb +0 -26
  21. data/test/rails_test/config/environments/production.rb +0 -49
  22. data/test/rails_test/config/environments/test.rb +0 -35
  23. data/test/rails_test/config/initializers/backtrace_silencers.rb +0 -7
  24. data/test/rails_test/config/initializers/inflections.rb +0 -10
  25. data/test/rails_test/config/initializers/mce_options.rb +0 -83
  26. data/test/rails_test/config/initializers/mime_types.rb +0 -5
  27. data/test/rails_test/config/initializers/muck.rb +0 -66
  28. data/test/rails_test/config/initializers/secret_token.rb +0 -7
  29. data/test/rails_test/config/initializers/session_store.rb +0 -8
  30. data/test/rails_test/config/routes.rb +0 -12
  31. data/test/rails_test/db/migrate/20090320174818_create_muck_permissions_and_roles.rb +0 -16
  32. data/test/rails_test/db/migrate/20090327231918_create_users.rb +0 -40
  33. data/test/rails_test/db/migrate/20090402033319_add_muck_activities.rb +0 -36
  34. data/test/rails_test/db/migrate/20090402234137_create_languages.rb +0 -18
  35. data/test/rails_test/db/migrate/20090426041056_create_countries.rb +0 -15
  36. data/test/rails_test/db/migrate/20090426041103_create_states.rb +0 -18
  37. data/test/rails_test/db/migrate/20090512013727_create_profiles.rb +0 -21
  38. data/test/rails_test/db/migrate/20090517040220_create_uploads.rb +0 -38
  39. data/test/rails_test/db/migrate/20090602191243_create_muck_raker.rb +0 -322
  40. data/test/rails_test/db/migrate/20090613173314_create_comments.rb +0 -24
  41. data/test/rails_test/db/migrate/20090619211125_create_tag_clouds.rb +0 -19
  42. data/test/rails_test/db/migrate/20090623181458_add_grain_size_to_entries.rb +0 -16
  43. data/test/rails_test/db/migrate/20090623193525_add_grain_size_to_tag_clouds.rb +0 -12
  44. data/test/rails_test/db/migrate/20090703055724_add_contents.rb +0 -49
  45. data/test/rails_test/db/migrate/20090703175825_denormalize_entries_subjects.rb +0 -42
  46. data/test/rails_test/db/migrate/20090704220055_create_slugs.rb +0 -18
  47. data/test/rails_test/db/migrate/20090716035935_change_tag_cloud_grain_sizes.rb +0 -9
  48. data/test/rails_test/db/migrate/20090717173900_add_contributor_to_feeds.rb +0 -9
  49. data/test/rails_test/db/migrate/20090717175825_normalize_entries_subjects.rb +0 -47
  50. data/test/rails_test/db/migrate/20090721043213_change_services_title_to_name.rb +0 -9
  51. data/test/rails_test/db/migrate/20090721054927_remove_services_not_null_from_feeds.rb +0 -9
  52. data/test/rails_test/db/migrate/20090723050510_create_feed_parents.rb +0 -17
  53. data/test/rails_test/db/migrate/20090728165716_add_etag_to_feeds.rb +0 -9
  54. data/test/rails_test/db/migrate/20090730044139_add_comment_cache.rb +0 -9
  55. data/test/rails_test/db/migrate/20090730045848_add_comment_cache_to_entries.rb +0 -9
  56. data/test/rails_test/db/migrate/20090730154102_allow_null_user.rb +0 -9
  57. data/test/rails_test/db/migrate/20090803185323_create_shares.rb +0 -16
  58. data/test/rails_test/db/migrate/20090804184247_add_comment_count_to_shares.rb +0 -9
  59. data/test/rails_test/db/migrate/20090804211240_add_entry_id_to_shares.rb +0 -9
  60. data/test/rails_test/db/migrate/20090804231857_add_shares_uri_index.rb +0 -9
  61. data/test/rails_test/db/migrate/20090806230610_add_layout_to_contents.rb +0 -9
  62. data/test/rails_test/db/migrate/20090808175401_add_contents_comment_counter_cache.rb +0 -9
  63. data/test/rails_test/db/migrate/20090818204527_add_activity_indexes.rb +0 -9
  64. data/test/rails_test/db/migrate/20090819030523_add_attachable_to_activities.rb +0 -13
  65. data/test/rails_test/db/migrate/20090826220530_change_services_sequence_to_sort.rb +0 -9
  66. data/test/rails_test/db/migrate/20090826225652_create_identity_feeds.rb +0 -14
  67. data/test/rails_test/db/migrate/20090827005105_add_identity_fields_to_services.rb +0 -13
  68. data/test/rails_test/db/migrate/20090827015308_create_service_categories.rb +0 -12
  69. data/test/rails_test/db/migrate/20090827221502_add_prompt_and_template_to_services.rb +0 -11
  70. data/test/rails_test/db/migrate/20090915041650_aggregations_to_polymorphic.rb +0 -15
  71. data/test/rails_test/db/migrate/20090922174200_update_oai_endpoints.rb +0 -13
  72. data/test/rails_test/db/migrate/20090922231552_add_dates_to_oai_endpoints.rb +0 -11
  73. data/test/rails_test/db/migrate/20090923150807_rename_name_in_aggregation.rb +0 -9
  74. data/test/rails_test/db/migrate/20090924200750_add_uri_data_template_to_services.rb +0 -9
  75. data/test/rails_test/db/migrate/20091006183742_add_feed_count_to_aggregation.rb +0 -9
  76. data/test/rails_test/db/migrate/20091022150615_add_uri_key_to_services.rb +0 -9
  77. data/test/rails_test/db/migrate/20091115011828_add_aggregations_for_personal_recs.rb +0 -9
  78. data/test/rails_test/db/migrate/20091116094447_rename_action_table.rb +0 -38
  79. data/test/rails_test/db/migrate/20091118203605_add_default_feed_type_to_aggregation_feed.rb +0 -10
  80. data/test/rails_test/db/migrate/20091124203137_add_location_to_profiles.rb +0 -15
  81. data/test/rails_test/db/migrate/20091124205819_add_fields_to_profiles.rb +0 -21
  82. data/test/rails_test/db/migrate/20100123035450_create_access_codes.rb +0 -19
  83. data/test/rails_test/db/migrate/20100123233654_create_access_code_requests.rb +0 -14
  84. data/test/rails_test/db/migrate/20100206000906_remove_name_fields.rb +0 -15
  85. data/test/rails_test/db/migrate/20100903205928_add_dead_entry_fields.rb +0 -13
  86. data/test/rails_test/features/step_definitions/common_steps.rb +0 -93
  87. data/test/rails_test/features/step_definitions/visit_steps.rb +0 -6
  88. data/test/rails_test/features/step_definitions/web_steps.rb +0 -219
  89. data/test/rails_test/features/step_definitions/webrat_steps.rb +0 -128
  90. data/test/rails_test/features/support/custom_env.rb +0 -19
  91. data/test/rails_test/features/support/env.rb +0 -58
  92. data/test/rails_test/features/support/paths.rb +0 -33
  93. data/test/rails_test/lib/daemons/amazonaws.rb +0 -36
  94. data/test/rails_test/public/dispatch.rb +0 -10
  95. data/test/rails_test/spec/controllers/admin/feeds_controller_spec.rb +0 -38
  96. data/test/rails_test/spec/controllers/admin/oai_endpoints_controller_spec.rb +0 -30
  97. data/test/rails_test/spec/controllers/aggregation_feeds_controller_spec.rb +0 -67
  98. data/test/rails_test/spec/controllers/aggregations_controller_spec.rb +0 -89
  99. data/test/rails_test/spec/controllers/feed_previews_controller_spec.rb +0 -32
  100. data/test/rails_test/spec/controllers/feeds_controller_spec.rb +0 -78
  101. data/test/rails_test/spec/controllers/identity_feeds_controller_spec.rb +0 -110
  102. data/test/rails_test/spec/controllers/oai_endpoints_controller_spec.rb +0 -42
  103. data/test/rails_test/spec/controllers/topics_controller_spec.rb +0 -50
  104. data/test/rails_test/spec/controllers/visits_controller_spec.rb +0 -21
  105. data/test/rails_test/spec/factories.rb +0 -16
  106. data/test/rails_test/spec/mailers/services_mailer_spec.rb +0 -31
  107. data/test/rails_test/spec/models/aggregation_feed_spec.rb +0 -23
  108. data/test/rails_test/spec/models/aggregation_spec.rb +0 -87
  109. data/test/rails_test/spec/models/entry_spec.rb +0 -195
  110. data/test/rails_test/spec/models/feed_parent_spec.rb +0 -22
  111. data/test/rails_test/spec/models/feed_spec.rb +0 -204
  112. data/test/rails_test/spec/models/identity_feed_spec.rb +0 -18
  113. data/test/rails_test/spec/models/oai_endpoint_spec.rb +0 -78
  114. data/test/rails_test/spec/models/personal_recommendation_spec.rb +0 -60
  115. data/test/rails_test/spec/models/recommendation_spec.rb +0 -27
  116. data/test/rails_test/spec/models/service_category_spec.rb +0 -19
  117. data/test/rails_test/spec/models/service_spec.rb +0 -383
  118. data/test/rails_test/spec/models/share_spec.rb +0 -30
  119. data/test/rails_test/spec/models/tag_cloud_spec.rb +0 -23
  120. data/test/rails_test/spec/models/user_spec.rb +0 -45
  121. data/test/rails_test/spec/spec_helper.rb +0 -36
@@ -1,128 +0,0 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
2
-
3
- # Commonly used webrat steps
4
- # http://github.com/brynary/webrat
5
-
6
- Given /^I am on (.+)$/ do |page_name|
7
- visit path_to(page_name)
8
- end
9
-
10
- When /^I go to (.+)$/ do |page_name|
11
- visit path_to(page_name)
12
- end
13
-
14
- When /^I press "([^\"]*)"$/ do |button|
15
- click_button(button)
16
- end
17
-
18
- When /^I follow "([^\"]*)"$/ do |link|
19
- click_link(link)
20
- end
21
-
22
- When /^I fill in "([^\"]*)" with "([^\"]*)"$/ do |field, value|
23
- fill_in(field, :with => value)
24
- end
25
-
26
- When /^I select "([^\"]*)" from "([^\"]*)"$/ do |value, field|
27
- select(value, :from => field)
28
- end
29
-
30
- # Use this step in conjunction with Rail's datetime_select helper. For example:
31
- # When I select "December 25, 2008 10:00" as the date and time
32
- When /^I select "([^\"]*)" as the date and time$/ do |time|
33
- select_datetime(time)
34
- end
35
-
36
- # Use this step when using multiple datetime_select helpers on a page or
37
- # you want to specify which datetime to select. Given the following view:
38
- # <%= f.label :preferred %><br />
39
- # <%= f.datetime_select :preferred %>
40
- # <%= f.label :alternative %><br />
41
- # <%= f.datetime_select :alternative %>
42
- # The following steps would fill out the form:
43
- # When I select "November 23, 2004 11:20" as the "Preferred" date and time
44
- # And I select "November 25, 2004 10:30" as the "Alternative" date and time
45
- When /^I select "([^\"]*)" as the "([^\"]*)" date and time$/ do |datetime, datetime_label|
46
- select_datetime(datetime, :from => datetime_label)
47
- end
48
-
49
- # Use this step in conjunction with Rail's time_select helper. For example:
50
- # When I select "2:20PM" as the time
51
- # Note: Rail's default time helper provides 24-hour time-- not 12 hour time. Webrat
52
- # will convert the 2:20PM to 14:20 and then select it.
53
- When /^I select "([^\"]*)" as the time$/ do |time|
54
- select_time(time)
55
- end
56
-
57
- # Use this step when using multiple time_select helpers on a page or you want to
58
- # specify the name of the time on the form. For example:
59
- # When I select "7:30AM" as the "Gym" time
60
- When /^I select "([^\"]*)" as the "([^\"]*)" time$/ do |time, time_label|
61
- select_time(time, :from => time_label)
62
- end
63
-
64
- # Use this step in conjunction with Rail's date_select helper. For example:
65
- # When I select "February 20, 1981" as the date
66
- When /^I select "([^\"]*)" as the date$/ do |date|
67
- select_date(date)
68
- end
69
-
70
- # Use this step when using multiple date_select helpers on one page or
71
- # you want to specify the name of the date on the form. For example:
72
- # When I select "April 26, 1982" as the "Date of Birth" date
73
- When /^I select "([^\"]*)" as the "([^\"]*)" date$/ do |date, date_label|
74
- select_date(date, :from => date_label)
75
- end
76
-
77
- When /^I check "([^\"]*)"$/ do |field|
78
- check(field)
79
- end
80
-
81
- When /^I uncheck "([^\"]*)"$/ do |field|
82
- uncheck(field)
83
- end
84
-
85
- When /^I choose "([^\"]*)"$/ do |field|
86
- choose(field)
87
- end
88
-
89
- When /^I attach the file at "([^\"]*)" to "([^\"]*)"$/ do |path, field|
90
- attach_file(field, path)
91
- end
92
-
93
- Then /^I should see "([^\"]*)"$/ do |text|
94
- response.should contain(text)
95
- end
96
-
97
- Then /^I should see \/([^\/]*)\/$/ do |regexp|
98
- regexp = Regexp.new(regexp)
99
- response.should contain(regexp)
100
- end
101
-
102
- Then /^I should not see "([^\"]*)"$/ do |text|
103
- response.should_not contain(text)
104
- end
105
-
106
- Then /^I should not see \/([^\/]*)\/$/ do |regexp|
107
- response.should_not contain(text)
108
- end
109
-
110
- Then /^the "([^\"]*)" field should contain "([^\"]*)"$/ do |field, value|
111
- field_labeled(field).value.should =~ /#{value}/
112
- end
113
-
114
- Then /^the "([^\"]*)" field should not contain "([^\"]*)"$/ do |field, value|
115
- field_labeled(field).value.should_not =~ /#{value}/
116
- end
117
-
118
- Then /^the "([^\"]*)" checkbox should be checked$/ do |label|
119
- field_labeled(label).should be_checked
120
- end
121
-
122
- Then /^the "([^\"]*)" checkbox should not be checked$/ do |label|
123
- field_labeled(label).should_not be_checked
124
- end
125
-
126
- Then /^I should be on (.+)$/ do |page_name|
127
- URI.parse(current_url).path.should == path_to(page_name)
128
- end
@@ -1,19 +0,0 @@
1
- require 'capybara/rails'
2
- require 'capybara/cucumber'
3
-
4
- Capybara.default_driver = :selenium
5
- Capybara.app_host = "http://localhost:8888"
6
- Capybara.default_wait_time = 10
7
-
8
- require "selenium-webdriver"
9
- Selenium::WebDriver::Firefox::Binary.path = '/Applications/Firefox.app/Contents/MacOS/firefox-bin'
10
-
11
- require 'factory_girl'
12
- require 'muck_test_helper'
13
-
14
- Before do
15
- # Create admin user:
16
- Rake::Task[ 'muck:users:create_admin' ].execute
17
-
18
- visit "/logout"
19
- end
@@ -1,58 +0,0 @@
1
- # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
2
- # It is recommended to regenerate this file in the future when you upgrade to a
3
- # newer version of cucumber-rails. Consider adding your own code to a new file
4
- # instead of editing this one. Cucumber will automatically load all features/**/*.rb
5
- # files.
6
-
7
- ENV["RAILS_ENV"] ||= "test"
8
- require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
9
-
10
- require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support
11
- require 'cucumber/rails/rspec'
12
- require 'cucumber/rails/world'
13
- require 'cucumber/rails/active_record'
14
- require 'cucumber/web/tableish'
15
-
16
- require 'capybara/rails'
17
- require 'capybara/cucumber'
18
- require 'capybara/session'
19
- require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript
20
- # Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In
21
- # order to ease the transition to Capybara we set the default here. If you'd
22
- # prefer to use XPath just remove this line and adjust any selectors in your
23
- # steps to use the XPath syntax.
24
- Capybara.default_selector = :css
25
-
26
- # If you set this to false, any error raised from within your app will bubble
27
- # up to your step definition and out to cucumber unless you catch it somewhere
28
- # on the way. You can make Rails rescue errors and render error pages on a
29
- # per-scenario basis by tagging a scenario or feature with the @allow-rescue tag.
30
- #
31
- # If you set this to true, Rails will rescue all errors and render error
32
- # pages, more or less in the same way your application would behave in the
33
- # default production environment. It's not recommended to do this for all
34
- # of your scenarios, as this makes it hard to discover errors in your application.
35
- ActionController::Base.allow_rescue = false
36
-
37
- # If you set this to true, each scenario will run in a database transaction.
38
- # You can still turn off transactions on a per-scenario basis, simply tagging
39
- # a feature or scenario with the @no-txn tag. If you are using Capybara,
40
- # tagging with @culerity or @javascript will also turn transactions off.
41
- #
42
- # If you set this to false, transactions will be off for all scenarios,
43
- # regardless of whether you use @no-txn or not.
44
- #
45
- # Beware that turning transactions off will leave data in your database
46
- # after each scenario, which can lead to hard-to-debug failures in
47
- # subsequent scenarios. If you do this, we recommend you create a Before
48
- # block that will explicitly put your database in a known state.
49
- Cucumber::Rails::World.use_transactional_fixtures = true
50
- # How to clean your database when transactions are turned off. See
51
- # http://github.com/bmabey/database_cleaner for more info.
52
- if defined?(ActiveRecord::Base)
53
- begin
54
- require 'database_cleaner'
55
- DatabaseCleaner.strategy = :truncation
56
- rescue LoadError => ignore_if_database_cleaner_not_present
57
- end
58
- end
@@ -1,33 +0,0 @@
1
- module NavigationHelpers
2
- # Maps a name to a path. Used by the
3
- #
4
- # When /^I go to (.+)$/ do |page_name|
5
- #
6
- # step definition in web_steps.rb
7
- #
8
- def path_to(page_name)
9
- case page_name
10
-
11
- when /the home\s?page/
12
- '/'
13
-
14
- # Add more mappings here.
15
- # Here is an example that pulls values out of the Regexp:
16
- #
17
- # when /^(.*)'s profile page$/i
18
- # user_profile_path(User.find_by_login($1))
19
-
20
- else
21
- begin
22
- page_name =~ /the (.*) page/
23
- path_components = $1.split(/\s+/)
24
- self.send(path_components.push('path').join('_').to_sym)
25
- rescue Object => e
26
- raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
27
- "Now, go and add a mapping in #{__FILE__}"
28
- end
29
- end
30
- end
31
- end
32
-
33
- World(NavigationHelpers)
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # You might want to change this
4
- ENV["RAILS_ENV"] ||= "production"
5
-
6
- require File.dirname(__FILE__) + "/../../config/environment"
7
-
8
- $running = true
9
- Signal.trap("TERM") do
10
- $running = false
11
- end
12
-
13
- # Waiting is a timer variable to allow the daemon to restart
14
- # within two seconds of the Signal rather than using a long
15
- # sleep command and forcing the daemon to wait.
16
- $waiting = 0
17
-
18
- ActiveRecord::Base.logger.info "[AmazonS3] Migration daemon started at #{Time.now}.\n"
19
-
20
- while($running) do
21
-
22
- if $waiting < 120
23
- $waiting += 2
24
- sleep 2
25
- else
26
- $waiting = 0
27
- upload = Upload.pending_s3_migrations.first
28
-
29
- if upload
30
- $waiting = 120 - 2
31
- ActiveRecord::Base.logger.info "[AmazonS3] Migrating upload ##{upload.id}\n"
32
- upload.remote = upload.local
33
- upload.save!
34
- end
35
- end
36
- end
@@ -1,10 +0,0 @@
1
- #!/opt/local/bin/ruby
2
-
3
- require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
4
-
5
- # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
6
- # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
7
- require "dispatcher"
8
-
9
- ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
10
- Dispatcher.dispatch
@@ -1,38 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../spec_helper'
2
-
3
- describe Admin::Muck::FeedsController do
4
-
5
- render_views
6
-
7
- describe "admin feeds controller" do
8
-
9
- it { should require_login :index, :get }
10
- it { should require_login :update, :put }
11
-
12
- describe "logged in as admin" do
13
- before do
14
- @admin = Factory(:user)
15
- @admin_role = Factory(:role, :rolename => 'administrator')
16
- @admin.roles << @admin_role
17
- activate_authlogic
18
- login_as @admin
19
- end
20
- describe "GET index" do
21
- before do
22
- get :index
23
- end
24
- it { should_not set_the_flash }
25
- it { should respond_with :success }
26
- it { should render_template :index }
27
- end
28
- describe "PUT update" do
29
- before do
30
- @feed = Factory(:feed)
31
- put :update, :id => @feed, :status => true
32
- end
33
- it { should redirect_to( admin_feeds_path ) }
34
- end
35
- end
36
- end
37
-
38
- end
@@ -1,30 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../spec_helper'
2
-
3
- describe Admin::Muck::OaiEndpointsController do
4
-
5
- render_views
6
-
7
- describe "admin oai endpoints controller" do
8
-
9
- it { should require_login :index, :get }
10
-
11
- describe "logged in as admin" do
12
- before do
13
- @admin = Factory(:user)
14
- @admin_role = Factory(:role, :rolename => 'administrator')
15
- @admin.roles << @admin_role
16
- activate_authlogic
17
- login_as @admin
18
- end
19
- describe "GET index" do
20
- before do
21
- get :index
22
- end
23
- it { should_not set_the_flash }
24
- it { should respond_with :success }
25
- it { should render_template :index }
26
- end
27
- end
28
- end
29
-
30
- end
@@ -1,67 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
2
-
3
- describe Muck::AggregationFeedsController do
4
-
5
- render_views
6
-
7
- describe "aggregation feeds controller" do
8
- before do
9
- @aggregation = Factory(:aggregation)
10
- @feed = Factory(:feed)
11
- @aggregation.feeds << @feed
12
- end
13
-
14
- describe "not logged in" do
15
- describe "DELETE destroy" do
16
- before do
17
- delete :destroy, :id => -1, :aggregation_id => @aggregation.id, :feed_id => @feed.id
18
- end
19
- it { should redirect_to( login_path ) }
20
- it "should set the flash to can't delete" do
21
- ensure_flash_contains(I18n.t('muck.services.cant_modify_aggregation'))
22
- end
23
- end
24
-
25
- describe "DELETE destroy json" do
26
- before do
27
- delete :destroy, :id => -1, :aggregation_id => @aggregation.id, :feed_id => @feed.id, :format => 'json'
28
- end
29
- it { should redirect_to( login_path ) }
30
- end
31
-
32
- end
33
-
34
- describe "logged in with permissions" do
35
- before do
36
- @admin = Factory(:user)
37
- @admin_role = Factory(:role, :rolename => 'administrator')
38
- @admin.roles << @admin_role
39
- activate_authlogic
40
- login_as @admin
41
- end
42
-
43
- describe "DELETE destroy" do
44
- before do
45
- delete :destroy, :id => -1, :aggregation_id => @aggregation.id, :feed_id => @feed.id
46
- end
47
- it { should redirect_to( user_aggregation_path(@aggregation.ownable, @aggregation) ) }
48
- it "should set the flash to deleted" do
49
- ensure_flash_contains(I18n.t('muck.services.feed_remove'))
50
- end
51
- end
52
-
53
- describe "DELETE destroy json" do
54
- before do
55
- delete :destroy, :id => -1, :aggregation_id => @aggregation.id, :feed_id => @feed.id, :format => 'json'
56
- end
57
- it { should respond_with :success }
58
- it "should contain success:false in the result" do
59
- JSON.parse(@response.body)['success'] == true
60
- end
61
- end
62
-
63
- end
64
-
65
- end
66
-
67
- end
@@ -1,89 +0,0 @@
1
- require File.dirname(__FILE__) + '/../spec_helper'
2
-
3
- describe Muck::AggregationsController do
4
-
5
- render_views
6
-
7
- describe "aggregations controller" do
8
- before do
9
- @admin = Factory(:user)
10
- @admin_role = Factory(:role, :rolename => 'administrator')
11
- @admin.roles << @admin_role
12
- activate_authlogic
13
- login_as @admin
14
- end
15
-
16
- describe "GET index" do
17
- before do
18
- get :index
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
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 "GET show" do
35
- before do
36
- @aggregation = Factory(:aggregation)
37
- get :show, :id => @aggregation.to_param
38
- end
39
- it { should_not set_the_flash }
40
- it { should respond_with :success }
41
- it { should render_template :show }
42
- end
43
-
44
- describe "GET edit" do
45
- before do
46
- @aggregation = Factory(:aggregation)
47
- get :edit, :id => @aggregation.to_param
48
- end
49
- it { should_not set_the_flash }
50
- it { should respond_with :success }
51
- it { should render_template :edit }
52
- end
53
-
54
- describe "POST create" do
55
- before do
56
- @term = 'example'
57
- post :create, :aggregation => { :terms => @term }
58
- end
59
- it { should redirect_to( edit_aggregation_path(assigns(:aggregation)) ) }
60
- it "should set the flash to add feeds" do
61
- ensure_flash_contains(I18n.t('muck.services.add_feeds_to_aggregation', :title => @term))
62
- end
63
- end
64
-
65
- describe "PUT update" do
66
- before do
67
- @aggregation = Factory(:aggregation)
68
- put :update, :id => @aggregation.to_param, :aggregation => { :terms => 'fish' }
69
- end
70
- it { should redirect_to( edit_user_aggregation_path(@aggregation.ownable, assigns(:aggregation)) ) }
71
- it "should set the flash to updated aggregation" do
72
- ensure_flash_contains(I18n.t('muck.services.aggregation_updated'))
73
- end
74
- end
75
-
76
- describe "DELETE destroy" do
77
- before do
78
- @aggregation = Factory(:aggregation)
79
- delete :destroy, :id => @aggregation.to_param
80
- end
81
- it { should redirect_to( user_aggregations_path(@aggregation.ownable) ) }
82
- it "should set the flash to deleted" do
83
- ensure_flash_contains(I18n.t('muck.services.aggregation_deleted', :title => ''))
84
- end
85
- end
86
-
87
- end
88
-
89
- end