Prefer #map over #collect in legacy specs

Signed-off-by: Alex Coles <alex@alexbcoles.com>
pull/2786/head
Alex Coles 10 years ago
parent 98401bef18
commit 590481a01a
  1. 4
      test/functional/repositories_git_controller_test.rb
  2. 8
      test/functional/repositories_subversion_controller_test.rb
  3. 2
      test/functional/timelog_controller_test.rb
  4. 4
      test/functional/workflows_controller_test.rb
  5. 2
      test/unit/activity_test.rb
  6. 2
      test/unit/changeset_test.rb
  7. 2
      test/unit/custom_field_user_format_test.rb
  8. 8
      test/unit/group_test.rb
  9. 2
      test/unit/lib/redmine/hook_test.rb
  10. 2
      test/unit/lib/redmine/notifiable_test.rb
  11. 10
      test/unit/lib/redmine/scm/adapters/filesystem_adapter_test.rb
  12. 2
      test/unit/lib/redmine_test.rb
  13. 2
      test/unit/mail_handler_test.rb
  14. 28
      test/unit/project_test.rb
  15. 20
      test/unit/query_test.rb
  16. 34
      test/unit/repository_git_test.rb
  17. 4
      test/unit/repository_subversion_test.rb
  18. 2
      test/unit/type_test.rb
  19. 4
      test/unit/user_test.rb
  20. 2
      test/unit/wiki_page_test.rb

@ -124,7 +124,7 @@ describe RepositoriesController, 'Git', type: :controller do
assert_response :success
assert_template 'show'
assert_not_nil assigns(:entries)
assert_equal ['edit.png'], assigns(:entries).collect(&:name)
assert_equal ['edit.png'], assigns(:entries).map(&:name)
entry = assigns(:entries).detect { |e| e.name == 'edit.png' }
assert_not_nil entry
assert_equal 'file', entry.kind
@ -140,7 +140,7 @@ describe RepositoriesController, 'Git', type: :controller do
assert_response :success
assert_template 'show'
assert_not_nil assigns(:entries)
assert_equal ['delete.png'], assigns(:entries).collect(&:name)
assert_equal ['delete.png'], assigns(:entries).map(&:name)
assert_not_nil assigns(:changesets)
assigns(:changesets).size > 0
end

@ -88,7 +88,7 @@ describe RepositoriesController, 'Subversion', type: :controller do
assert_response :success
assert_template 'show'
assert_not_nil assigns(:entries)
assert_equal ['[folder_with_brackets]', 'folder', '.project', 'helloworld.c', 'textfile.txt'], assigns(:entries).collect(&:name)
assert_equal ['[folder_with_brackets]', 'folder', '.project', 'helloworld.c', 'textfile.txt'], assigns(:entries).map(&:name)
entry = assigns(:entries).detect { |e| e.name == 'helloworld.c' }
assert_equal 'file', entry.kind
assert_equal 'subversion_test/helloworld.c', entry.path
@ -102,7 +102,7 @@ describe RepositoriesController, 'Subversion', type: :controller do
assert_response :success
assert_template 'show'
assert_not_nil assigns(:entries)
assert_equal ['folder', '.project', 'helloworld.c', 'helloworld.rb', 'textfile.txt'], assigns(:entries).collect(&:name)
assert_equal ['folder', '.project', 'helloworld.c', 'helloworld.rb', 'textfile.txt'], assigns(:entries).map(&:name)
end
it 'should file changes' do
@ -114,7 +114,7 @@ describe RepositoriesController, 'Subversion', type: :controller do
changesets = assigns(:changesets)
assert_not_nil changesets
assert_equal %w(6 3 2), changesets.collect(&:revision)
assert_equal %w(6 3 2), changesets.map(&:revision)
# svn properties displayed with svn >= 1.5 only
if Redmine::Scm::Adapters::SubversionAdapter.client_version_above?([1, 5, 0])
@ -136,7 +136,7 @@ describe RepositoriesController, 'Subversion', type: :controller do
changesets = assigns(:changesets)
assert_not_nil changesets
assert_equal %w(10 9 7 6 5 2), changesets.collect(&:revision)
assert_equal %w(10 9 7 6 5 2), changesets.map(&:revision)
end
it 'should entry' do

@ -180,7 +180,7 @@ describe TimelogController, type: :controller do
assert_not_nil assigns(:entries)
assert_equal 4, assigns(:entries).size
# project and subproject
assert_equal [1, 3], assigns(:entries).collect(&:project_id).uniq.sort
assert_equal [1, 3], assigns(:entries).map(&:project_id).uniq.sort
assert_not_nil assigns(:total_hours)
assert_equal '162.90', '%.2f' % assigns(:total_hours)
# display all time by default

@ -71,7 +71,7 @@ describe WorkflowsController, type: :controller do
# used status only
assert_not_nil assigns(:statuses)
assert_equal [2, 3, 5], assigns(:statuses).collect(&:id)
assert_equal [2, 3, 5], assigns(:statuses).map(&:id)
# allowed transitions
assert_tag tag: 'input', attributes: { type: 'checkbox',
@ -191,6 +191,6 @@ describe WorkflowsController, type: :controller do
# Returns an array of status transitions that can be compared
def status_transitions(conditions)
Workflow.find(:all, conditions: conditions,
order: 'type_id, role_id, old_status_id, new_status_id').collect { |w| [w.old_status, w.new_status_id] }
order: 'type_id, role_id, old_status_id, new_status_id').map { |w| [w.old_status, w.new_status_id] }
end
end

@ -100,7 +100,7 @@ describe Activity, type: :model do
events = Redmine::Activity::Fetcher.new(user, options).events(Date.today - 30, Date.today + 1)
# Because events are provided by the journals, but we want to test for
# their targets here, transform that
events.collect do |e|
events.map do |e|
e.provider.new.activitied_type.find(e.journable_id)
end
end

@ -137,7 +137,7 @@ describe Changeset, type: :model do
assert WorkPackage.find(2).closed?
times = TimeEntry.all(order: 'id desc', limit: 2)
assert_equal [1, 2], times.collect(&:work_package_id).sort
assert_equal [1, 2], times.map(&:work_package_id).sort
end
it 'should ref keywords any line start' do

@ -49,7 +49,7 @@ describe 'CustomFieldFormat' do # TODO: what is this?
it 'should possible_values_with_project_resource' do
possible_values = @field.possible_values(@project.work_packages.first)
assert possible_values.any?
assert_equal @project.users.sort.collect(&:id).map(&:to_s), possible_values
assert_equal @project.users.sort.map(&:id).map(&:to_s), possible_values
end
it 'should possible_values_with_nil_project_resource' do

@ -70,16 +70,16 @@ describe Group, type: :model do
group.save!
member.role_ids = [role_ids.first]
assert_equal [role_ids.first], user.reload.roles_for_project(member.project).collect(&:id).sort
assert_equal [role_ids.first], user.reload.roles_for_project(member.project).map(&:id).sort
member.role_ids = role_ids
assert_equal role_ids, user.reload.roles_for_project(member.project).collect(&:id).sort
assert_equal role_ids, user.reload.roles_for_project(member.project).map(&:id).sort
member.role_ids = [role_ids.last]
assert_equal [role_ids.last], user.reload.roles_for_project(member.project).collect(&:id).sort
assert_equal [role_ids.last], user.reload.roles_for_project(member.project).map(&:id).sort
member.role_ids = [role_ids.first]
assert_equal [role_ids.first], user.reload.roles_for_project(member.project).collect(&:id).sort
assert_equal [role_ids.first], user.reload.roles_for_project(member.project).map(&:id).sort
end
it 'should roles removed when removing group membership' do

@ -48,7 +48,7 @@ describe 'Redmine::Hook::Manager' do # FIXME: naming (RSpec-port)
class TestHook3 < TestHook
def view_layouts_base_html_head(context)
"Context keys: #{context.keys.collect(&:to_s).sort.join(', ')}."
"Context keys: #{context.keys.map(&:to_s).sort.join(', ')}."
end
end

@ -33,7 +33,7 @@ describe Redmine::Notifiable do
assert_equal 11, Redmine::Notifiable.all.length
%w(work_package_added work_package_updated work_package_note_added status_updated work_package_priority_updated news_added news_comment_added file_added message_posted wiki_content_added wiki_content_updated).each do |notifiable|
assert Redmine::Notifiable.all.collect(&:name).include?(notifiable), "missing #{notifiable}"
assert Redmine::Notifiable.all.map(&:name).include?(notifiable), "missing #{notifiable}"
end
end
end

@ -40,15 +40,15 @@ describe Redmine::Scm::Adapters::FilesystemAdapter, type: :model do
it 'should entries' do
assert_equal 3, @adapter.entries.size
assert_equal ['dir', 'japanese', 'test'], @adapter.entries.collect(&:name)
assert_equal ['dir', 'japanese', 'test'], @adapter.entries(nil).collect(&:name)
assert_equal ['dir', 'japanese', 'test'], @adapter.entries('/').collect(&:name)
assert_equal ['dir', 'japanese', 'test'], @adapter.entries.map(&:name)
assert_equal ['dir', 'japanese', 'test'], @adapter.entries(nil).map(&:name)
assert_equal ['dir', 'japanese', 'test'], @adapter.entries('/').map(&:name)
['dir', '/dir', '/dir/', 'dir/'].each do |path|
assert_equal ['subdir', 'dirfile'], @adapter.entries(path).collect(&:name)
assert_equal ['subdir', 'dirfile'], @adapter.entries(path).map(&:name)
end
# If y try to use "..", the path is ignored
['/../', 'dir/../', '..', '../', '/..', 'dir/..'].each do |path|
assert_equal ['dir', 'japanese', 'test'], @adapter.entries(path).collect(&:name),
assert_equal ['dir', 'japanese', 'test'], @adapter.entries(path).map(&:name),
'.. must be ignored in path argument'
end
end

@ -35,7 +35,7 @@ module RedmineMenuTestHelper
end
def assert_menu_contains_item_named(menu_name, item_name)
assert Redmine::MenuManager.items(menu_name).collect(&:name).include?(item_name.to_sym), "Menu did not have an item named #{item_name}"
assert Redmine::MenuManager.items(menu_name).map(&:name).include?(item_name.to_sym), "Menu did not have an item named #{item_name}"
end
# Helpers

@ -35,7 +35,7 @@ describe MailHandler, type: :model do
before do
ActionMailer::Base.deliveries.clear
Setting.notified_events = Redmine::Notifiable.all.collect(&:name)
Setting.notified_events = Redmine::Notifiable.all.map(&:name)
end
it 'should add work package' do

@ -333,7 +333,7 @@ describe Project, type: :model do
it 'should ancestors' do
a = Project.find(6).ancestors
assert a.first.is_a?(Project)
assert_equal [1, 5], a.collect(&:id)
assert_equal [1, 5], a.map(&:id)
end
it 'should root' do
@ -347,13 +347,13 @@ describe Project, type: :model do
assert c.first.is_a?(Project)
# ignore ordering, since it depends on database collation configuration
# and may order lowercase/uppercase chars in a different order
assert_equal [3, 4, 5], c.collect(&:id).sort!
assert_equal [3, 4, 5], c.map(&:id).sort!
end
it 'should descendants' do
d = Project.find(1).descendants
assert d.first.is_a?(Project)
assert_equal [5, 6, 3, 4], d.collect(&:id)
assert_equal [5, 6, 3, 4], d.map(&:id)
end
it 'should allowed parents should be empty for non member user' do
@ -420,12 +420,12 @@ describe Project, type: :model do
child = parent.children.find(3)
assert_equal [1, 2], parent.type_ids
assert_equal [2, 3], child.types.collect(&:id)
assert_equal [2, 3], child.types.map(&:id)
assert_kind_of Type, parent.rolled_up_types.first
assert_equal [999, 1, 2, 3], parent.rolled_up_types.collect(&:id)
assert_equal [2, 3], child.rolled_up_types.collect(&:id)
assert_equal [999, 1, 2, 3], parent.rolled_up_types.map(&:id)
assert_equal [2, 3], child.rolled_up_types.map(&:id)
end
it 'should rolled up types should ignore archived subprojects' do
@ -435,7 +435,7 @@ describe Project, type: :model do
child.types = Type.find([1, 3])
parent.children.each(&:archive)
assert_equal [1, 2], parent.rolled_up_types.collect(&:id)
assert_equal [1, 2], parent.rolled_up_types.map(&:id)
end
context 'description' do
@ -570,14 +570,14 @@ describe Project, type: :model do
assert_equal [1, 2, 3], parent.version_ids.sort
assert_equal [4], child.version_ids
assert_equal [6], private_child.version_ids
assert_equal [7], Version.find_all_by_sharing('system').collect(&:id)
assert_equal [7], Version.find_all_by_sharing('system').map(&:id)
assert_equal 6, parent.shared_versions.size
parent.shared_versions.each do |version|
assert_kind_of Version, version
end
assert_equal [1, 2, 3, 4, 6, 7], parent.shared_versions.collect(&:id).sort
assert_equal [1, 2, 3, 4, 6, 7], parent.shared_versions.map(&:id).sort
end
it 'should shared versions should ignore archived subprojects' do
@ -588,7 +588,7 @@ describe Project, type: :model do
assert_equal [1, 2, 3], parent.version_ids.sort
assert_equal [4], child.version_ids
assert !parent.shared_versions.collect(&:id).include?(4)
assert !parent.shared_versions.map(&:id).include?(4)
end
it 'should shared versions visible to user' do
@ -606,7 +606,7 @@ describe Project, type: :model do
assert_kind_of Version, version
end
assert !versions.collect(&:id).include?(6)
assert !versions.map(&:id).include?(6)
end
it 'should next identifier' do
@ -635,11 +635,11 @@ describe Project, type: :model do
modules = project.enabled_modules.slice(0..-2)
assert modules.any?
assert_difference 'EnabledModule.count', -1 do
project.enabled_module_names = modules.collect(&:name)
project.enabled_module_names = modules.map(&:name)
end
project.reload
# Ids should be preserved
assert_equal project.enabled_module_ids.sort, modules.collect(&:id).sort
assert_equal project.enabled_module_ids.sort, modules.map(&:id).sort
end
it 'should copy from existing project' do
@ -756,7 +756,7 @@ describe Project, type: :model do
@source_project = Project.find(2)
@project = Project.new(name: 'Copy Test', identifier: 'copy-test')
@project.types = @source_project.types
@project.enabled_module_names = @source_project.enabled_modules.collect(&:name)
@project.enabled_module_names = @source_project.enabled_modules.map(&:name)
end
it 'should copy work units' do

@ -259,7 +259,7 @@ describe Query, type: :model do
it 'should set column names' do
q = Query.new name: '_'
q.column_names = ['type', :subject, '', 'unknonw_column']
assert_equal [:type, :subject], q.columns.collect(&:name)
assert_equal [:type, :subject], q.columns.map(&:name)
c = q.columns.first
assert q.has_column?(c)
end
@ -319,7 +319,7 @@ describe Query, type: :model do
include: [:assigned_to, :status, :type, :project, :priority],
conditions: q.statement,
order: "#{c.sortable} ASC"
values = issues.collect { |i| i.custom_value_for(c.custom_field).to_s }
values = issues.map { |i| i.custom_value_for(c.custom_field).to_s }
assert !values.empty?
assert_equal values.sort, values
end
@ -333,7 +333,7 @@ describe Query, type: :model do
include: [:assigned_to, :status, :type, :project, :priority],
conditions: q.statement,
order: "#{c.sortable} DESC"
values = issues.collect { |i| i.custom_value_for(c.custom_field).to_s }
values = issues.map { |i| i.custom_value_for(c.custom_field).to_s }
assert !values.empty?
assert_equal values.sort.reverse, values
end
@ -347,7 +347,7 @@ describe Query, type: :model do
include: [:assigned_to, :status, :type, :project, :priority],
conditions: q.statement,
order: "#{c.sortable} ASC"
values = issues.collect { |i| begin; Kernel.Float(i.custom_value_for(c.custom_field).to_s); rescue; nil; end }.compact
values = issues.map { |i| begin; Kernel.Float(i.custom_value_for(c.custom_field).to_s); rescue; nil; end }.compact
assert !values.empty?
assert_equal values.sort, values
end
@ -363,8 +363,8 @@ describe Query, type: :model do
q = Query.new(name: '_', group_by: 'assigned_to')
count_by_group = q.results.work_package_count_by_group
assert_kind_of Hash, count_by_group
assert_equal %w(NilClass User), count_by_group.keys.collect { |k| k.class.name }.uniq.sort
assert_equal %w(Fixnum), count_by_group.values.collect { |k| k.class.name }.uniq
assert_equal %w(NilClass User), count_by_group.keys.map { |k| k.class.name }.uniq.sort
assert_equal %w(Fixnum), count_by_group.values.map { |k| k.class.name }.uniq
assert count_by_group.has_key?(User.find(3))
end
@ -372,8 +372,8 @@ describe Query, type: :model do
q = Query.new(name: '_', group_by: 'cf_1')
count_by_group = q.results.work_package_count_by_group
assert_kind_of Hash, count_by_group
assert_equal %w(NilClass String), count_by_group.keys.collect { |k| k.class.name }.uniq.sort
assert_equal %w(Fixnum), count_by_group.values.collect { |k| k.class.name }.uniq
assert_equal %w(NilClass String), count_by_group.keys.map { |k| k.class.name }.uniq.sort
assert_equal %w(Fixnum), count_by_group.values.map { |k| k.class.name }.uniq
assert count_by_group.has_key?('MySQL')
end
@ -381,8 +381,8 @@ describe Query, type: :model do
q = Query.new(name: '_', group_by: 'cf_8')
count_by_group = q.results.work_package_count_by_group
assert_kind_of Hash, count_by_group
assert_equal %w(Date NilClass), count_by_group.keys.collect { |k| k.class.name }.uniq.sort
assert_equal %w(Fixnum), count_by_group.values.collect { |k| k.class.name }.uniq
assert_equal %w(Date NilClass), count_by_group.keys.map { |k| k.class.name }.uniq.sort
assert_equal %w(Fixnum), count_by_group.values.map { |k| k.class.name }.uniq
end
it 'should label for' do

@ -119,7 +119,7 @@ describe Repository::Git, type: :model do
'deff712f05a90d96edbd70facc47d944be5897e3',
'899a15dba03a3b350b89c3f537e4bbe02a03cdc9',
'7234cb2750b63f47bff735edc50a1c0a433c2518',
], changesets.collect(&:revision)
], changesets.map(&:revision)
changesets = @repository.latest_changesets('README', nil)
assert_equal [
@ -129,65 +129,65 @@ describe Repository::Git, type: :model do
'61b685fbe55ab05b5ac68402d5720c1a6ac973d1',
'899a15dba03a3b350b89c3f537e4bbe02a03cdc9',
'7234cb2750b63f47bff735edc50a1c0a433c2518',
], changesets.collect(&:revision)
], changesets.map(&:revision)
# with path, revision and limit
changesets = @repository.latest_changesets('images', '899a15dba')
assert_equal [
'899a15dba03a3b350b89c3f537e4bbe02a03cdc9',
'7234cb2750b63f47bff735edc50a1c0a433c2518',
], changesets.collect(&:revision)
], changesets.map(&:revision)
changesets = @repository.latest_changesets('images', '899a15dba', 1)
assert_equal [
'899a15dba03a3b350b89c3f537e4bbe02a03cdc9',
], changesets.collect(&:revision)
], changesets.map(&:revision)
changesets = @repository.latest_changesets('README', '899a15dba')
assert_equal [
'899a15dba03a3b350b89c3f537e4bbe02a03cdc9',
'7234cb2750b63f47bff735edc50a1c0a433c2518',
], changesets.collect(&:revision)
], changesets.map(&:revision)
changesets = @repository.latest_changesets('README', '899a15dba', 1)
assert_equal [
'899a15dba03a3b350b89c3f537e4bbe02a03cdc9',
], changesets.collect(&:revision)
], changesets.map(&:revision)
# with path, tag and limit
changesets = @repository.latest_changesets('images', 'tag01.annotated')
assert_equal [
'899a15dba03a3b350b89c3f537e4bbe02a03cdc9',
'7234cb2750b63f47bff735edc50a1c0a433c2518',
], changesets.collect(&:revision)
], changesets.map(&:revision)
changesets = @repository.latest_changesets('images', 'tag01.annotated', 1)
assert_equal [
'899a15dba03a3b350b89c3f537e4bbe02a03cdc9',
], changesets.collect(&:revision)
], changesets.map(&:revision)
changesets = @repository.latest_changesets('README', 'tag01.annotated')
assert_equal [
'899a15dba03a3b350b89c3f537e4bbe02a03cdc9',
'7234cb2750b63f47bff735edc50a1c0a433c2518',
], changesets.collect(&:revision)
], changesets.map(&:revision)
changesets = @repository.latest_changesets('README', 'tag01.annotated', 1)
assert_equal [
'899a15dba03a3b350b89c3f537e4bbe02a03cdc9',
], changesets.collect(&:revision)
], changesets.map(&:revision)
# with path, branch and limit
changesets = @repository.latest_changesets('images', 'test_branch')
assert_equal [
'899a15dba03a3b350b89c3f537e4bbe02a03cdc9',
'7234cb2750b63f47bff735edc50a1c0a433c2518',
], changesets.collect(&:revision)
], changesets.map(&:revision)
changesets = @repository.latest_changesets('images', 'test_branch', 1)
assert_equal [
'899a15dba03a3b350b89c3f537e4bbe02a03cdc9',
], changesets.collect(&:revision)
], changesets.map(&:revision)
changesets = @repository.latest_changesets('README', 'test_branch')
assert_equal [
@ -195,13 +195,13 @@ describe Repository::Git, type: :model do
'61b685fbe55ab05b5ac68402d5720c1a6ac973d1',
'899a15dba03a3b350b89c3f537e4bbe02a03cdc9',
'7234cb2750b63f47bff735edc50a1c0a433c2518',
], changesets.collect(&:revision)
], changesets.map(&:revision)
changesets = @repository.latest_changesets('README', 'test_branch', 2)
assert_equal [
'713f4944648826f558cf548222f813dabe7cbb04',
'61b685fbe55ab05b5ac68402d5720c1a6ac973d1',
], changesets.collect(&:revision)
], changesets.map(&:revision)
# latin-1 encoding path
changesets = @repository.latest_changesets(
@ -209,13 +209,13 @@ describe Repository::Git, type: :model do
assert_equal [
'64f1f3e89ad1cb57976ff0ad99a107012ba3481d',
'4fc55c43bf3d3dc2efb66145365ddc17639ce81e',
], changesets.collect(&:revision)
], changesets.map(&:revision)
changesets = @repository.latest_changesets(
"latin-1-dir/test-#{@char_1}-2.txt", '64f1f3e89', 1)
assert_equal [
'64f1f3e89ad1cb57976ff0ad99a107012ba3481d',
], changesets.collect(&:revision)
], changesets.map(&:revision)
end
it 'should latest changesets latin 1 dir' do
@ -228,7 +228,7 @@ describe Repository::Git, type: :model do
"latin-1-dir/test-#{@char_1}-subdir", '1ca7f5ed')
assert_equal [
'1ca7f5ed374f3cb31a93ae5215c2e25cc6ec5127',
], changesets.collect(&:revision)
], changesets.map(&:revision)
end
end

@ -70,11 +70,11 @@ describe Repository::Subversion, type: :model do
# with path
changesets = @repository.latest_changesets('subversion_test/folder', nil)
assert_equal ['10', '9', '7', '6', '5', '2'], changesets.collect(&:revision)
assert_equal ['10', '9', '7', '6', '5', '2'], changesets.map(&:revision)
# with path and revision
changesets = @repository.latest_changesets('subversion_test/folder', 8)
assert_equal ['7', '6', '5', '2'], changesets.collect(&:revision)
assert_equal ['7', '6', '5', '2'], changesets.map(&:revision)
end
it 'should directory listing with square brackets in path' do

@ -50,7 +50,7 @@ describe Type, type: :model do
assert_kind_of Array, type.statuses.all
assert_kind_of Status, type.statuses.first
assert_equal [2, 3, 5], Type.find(1).statuses.collect(&:id)
assert_equal [2, 3, 5], Type.find(1).statuses.map(&:id)
end
it 'should statuses empty' do

@ -333,8 +333,8 @@ describe User, type: :model do
user = User.find(2)
assert_kind_of Hash, user.projects_by_role
assert_equal 2, user.projects_by_role.size
assert_equal [1, 5], user.projects_by_role[Role.find(1)].collect(&:id).sort
assert_equal [2], user.projects_by_role[Role.find(2)].collect(&:id).sort
assert_equal [1, 5], user.projects_by_role[Role.find(1)].map(&:id).sort
assert_equal [2], user.projects_by_role[Role.find(2)].map(&:id).sort
end
it 'should projects by role for user with no role' do

@ -112,7 +112,7 @@ describe WikiPage, type: :model do
it 'should destroy' do
page = WikiPage.find(1)
content_ids = WikiContent.find_all_by_page_id(1).collect(&:id)
content_ids = WikiContent.find_all_by_page_id(1).map(&:id)
page.destroy
assert_nil WikiPage.find_by_id(1)
# make sure that page content and its history are deleted

Loading…
Cancel
Save