Merge pull request #10134 from opf/fix/fix-alignment-in-spec2

Fix argument alignment since f08bea3467 for modules specs
pull/10135/head
Christophe Bliard 3 years ago committed by GitHub
commit b720887104
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      modules/backlogs/spec/api/work_package_resource_spec.rb
  2. 4
      modules/backlogs/spec/api/work_packages/schema/specific_work_package_schema_spec.rb
  3. 92
      modules/backlogs/spec/contracts/work_packages/base_contract_spec.rb
  4. 6
      modules/backlogs/spec/contracts/work_packages/update_contract_spec.rb
  5. 12
      modules/backlogs/spec/controllers/versions_controller_spec.rb
  6. 38
      modules/backlogs/spec/features/backlogs/create_story_spec.rb
  7. 64
      modules/backlogs/spec/features/backlogs_in_backlog_view_spec.rb
  8. 66
      modules/backlogs/spec/features/impediments_spec.rb
  9. 30
      modules/backlogs/spec/features/onboarding/backlogs_onboarding_tour_spec.rb
  10. 8
      modules/backlogs/spec/features/resolved_status_spec.rb
  11. 104
      modules/backlogs/spec/features/stories_in_backlog_spec.rb
  12. 114
      modules/backlogs/spec/features/tasks_on_taskboard_spec.rb
  13. 14
      modules/backlogs/spec/features/work_packages/filter_spec.rb
  14. 12
      modules/backlogs/spec/features/work_packages/story_points_spec.rb
  15. 8
      modules/backlogs/spec/models/burndown_spec.rb
  16. 18
      modules/backlogs/spec/models/issue_position_spec.rb
  17. 6
      modules/backlogs/spec/models/task_spec.rb
  18. 6
      modules/backlogs/spec/models/version_spec.rb
  19. 10
      modules/backlogs/spec/services/impediments/create_services_spec.rb
  20. 12
      modules/backlogs/spec/services/impediments/update_service_spec.rb
  21. 16
      modules/backlogs/spec/services/stories/create_service_spec.rb
  22. 14
      modules/backlogs/spec/services/work_packages/update_ancestors_service_spec.rb
  23. 176
      modules/backlogs/spec/services/work_packages/update_service_version_inheritance_spec.rb
  24. 2
      modules/backlogs/spec/views/rb_burndown_charts/show_spec.rb
  25. 2
      modules/backlogs/spec/views/rb_master_backlogs/index.html.erb_spec.rb
  26. 2
      modules/backlogs/spec/views/rb_taskboards/show_spec.rb
  27. 18
      modules/bim/spec/bcf/bcf_xml/importer_spec.rb
  28. 14
      modules/bim/spec/bcf/bcf_xml/issue_reader_spec.rb
  29. 16
      modules/bim/spec/bcf/bcf_xml/issue_writer_spec.rb
  30. 2
      modules/bim/spec/contracts/bcf/issues/update_contract_spec.rb
  31. 6
      modules/bim/spec/contracts/ifc_models/update_contract_spec.rb
  32. 22
      modules/bim/spec/controllers/issues_controller_spec.rb
  33. 4
      modules/bim/spec/features/bcf/bcf_snapshot_column_spec.rb
  34. 14
      modules/bim/spec/features/bcf/create_spec.rb
  35. 8
      modules/bim/spec/features/bcf/export_spec.rb
  36. 26
      modules/bim/spec/features/bcf_view_management_spec.rb
  37. 4
      modules/bim/spec/features/bim_filter_spec.rb
  38. 8
      modules/bim/spec/features/bim_navigation_spec.rb
  39. 22
      modules/bim/spec/features/model_management_spec.rb
  40. 16
      modules/bim/spec/features/model_viewer_spec.rb
  41. 6
      modules/bim/spec/features/revit_add_in/bim_revit_add_in_navigation_spec.rb
  42. 6
      modules/bim/spec/features/revit_add_in/bim_revit_add_in_refresh_button_spec.rb
  43. 12
      modules/bim/spec/features/show_default_spec.rb
  44. 6
      modules/bim/spec/features/viewer/create_viewpoint_spec.rb
  45. 6
      modules/bim/spec/features/viewer/delete_viewpoint_spec.rb
  46. 14
      modules/bim/spec/features/viewer/show_viewpoint_spec.rb
  47. 4
      modules/bim/spec/lib/api/v3/work_packages/eager_loading/cache_checksum_integration_spec.rb
  48. 4
      modules/bim/spec/models/ifc_model_spec.rb
  49. 10
      modules/bim/spec/representers/bcf/api/v2_1/topics/single_representer_rendering_spec.rb
  50. 16
      modules/bim/spec/requests/api/bcf/v2_1/comments_api_spec.rb
  51. 12
      modules/bim/spec/requests/api/bcf/v2_1/project_extensions_api_spec.rb
  52. 12
      modules/bim/spec/requests/api/bcf/v2_1/projects_api_spec.rb
  53. 76
      modules/bim/spec/requests/api/bcf/v2_1/topics_api_spec.rb
  54. 10
      modules/bim/spec/requests/api/bcf/v2_1/viewpoints_api_spec.rb
  55. 16
      modules/bim/spec/views/bim/ifc_models/ifc_models/index.html.erb_spec.rb
  56. 42
      modules/boards/spec/factories/board_factory.rb
  57. 28
      modules/boards/spec/features/action_boards/assignee_board_spec.rb
  58. 12
      modules/boards/spec/features/action_boards/custom_field_filters_spec.rb
  59. 28
      modules/boards/spec/features/action_boards/status_board_spec.rb
  60. 52
      modules/boards/spec/features/action_boards/status_type_moving_board_spec.rb
  61. 32
      modules/boards/spec/features/action_boards/subproject_board_spec.rb
  62. 6
      modules/boards/spec/features/action_boards/subtasks_board_spec.rb
  63. 12
      modules/boards/spec/features/action_boards/version_board_spec.rb
  64. 4
      modules/boards/spec/features/board_conflicts_spec.rb
  65. 20
      modules/boards/spec/features/board_highlighting_spec.rb
  66. 4
      modules/boards/spec/features/board_management_spec.rb
  67. 4
      modules/boards/spec/features/board_navigation_spec.rb
  68. 8
      modules/boards/spec/features/board_reference_work_package_spec.rb
  69. 20
      modules/boards/spec/features/onboarding/boards_onboarding_tour_spec.rb
  70. 4
      modules/boards/spec/lib/open_project/boards/grid_registration_spec.rb
  71. 14
      modules/boards/spec/services/copy_service_integration_spec.rb
  72. 6
      modules/budgets/spec/features/budgets/attachment_upload_spec.rb
  73. 32
      modules/budgets/spec/features/budgets/copy_budget_spec.rb
  74. 16
      modules/budgets/spec/features/budgets/delete_budget_spec.rb
  75. 36
      modules/budgets/spec/features/budgets/update_budget_spec.rb
  76. 12
      modules/budgets/spec/features/work_package_filter_spec.rb
  77. 14
      modules/budgets/spec/lib/api/v3/budgets/budget_representer_spec.rb
  78. 6
      modules/budgets/spec/models/labor_budget_item_spec.rb
  79. 4
      modules/budgets/spec/requests/api/v3/budgets/budget_resource_spec.rb
  80. 16
      modules/calendar/spec/features/calendar_user_interaction_spec.rb
  81. 36
      modules/calendar/spec/features/calendars_spec.rb
  82. 48
      modules/calendar/spec/features/query_handling_spec.rb
  83. 10
      modules/calendar/spec/features/shared_context.rb
  84. 16
      modules/costs/spec/contracts/time_entries/delete_contract_spec.rb
  85. 2
      modules/costs/spec/contracts/time_entries/shared_contract_examples.rb
  86. 14
      modules/costs/spec/contracts/time_entries/update_contract_spec.rb
  87. 8
      modules/costs/spec/features/cost_entries/add_cost_entry_spec.rb
  88. 4
      modules/costs/spec/features/cost_entries/add_entry_without_rate_permission_spec.rb
  89. 26
      modules/costs/spec/features/destroy_work_package_with_cost_entries_spec.rb
  90. 2
      modules/costs/spec/features/members_hourly_rates_spec.rb
  91. 16
      modules/costs/spec/features/time_entries_spec.rb
  92. 8
      modules/costs/spec/features/view_own_rates_spec.rb
  93. 20
      modules/costs/spec/lib/api/v3/cost_entries/work_package_costs_by_type_representer_spec.rb
  94. 14
      modules/costs/spec/lib/api/v3/time_entries/time_entry_representer_parsing_spec.rb
  95. 16
      modules/costs/spec/lib/api/v3/time_entries/time_entry_representer_rendering_spec.rb
  96. 6
      modules/costs/spec/models/project/activity_spec.rb
  97. 12
      modules/costs/spec/models/projects/scopes/visible_with_activated_time_activity_spec.rb
  98. 16
      modules/costs/spec/models/time_entries/scopes/of_user_and_day_spec.rb
  99. 28
      modules/costs/spec/models/time_entries/scopes/visible_spec.rb
  100. 34
      modules/costs/spec/models/time_entry_spec.rb
  101. Some files were not shown because too many files have changed in this diff Show More

@ -37,9 +37,9 @@ describe 'API v3 Work package resource' do
let(:project) { create(:project) }
let(:work_package) do
create(:work_package,
project: project,
story_points: 8,
remaining_hours: 5)
project: project,
story_points: 8,
remaining_hours: 5)
end
let(:wp_path) { "/api/v3/work_packages/#{work_package.id}" }

@ -33,8 +33,8 @@ describe ::API::V3::WorkPackages::Schema::SpecificWorkPackageSchema do
let(:type) { build(:type) }
let(:work_package) do
build(:work_package,
project: project,
type: type)
project: project,
type: type)
end
let(:current_user) do
build_stubbed(:user).tap do |u|

@ -42,8 +42,8 @@ describe WorkPackages::BaseContract, type: :model do
let(:project) do
p = build(:project, members: [build(:member,
principal: user,
roles: [role])],
principal: user,
roles: [role])],
types: [type_feature, type_task, type_bug])
allow(p)
@ -58,8 +58,8 @@ describe WorkPackages::BaseContract, type: :model do
let(:other_project) do
p = build(:project, members: [build(:member,
principal: user,
roles: [role])],
principal: user,
roles: [role])],
types: [type_feature, type_task, type_bug])
allow(p)
@ -73,68 +73,68 @@ describe WorkPackages::BaseContract, type: :model do
let(:story) do
build_stubbed(:stubbed_work_package,
subject: 'Story',
project: project,
type: type_feature,
version: version1,
status: status,
author: user,
priority: issue_priority)
subject: 'Story',
project: project,
type: type_feature,
version: version1,
status: status,
author: user,
priority: issue_priority)
end
let(:story2) do
build_stubbed(:stubbed_work_package,
subject: 'Story2',
project: project,
type: type_feature,
version: version1,
status: status,
author: user,
priority: issue_priority)
subject: 'Story2',
project: project,
type: type_feature,
version: version1,
status: status,
author: user,
priority: issue_priority)
end
let(:task) do
build_stubbed(:stubbed_work_package,
subject: 'Task',
type: type_task,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
subject: 'Task',
type: type_task,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
end
let(:task2) do
build_stubbed(:stubbed_work_package,
subject: 'Task2',
type: type_task,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
subject: 'Task2',
type: type_task,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
end
let(:bug) do
build_stubbed(:stubbed_work_package,
subject: 'Bug',
type: type_bug,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
subject: 'Bug',
type: type_bug,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
end
let(:bug2) do
build_stubbed(:stubbed_work_package,
subject: 'Bug2',
type: type_bug,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
subject: 'Bug2',
type: type_bug,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
end
subject(:valid) { instance.validate }

@ -31,9 +31,9 @@ require 'spec_helper'
describe WorkPackages::UpdateContract do
let(:work_package) do
create(:work_package,
done_ratio: 50,
estimated_hours: 6.0,
project: project)
done_ratio: 50,
estimated_hours: 6.0,
project: project)
end
let(:member) { create(:user, member_in_project: project, member_through_role: role) }
let(:project) { create(:project) }

@ -31,22 +31,22 @@ require 'spec_helper'
describe VersionsController, type: :controller do
let(:version) do
create(:version,
sharing: 'system')
sharing: 'system')
end
let(:other_project) do
create(:project).tap do |p|
create(:member,
user: current_user,
roles: [create(:role, permissions: [:manage_versions])],
project: p)
user: current_user,
roles: [create(:role, permissions: [:manage_versions])],
project: p)
end
end
let(:current_user) do
create(:user,
member_in_project: version.project,
member_with_permissions: [:manage_versions])
member_in_project: version.project,
member_with_permissions: [:manage_versions])
end
before do

@ -52,11 +52,11 @@ describe 'Backlogs', js: true do
let(:user) do
create :user,
member_in_project: project,
member_with_permissions: %i(add_work_packages
view_master_backlog
view_work_packages
assign_versions)
member_in_project: project,
member_with_permissions: %i(add_work_packages
view_master_backlog
view_work_packages
assign_versions)
end
let(:project) { create :project }
@ -64,23 +64,23 @@ describe 'Backlogs', js: true do
let!(:existing_story1) do
create(:work_package,
type: story_type,
project: project,
status: default_status,
priority: default_priority,
position: 1,
story_points: 3,
version: backlog_version)
type: story_type,
project: project,
status: default_status,
priority: default_priority,
position: 1,
story_points: 3,
version: backlog_version)
end
let!(:existing_story2) do
create(:work_package,
type: story_type,
project: project,
status: default_status,
priority: default_priority,
position: 2,
story_points: 4,
version: backlog_version)
type: story_type,
project: project,
status: default_status,
priority: default_priority,
position: 2,
story_points: 4,
version: backlog_version)
end
let!(:default_status) do
create(:default_status)

@ -34,8 +34,8 @@ describe 'Backlogs in backlog view',
js: true do
let!(:project) do
create(:project,
types: [story, task],
enabled_module_names: %w(work_package_tracking backlogs))
types: [story, task],
enabled_module_names: %w(work_package_tracking backlogs))
end
let!(:story) { create(:type_feature) }
let!(:other_story) { create(:type) }
@ -45,57 +45,57 @@ describe 'Backlogs in backlog view',
let!(:other_status) { create(:status) }
let!(:workflows) do
create(:workflow,
old_status: default_status,
new_status: other_status,
role: role,
type_id: story.id)
old_status: default_status,
new_status: other_status,
role: role,
type_id: story.id)
end
let(:role) do
create(:role,
permissions: %i(view_master_backlog
add_work_packages
view_work_packages
edit_work_packages
manage_subtasks
manage_versions
update_sprints
assign_versions))
permissions: %i(view_master_backlog
add_work_packages
view_work_packages
edit_work_packages
manage_subtasks
manage_versions
update_sprints
assign_versions))
end
let!(:current_user) do
create(:user,
member_in_project: project,
member_through_role: role)
member_in_project: project,
member_through_role: role)
end
let!(:sprint) do
create(:version,
project: project,
start_date: Date.today - 10.days,
effective_date: Date.today + 10.days,
version_settings_attributes: [{ project: project, display: VersionSetting::DISPLAY_LEFT }])
project: project,
start_date: Date.today - 10.days,
effective_date: Date.today + 10.days,
version_settings_attributes: [{ project: project, display: VersionSetting::DISPLAY_LEFT }])
end
let!(:backlog) do
create(:version,
project: project,
version_settings_attributes: [{ project: project, display: VersionSetting::DISPLAY_RIGHT }])
project: project,
version_settings_attributes: [{ project: project, display: VersionSetting::DISPLAY_RIGHT }])
end
let!(:other_project) do
create(:project)
end
let!(:other_project_sprint) do
create(:version,
project: other_project,
sharing: 'system',
start_date: Date.today - 10.days,
effective_date: Date.today + 10.days)
project: other_project,
sharing: 'system',
start_date: Date.today - 10.days,
effective_date: Date.today + 10.days)
end
let!(:sprint_story1) do
create(:work_package,
project: project,
type: story,
status: default_status,
version: sprint,
position: 1,
story_points: 10)
project: project,
type: story,
status: default_status,
version: sprint,
position: 1,
story_points: 10)
end
let(:backlogs_page) { Pages::Backlogs.new(project) }

@ -33,8 +33,8 @@ describe 'Impediments on taskboard',
js: true do
let!(:project) do
create(:project,
types: [story, task],
enabled_module_names: %w(work_package_tracking backlogs))
types: [story, task],
enabled_module_names: %w(work_package_tracking backlogs))
end
let!(:story) { create(:type_feature) }
let!(:task) { create(:type_task) }
@ -43,56 +43,56 @@ describe 'Impediments on taskboard',
let!(:other_status) { create(:status) }
let!(:workflows) do
create(:workflow,
old_status: status,
new_status: other_status,
role: role,
type_id: story.id)
old_status: status,
new_status: other_status,
role: role,
type_id: story.id)
create(:workflow,
old_status: status,
new_status: other_status,
role: role,
type_id: task.id)
old_status: status,
new_status: other_status,
role: role,
type_id: task.id)
end
let(:role) do
create(:role,
permissions: %i(view_taskboards
add_work_packages
view_work_packages
edit_work_packages
manage_subtasks
assign_versions))
permissions: %i(view_taskboards
add_work_packages
view_work_packages
edit_work_packages
manage_subtasks
assign_versions))
end
let!(:current_user) do
create(:user,
member_in_project: project,
member_through_role: role)
member_in_project: project,
member_through_role: role)
end
let!(:task1) do
create(:work_package,
status: status,
project: project,
type: task,
version: sprint,
parent: story1)
status: status,
project: project,
type: task,
version: sprint,
parent: story1)
end
let!(:story1) do
create(:work_package,
project: project,
type: story,
version: sprint)
project: project,
type: story,
version: sprint)
end
let!(:other_task) do
create(:work_package,
project: project,
type: task,
version: sprint,
parent: other_story)
project: project,
type: task,
version: sprint,
parent: other_story)
end
let!(:other_story) do
create(:work_package,
project: project,
type: story,
version: other_sprint)
project: project,
type: story,
version: other_sprint)
end
let!(:sprint) do
create(:version, project: project)

@ -33,17 +33,17 @@ describe 'backlogs onboarding tour', js: true do
let(:user) { create :admin }
let(:demo_project) do
create :project,
name: 'Demo project',
identifier: 'demo-project',
public: true,
enabled_module_names: %w[work_package_tracking wiki]
name: 'Demo project',
identifier: 'demo-project',
public: true,
enabled_module_names: %w[work_package_tracking wiki]
end
let(:project) do
create :project,
name: 'Scrum project',
identifier: 'your-scrum-project',
public: true,
enabled_module_names: %w[work_package_tracking wiki backlogs]
name: 'Scrum project',
identifier: 'your-scrum-project',
public: true,
enabled_module_names: %w[work_package_tracking wiki backlogs]
end
let(:sprint) { create(:version, project: project, name: 'Sprint 1') }
let(:status) { create(:default_status) }
@ -68,13 +68,13 @@ describe 'backlogs onboarding tour', js: true do
let!(:existing_story) do
create(:work_package,
type: story_type,
project: project,
status: status,
priority: priority,
position: 1,
story_points: 3,
version: sprint)
type: story_type,
project: project,
status: status,
priority: priority,
position: 1,
story_points: 3,
version: sprint)
end
before do

@ -32,17 +32,17 @@ describe 'Resolved status',
type: :feature do
let!(:project) do
create(:project,
enabled_module_names: %w(backlogs))
enabled_module_names: %w(backlogs))
end
let!(:status) { create(:status, is_default: true) }
let(:role) do
create(:role,
permissions: %i[select_done_statuses])
permissions: %i[select_done_statuses])
end
let!(:current_user) do
create(:user,
member_in_project: project,
member_through_role: role)
member_in_project: project,
member_through_role: role)
end
let(:settings_page) { Pages::Projects::Settings.new(project) }

@ -34,8 +34,8 @@ describe 'Stories in backlog',
js: true do
let!(:project) do
create(:project,
types: [story, task, other_story],
enabled_module_names: %w(work_package_tracking backlogs))
types: [story, task, other_story],
enabled_module_names: %w(work_package_tracking backlogs))
end
let!(:story) { create(:type_feature) }
let!(:other_story) { create(:type) }
@ -45,91 +45,91 @@ describe 'Stories in backlog',
let!(:other_status) { create(:status) }
let!(:workflows) do
create(:workflow,
old_status: default_status,
new_status: other_status,
role: role,
type_id: story.id)
old_status: default_status,
new_status: other_status,
role: role,
type_id: story.id)
end
let(:role) do
create(:role,
permissions: %i(view_master_backlog
add_work_packages
view_work_packages
edit_work_packages
manage_subtasks
assign_versions))
permissions: %i(view_master_backlog
add_work_packages
view_work_packages
edit_work_packages
manage_subtasks
assign_versions))
end
let!(:current_user) do
create(:user,
member_in_project: project,
member_through_role: role)
member_in_project: project,
member_through_role: role)
end
let!(:sprint_story1) do
create(:work_package,
project: project,
type: story,
status: default_status,
version: sprint,
position: 1,
story_points: 10)
project: project,
type: story,
status: default_status,
version: sprint,
position: 1,
story_points: 10)
end
let!(:sprint_story1_task) do
create(:work_package,
project: project,
type: task,
status: default_status,
version: sprint)
project: project,
type: task,
status: default_status,
version: sprint)
end
let!(:sprint_story2_parent) do
create(:work_package,
project: project,
type: create(:type),
status: default_status,
version: sprint)
project: project,
type: create(:type),
status: default_status,
version: sprint)
end
let!(:sprint_story2) do
create(:work_package,
project: project,
type: story,
status: default_status,
version: sprint,
position: 2,
story_points: 20)
project: project,
type: story,
status: default_status,
version: sprint,
position: 2,
story_points: 20)
end
let!(:backlog_story1) do
create(:work_package,
project: project,
type: story,
status: default_status,
version: backlog)
project: project,
type: story,
status: default_status,
version: backlog)
end
let!(:sprint) do
create(:version,
project: project,
start_date: Date.today - 10.days,
effective_date: Date.today + 10.days,
version_settings_attributes: [{ project: project, display: VersionSetting::DISPLAY_LEFT }])
project: project,
start_date: Date.today - 10.days,
effective_date: Date.today + 10.days,
version_settings_attributes: [{ project: project, display: VersionSetting::DISPLAY_LEFT }])
end
let!(:backlog) do
create(:version,
project: project,
version_settings_attributes: [{ project: project, display: VersionSetting::DISPLAY_RIGHT }])
project: project,
version_settings_attributes: [{ project: project, display: VersionSetting::DISPLAY_RIGHT }])
end
let!(:other_project) do
create(:project).tap do |p|
create(:member,
principal: current_user,
project: p,
roles: [role])
principal: current_user,
project: p,
roles: [role])
end
end
let!(:sprint_story_in_other_project) do
create(:work_package,
project: other_project,
type: story,
status: default_status,
version: sprint,
story_points: 10)
project: other_project,
type: story,
status: default_status,
version: sprint,
story_points: 10)
end
let!(:export_card_configurations) do
ExportCardConfiguration.create!(name: 'Default',

@ -34,8 +34,8 @@ describe 'Tasks on taskboard',
js: true do
let!(:project) do
create(:project,
types: [story, task, other_story],
enabled_module_names: %w(work_package_tracking backlogs))
types: [story, task, other_story],
enabled_module_names: %w(work_package_tracking backlogs))
end
let!(:story) { create(:type_feature) }
let!(:other_story) { create(:type) }
@ -45,96 +45,96 @@ describe 'Tasks on taskboard',
let!(:other_status) { create(:status) }
let!(:workflows) do
create(:workflow,
old_status: default_status,
new_status: other_status,
role: role,
type_id: task.id)
old_status: default_status,
new_status: other_status,
role: role,
type_id: task.id)
end
let(:role) do
create(:role,
permissions: %i(view_taskboards
add_work_packages
view_work_packages
edit_work_packages
manage_subtasks
assign_versions))
permissions: %i(view_taskboards
add_work_packages
view_work_packages
edit_work_packages
manage_subtasks
assign_versions))
end
let!(:current_user) do
create(:user,
member_in_project: project,
member_through_role: role)
member_in_project: project,
member_through_role: role)
end
let!(:story1) do
create(:work_package,
project: project,
type: story,
status: default_status,
version: sprint,
position: 1,
story_points: 10)
project: project,
type: story,
status: default_status,
version: sprint,
position: 1,
story_points: 10)
end
let!(:story1_task) do
create(:work_package,
project: project,
parent: story1,
type: task,
status: default_status,
version: sprint)
project: project,
parent: story1,
type: task,
status: default_status,
version: sprint)
end
let!(:story1_task_subtask) do
create(:work_package,
project: project,
parent: story1_task,
type: task,
status: default_status,
version: sprint)
project: project,
parent: story1_task,
type: task,
status: default_status,
version: sprint)
end
let!(:other_work_package) do
create(:work_package,
project: project,
type: create(:type),
status: default_status,
version: sprint)
project: project,
type: create(:type),
status: default_status,
version: sprint)
end
let!(:other_work_package_subtask) do
create(:work_package,
project: project,
parent: other_work_package,
type: task,
status: default_status,
version: sprint)
project: project,
parent: other_work_package,
type: task,
status: default_status,
version: sprint)
end
let!(:story2) do
create(:work_package,
project: project,
type: story,
status: default_status,
version: sprint,
position: 2,
story_points: 20)
project: project,
type: story,
status: default_status,
version: sprint,
position: 2,
story_points: 20)
end
let!(:sprint) do
create(:version,
project: project,
start_date: Date.today - 10.days,
effective_date: Date.today + 10.days,
version_settings_attributes: [{ project: project, display: VersionSetting::DISPLAY_LEFT }])
project: project,
start_date: Date.today - 10.days,
effective_date: Date.today + 10.days,
version_settings_attributes: [{ project: project, display: VersionSetting::DISPLAY_LEFT }])
end
let!(:other_project) do
create(:project).tap do |p|
create(:member,
principal: current_user,
project: p,
roles: [role])
principal: current_user,
project: p,
roles: [role])
end
end
let!(:story_in_other_project) do
create(:work_package,
project: other_project,
type: story,
status: default_status,
version: sprint,
story_points: 10)
project: other_project,
type: story,
status: default_status,
version: sprint,
story_points: 10)
end
let!(:export_card_configurations) do
ExportCardConfiguration.create!(name: 'Default',

@ -51,20 +51,20 @@ describe 'Filter by backlog type', js: true do
let(:member) do
create(:member,
user: user,
project: project,
roles: [create(:role)])
user: user,
project: project,
roles: [create(:role)])
end
let(:work_package_with_story_type) do
create(:work_package,
type: story_type,
project: project)
type: story_type,
project: project)
end
let(:work_package_with_task_type) do
create(:work_package,
type: task_type,
project: project)
type: task_type,
project: project)
end
before do

@ -41,7 +41,7 @@ describe 'Work packages having story points', type: :feature, js: true do
let(:current_user) { create(:admin) }
let(:project) do
create(:project,
enabled_module_names: %w(work_package_tracking backlogs))
enabled_module_names: %w(work_package_tracking backlogs))
end
let(:status) { create :default_status }
let(:story_type) { create(:type_feature) }
@ -51,11 +51,11 @@ describe 'Work packages having story points', type: :feature, js: true do
let(:story_points) { 42 }
let(:story_with_sp) do
create(:story,
type: story_type,
author: current_user,
project: project,
status: status,
story_points: story_points)
type: story_type,
author: current_user,
project: project,
status: status,
story_points: story_points)
end
it 'should be displayed' do

@ -74,10 +74,10 @@ describe Burndown, type: :model do
[issue_open, issue_closed, issue_resolved].permutation(2).each do |transition|
create(:workflow,
old_status: transition[0],
new_status: transition[1],
role: role,
type_id: type_feature.id)
old_status: transition[0],
new_status: transition[1],
role: role,
type_id: type_feature.id)
end
end

@ -32,10 +32,10 @@ describe WorkPackage, type: :model do
describe 'Story positions' do
def build_work_package(options)
build(:work_package, options.reverse_merge(version_id: sprint_1.id,
priority_id: priority.id,
project_id: project.id,
status_id: status.id,
type_id: story_type.id))
priority_id: priority.id,
project_id: project.id,
status_id: status.id,
type_id: story_type.id))
end
def create_work_package(options)
@ -254,15 +254,15 @@ describe WorkPackage, type: :model do
let(:shared_sprint) do
create(:version,
project_id: project.id,
name: 'Shared Sprint',
sharing: 'descendants')
project_id: project.id,
name: 'Shared Sprint',
sharing: 'descendants')
end
let(:version_go_live) do
create(:version,
project_id: project_wo_backlogs.id,
name: 'Go-Live')
project_id: project_wo_backlogs.id,
name: 'Go-Live')
end
shared_let(:admin) { create :admin }

@ -34,9 +34,9 @@ describe Task, type: :model do
let(:project) { create(:project) }
let(:task) do
build(:task,
project: project,
status: default_status,
type: task_type)
project: project,
status: default_status,
type: task_type)
end
before(:each) do

@ -34,9 +34,9 @@ describe Version, type: :model do
describe 'rebuild positions' do
def build_work_package(options = {})
build(:work_package, options.reverse_merge(version_id: version.id,
priority_id: priority.id,
project_id: project.id,
status_id: status.id))
priority_id: priority.id,
project_id: project.id,
status_id: status.id))
end
def create_work_package(options = {})

@ -38,11 +38,11 @@ describe Impediments::CreateService do
let(:priority) { create(:priority, is_default: true) }
let(:feature) do
build(:work_package,
type: type_feature,
project: project,
author: user,
priority: priority,
status: status1)
type: type_feature,
project: project,
author: user,
priority: priority,
status: status1)
end
let(:version) { create(:version, project: project) }

@ -135,12 +135,12 @@ describe Impediments::UpdateService, type: :model do
describe 'WHEN changing the blocking relationship to another story' do
let(:story) do
build(:work_package,
subject: 'another story',
type: type_feature,
project: project,
author: user,
priority: priority,
status: status1)
subject: 'another story',
type: type_feature,
project: project,
author: user,
priority: priority,
status: status1)
end
let(:blocks) { story.id.to_s }
let(:story_version) { version }

@ -34,9 +34,9 @@ describe Stories::CreateService, type: :model do
project = create(:project, types: [type_feature])
create(:member,
principal: user,
project: project,
roles: [role])
principal: user,
project: project,
roles: [role])
project
end
let(:role) { create(:role, permissions: permissions) }
@ -71,11 +71,11 @@ describe Stories::CreateService, type: :model do
project.enabled_module_names += ['backlogs']
create(:story,
version: version,
project: project,
status: status,
type: type_feature,
priority: priority)
version: version,
project: project,
status: status,
type: type_feature,
priority: priority)
end
before do

@ -39,19 +39,19 @@ describe WorkPackages::UpdateAncestorsService do
end
let!(:parent) do
create :work_package,
parent: grandparent
parent: grandparent
end
let!(:sibling) do
create :work_package,
parent: parent,
remaining_hours: sibling_remaining_hours
parent: parent,
remaining_hours: sibling_remaining_hours
end
context 'for a new ancestors' do
let!(:work_package) do
create :work_package,
remaining_hours: work_package_remaining_hours,
parent: parent
remaining_hours: work_package_remaining_hours,
parent: parent
end
subject do
@ -83,8 +83,8 @@ describe WorkPackages::UpdateAncestorsService do
context 'for the previous ancestors' do
let!(:work_package) do
create :work_package,
remaining_hours: work_package_remaining_hours,
parent: parent
remaining_hours: work_package_remaining_hours,
parent: parent
end
subject do

@ -41,10 +41,10 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
let(:project) do
p = build(:project,
members: [build(:member,
principal: user,
roles: [role])],
types: [type_feature, type_task, type_bug])
members: [build(:member,
principal: user,
roles: [role])],
types: [type_feature, type_task, type_bug])
p.versions << build(:version, name: 'Version1', project: p)
p.versions << build(:version, name: 'Version2', project: p)
@ -54,137 +54,137 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
let(:story) do
story = build(:work_package,
subject: 'Story',
project: project,
type: type_feature,
version: version1,
status: status,
author: user,
priority: issue_priority)
subject: 'Story',
project: project,
type: type_feature,
version: version1,
status: status,
author: user,
priority: issue_priority)
story
end
let(:story2) do
story = build(:work_package,
subject: 'Story2',
project: project,
type: type_feature,
version: version1,
status: status,
author: user,
priority: issue_priority)
subject: 'Story2',
project: project,
type: type_feature,
version: version1,
status: status,
author: user,
priority: issue_priority)
story
end
let(:story3) do
story = build(:work_package,
subject: 'Story3',
project: project,
type: type_feature,
version: version1,
status: status,
author: user,
priority: issue_priority)
subject: 'Story3',
project: project,
type: type_feature,
version: version1,
status: status,
author: user,
priority: issue_priority)
story
end
let(:task) do
build(:work_package,
subject: 'Task',
type: type_task,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
subject: 'Task',
type: type_task,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
end
let(:task2) do
build(:work_package,
subject: 'Task2',
type: type_task,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
subject: 'Task2',
type: type_task,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
end
let(:task3) do
build(:work_package,
subject: 'Task3',
type: type_task,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
subject: 'Task3',
type: type_task,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
end
let(:task4) do
build(:work_package,
subject: 'Task4',
type: type_task,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
subject: 'Task4',
type: type_task,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
end
let(:task5) do
build(:work_package,
subject: 'Task5',
type: type_task,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
subject: 'Task5',
type: type_task,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
end
let(:task6) do
build(:work_package,
subject: 'Task6',
type: type_task,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
subject: 'Task6',
type: type_task,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
end
let(:bug) do
build(:work_package,
subject: 'Bug',
type: type_bug,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
subject: 'Bug',
type: type_bug,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
end
let(:bug2) do
build(:work_package,
subject: 'Bug2',
type: type_bug,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
subject: 'Bug2',
type: type_bug,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
end
let(:bug3) do
build(:work_package,
subject: 'Bug3',
type: type_bug,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
subject: 'Bug3',
type: type_bug,
version: version1,
project: project,
status: status,
author: user,
priority: issue_priority)
end
before(:each) do

@ -33,7 +33,7 @@ describe 'rb_burndown_charts/show', type: :view do
let(:user2) { create(:user) }
let(:role_allowed) do
create(:role,
permissions: %i[add_work_packages manage_subtasks])
permissions: %i[add_work_packages manage_subtasks])
end
let(:role_forbidden) { create(:role) }
# We need to create these as some view helpers access the database

@ -32,7 +32,7 @@ describe 'rb_master_backlogs/index', type: :view do
let(:user) { create(:user) }
let(:role_allowed) do
create(:role,
permissions: %i[view_master_backlog view_taskboards])
permissions: %i[view_master_backlog view_taskboards])
end
let(:statuses) do
[create(:status, is_default: true),

@ -33,7 +33,7 @@ describe 'rb_taskboards/show', type: :view do
let(:user2) { create(:user) }
let(:role_allowed) do
create(:role,
permissions: %i[add_work_packages edit_work_packages manage_subtasks])
permissions: %i[add_work_packages edit_work_packages manage_subtasks])
end
let(:role_forbidden) { create(:role) }
# We need to create these as some view helpers access the database

@ -39,13 +39,13 @@ describe ::OpenProject::Bim::BcfXml::Importer do
let(:type) { create :type, name: 'Issue', is_standard: true, is_default: true }
let(:project) do
create(:project,
identifier: 'bim_project',
enabled_module_names: %w[bim work_package_tracking],
types: [type])
identifier: 'bim_project',
enabled_module_names: %w[bim work_package_tracking],
types: [type])
end
let(:member_role) do
create(:role,
permissions: %i[view_linked_issues view_work_packages])
permissions: %i[view_linked_issues view_work_packages])
end
let(:manage_bcf_role) do
create(
@ -56,15 +56,15 @@ describe ::OpenProject::Bim::BcfXml::Importer do
let(:bcf_manager) { create(:user) }
let(:workflow) do
create(:workflow_with_default_status,
role: manage_bcf_role,
type: type)
role: manage_bcf_role,
type: type)
end
let(:priority) { create :default_priority }
let(:bcf_manager_member) do
create(:member,
project: project,
user: bcf_manager,
roles: [manage_bcf_role, member_role])
project: project,
user: bcf_manager,
roles: [manage_bcf_role, member_role])
end
subject { described_class.new file, project, current_user: bcf_manager }

@ -33,8 +33,8 @@ describe ::OpenProject::Bim::BcfXml::IssueReader do
let(:type) { create :type, name: 'Issue', is_standard: true, is_default: true }
let(:project) do
create(:project,
identifier: 'bim_project',
types: [type])
identifier: 'bim_project',
types: [type])
end
let(:manage_bcf_role) do
create(
@ -45,15 +45,15 @@ describe ::OpenProject::Bim::BcfXml::IssueReader do
let(:bcf_manager) { create(:user) }
let(:workflow) do
create(:workflow_with_default_status,
role: manage_bcf_role,
type: type)
role: manage_bcf_role,
type: type)
end
let(:priority) { create :default_priority }
let(:bcf_manager_member) do
create(:member,
project: project,
user: bcf_manager,
roles: [manage_bcf_role])
project: project,
user: bcf_manager,
roles: [manage_bcf_role])
end
let(:markup) do
<<-MARKUP

@ -84,8 +84,8 @@ describe ::OpenProject::Bim::BcfXml::IssueWriter do
end
let(:bcf_issue) do
create(:bcf_issue_with_comment,
work_package: work_package,
markup: markup)
work_package: work_package,
markup: markup)
end
let(:priority) { create :priority_low }
let(:current_user) { create(:user) }
@ -93,12 +93,12 @@ describe ::OpenProject::Bim::BcfXml::IssueWriter do
let(:type) { create :type, name: 'Issue' }
let(:work_package) do
create(:work_package,
project_id: project.id,
priority: priority,
author: current_user,
assigned_to: current_user,
due_date: due_date,
type: type)
project_id: project.id,
priority: priority,
author: current_user,
assigned_to: current_user,
due_date: due_date,
type: type)
end
before do

@ -33,7 +33,7 @@ describe Bim::Bcf::Issues::UpdateContract do
it_behaves_like 'issues contract' do
let(:issue) do
build_stubbed(:bcf_issue,
work_package: issue_work_package).tap do |i|
work_package: issue_work_package).tap do |i|
# in order to actually have something changed
i.index = issue_index
end

@ -37,9 +37,9 @@ describe Bim::IfcModels::UpdateContract do
let(:ifc_model) do
build_stubbed(:ifc_model,
uploader: model_user,
title: model_title,
project: model_project).tap do |model|
uploader: model_user,
title: model_title,
project: model_project).tap do |model|
model.extend(OpenProject::ChangedBySystem)
if changed_by_system

@ -31,11 +31,11 @@ require 'spec_helper'
describe ::Bim::Bcf::IssuesController, type: :controller do
let(:manage_bcf_role) do
create(:role,
permissions: %i[manage_bcf view_linked_issues view_work_packages add_work_packages edit_work_packages])
permissions: %i[manage_bcf view_linked_issues view_work_packages add_work_packages edit_work_packages])
end
let(:collaborator_role) do
create(:role,
permissions: %i[view_linked_issues view_work_packages add_work_packages edit_work_packages])
permissions: %i[view_linked_issues view_work_packages add_work_packages edit_work_packages])
end
let(:bcf_manager) { create(:user, firstname: "BCF Manager") }
let(:collaborator) { create(:user) }
@ -46,15 +46,15 @@ describe ::Bim::Bcf::IssuesController, type: :controller do
end
let(:member) do
create(:member,
project: project,
user: collaborator,
roles: [collaborator_role])
project: project,
user: collaborator,
roles: [collaborator_role])
end
let(:bcf_manager_member) do
create(:member,
project: project,
user: bcf_manager,
roles: [manage_bcf_role])
project: project,
user: bcf_manager,
roles: [manage_bcf_role])
end
before do
bcf_manager_member
@ -76,9 +76,9 @@ describe ::Bim::Bcf::IssuesController, type: :controller do
context 'no manage_bcf permission' do
let(:bcf_manager_member) do
create(:member,
project: project,
user: bcf_manager,
roles: [collaborator_role])
project: project,
user: bcf_manager,
roles: [collaborator_role])
end
it 'will return "not authorized"' do
expect(response).to_not be_successful

@ -12,8 +12,8 @@ describe 'BCF snapshot column',
let!(:bcf_issue) { create(:bcf_issue_with_viewpoint, work_package: work_package) }
let(:user) do
create :user,
member_in_project: project,
member_with_permissions: permissions
member_in_project: project,
member_with_permissions: permissions
end
let!(:query) do
query = build(:query, user: user, project: project)

@ -7,9 +7,9 @@ describe 'Create BCF',
with_mail: false do
let(:project) do
create(:project,
types: [type, type_with_cf],
enabled_module_names: %i[bim work_package_tracking],
work_package_custom_fields: [integer_cf])
types: [type, type_with_cf],
enabled_module_names: %i[bim work_package_tracking],
work_package_custom_fields: [integer_cf])
end
let(:index_page) { Pages::IfcModels::ShowDefault.new(project) }
let(:permissions) { %i[view_ifc_models view_linked_issues manage_bcf add_work_packages edit_work_packages view_work_packages] }
@ -18,14 +18,14 @@ describe 'Create BCF',
let(:user) do
create :user,
member_in_project: project,
member_with_permissions: permissions
member_in_project: project,
member_with_permissions: permissions
end
let!(:model) do
create(:ifc_model_minimal_converted,
project: project,
uploader: user)
project: project,
uploader: user)
end
let(:type) { create(:type) }
let(:type_with_cf) do

@ -53,14 +53,14 @@ describe 'bcf export',
let(:current_user) do
create :user,
member_in_project: project,
member_with_permissions: permissions
member_in_project: project,
member_with_permissions: permissions
end
let!(:model) do
create(:ifc_model_minimal_converted,
project: project,
uploader: current_user)
project: project,
uploader: current_user)
end
let(:model_page) { ::Pages::IfcModels::ShowDefault.new project }

@ -39,27 +39,27 @@ describe 'bcf view management',
let(:bcf_page) { ::Pages::IfcModels::ShowDefault.new(project) }
let(:role) do
create :role,
permissions: %w[
view_work_packages
save_queries
save_public_queries
view_ifc_models
save_bcf_queries
manage_public_bcf_queries
]
permissions: %w[
view_work_packages
save_queries
save_public_queries
view_ifc_models
save_bcf_queries
manage_public_bcf_queries
]
end
let(:user) do
create :user,
member_in_project: project,
member_through_role: role
member_in_project: project,
member_through_role: role
end
let!(:model) do
create(:ifc_model_minimal_converted,
project: project,
uploader: user,
is_default: true)
project: project,
uploader: user,
is_default: true)
end
before do

@ -46,8 +46,8 @@ describe 'BIM filter spec',
let!(:model) do
create(:ifc_model_minimal_converted,
project: project,
uploader: admin)
project: project,
uploader: admin)
end
let(:card_view) { ::Pages::WorkPackageCards.new(project) }

@ -40,14 +40,14 @@ describe 'BIM navigation spec',
let(:user) do
create :user,
member_in_project: project,
member_through_role: role
member_in_project: project,
member_through_role: role
end
let(:model) do
create(:ifc_model_minimal_converted,
project: project,
uploader: user)
project: project,
uploader: user)
end
let(:card_view) { ::Pages::WorkPackageCards.new(project) }

@ -40,21 +40,21 @@ describe 'model management',
let(:user) do
create :user,
member_in_project: project,
member_through_role: role
member_in_project: project,
member_through_role: role
end
let!(:model) do
create(:ifc_model_minimal_converted,
project: project,
uploader: user,
is_default: true)
project: project,
uploader: user,
is_default: true)
end
let!(:model2) do
create(:ifc_model_minimal_converted,
project: project,
uploader: user)
project: project,
uploader: user)
end
context 'with all permissions' do
@ -91,8 +91,8 @@ describe 'model management',
let(:view_role) { create(:role, permissions: %i[view_ifc_models view_work_packages]) }
let(:view_user) do
create :user,
member_in_project: project,
member_through_role: view_role
member_in_project: project,
member_through_role: view_role
end
before do
@ -124,8 +124,8 @@ describe 'model management',
let(:no_permissions_role) { create(:role, permissions: %i[]) }
let(:user_without_permissions) do
create :user,
member_in_project: project,
member_through_role: no_permissions_role
member_in_project: project,
member_through_role: no_permissions_role
end
before do

@ -39,14 +39,14 @@ describe 'model viewer',
let(:user) do
create :user,
member_in_project: project,
member_through_role: role
member_in_project: project,
member_through_role: role
end
let!(:model) do
create(:ifc_model_minimal_converted,
project: project,
uploader: user)
project: project,
uploader: user)
end
let(:show_model_page) { Pages::IfcModels::Show.new(project, model.id) }
@ -106,8 +106,8 @@ describe 'model viewer',
let(:view_role) { create(:role, permissions: %i[view_ifc_models view_work_packages view_linked_issues]) }
let(:view_user) do
create :user,
member_in_project: project,
member_through_role: view_role
member_in_project: project,
member_through_role: view_role
end
before do
@ -128,8 +128,8 @@ describe 'model viewer',
let(:no_permissions_role) { create(:role, permissions: %i[]) }
let(:user_without_permissions) do
create :user,
member_in_project: project,
member_through_role: no_permissions_role
member_in_project: project,
member_through_role: no_permissions_role
end
before do

@ -37,14 +37,14 @@ describe 'BIM Revit Add-in navigation spec',
let!(:work_package) { create(:work_package, project: project) }
let(:role) do
create(:role,
permissions: %i[view_ifc_models manage_ifc_models add_work_packages edit_work_packages view_work_packages])
permissions: %i[view_ifc_models manage_ifc_models add_work_packages edit_work_packages view_work_packages])
end
let(:model_page) { ::Pages::IfcModels::ShowDefault.new(project) }
let(:user) do
create :user,
member_in_project: project,
member_through_role: role
member_in_project: project,
member_through_role: role
end
context "when logged in on model page" do

@ -37,14 +37,14 @@ describe 'BIM Revit Add-in navigation spec',
let!(:work_package) { create(:work_package, project: project) }
let(:role) do
create(:role,
permissions: %i[view_ifc_models manage_ifc_models add_work_packages edit_work_packages view_work_packages])
permissions: %i[view_ifc_models manage_ifc_models add_work_packages edit_work_packages view_work_packages])
end
let(:wp_table) { ::Pages::WorkPackagesTable.new(project) }
let(:user) do
create :user,
member_in_project: project,
member_through_role: role
member_in_project: project,
member_through_role: role
end
let(:model_page) { ::Pages::IfcModels::ShowDefault.new(project) }

@ -39,15 +39,15 @@ describe 'show default model',
let(:user) do
create :user,
member_in_project: project,
member_through_role: role
member_in_project: project,
member_through_role: role
end
let(:model) do
create(:ifc_model_minimal_converted,
is_default: model_is_default,
project: project,
uploader: user)
is_default: model_is_default,
project: project,
uploader: user)
end
let(:model_is_default) { true }
let(:model_tree) { ::Components::XeokitModelTree.new }
@ -101,7 +101,7 @@ describe 'show default model',
it 'renders a notification' do
show_default_page
.expect_toast(type: :info,
message: I18n.t(:'ifc_models.processing_notice.processing_default'))
message: I18n.t(:'ifc_models.processing_notice.processing_default'))
end
end
end

@ -37,9 +37,9 @@ describe 'Create viewpoint from BCF details page',
let!(:model) do
create(:ifc_model_minimal_converted,
title: 'minimal',
project: project,
uploader: user)
title: 'minimal',
project: project,
uploader: user)
end
let(:show_model_page) { Pages::IfcModels::ShowDefault.new(project) }

@ -41,9 +41,9 @@ describe 'Delete viewpoint in model viewer',
let!(:model) do
create(:ifc_model_minimal_converted,
title: 'minimal',
project: project,
uploader: user)
title: 'minimal',
project: project,
uploader: user)
end
let(:model_tree) { ::Components::XeokitModelTree.new }

@ -34,8 +34,8 @@ describe 'Show viewpoint in model viewer',
js: true do
let(:project) do
create(:project,
enabled_module_names: %i[bim work_package_tracking],
parent: parent_project)
enabled_module_names: %i[bim work_package_tracking],
parent: parent_project)
end
let(:parent_project) { nil }
let(:user) { create :admin }
@ -46,9 +46,9 @@ describe 'Show viewpoint in model viewer',
let!(:model) do
create(:ifc_model_minimal_converted,
title: 'minimal',
project: project,
uploader: user)
title: 'minimal',
project: project,
uploader: user)
end
let(:model_tree) { ::Components::XeokitModelTree.new }
@ -140,8 +140,8 @@ describe 'Show viewpoint in model viewer',
let(:user) do
create(:user,
member_in_project: project,
member_with_permissions: permissions)
member_in_project: project,
member_with_permissions: permissions)
end
it 'does not show the viewpoint' do

@ -34,7 +34,7 @@ require Rails.root + 'spec/lib/api/v3/work_packages/eager_loading/eager_loading_
describe ::API::V3::WorkPackages::EagerLoading::Checksum do
let!(:bcf_issue) do
create(:bcf_issue,
work_package: work_package)
work_package: work_package)
end
let!(:work_package) do
create(:work_package)
@ -58,7 +58,7 @@ describe ::API::V3::WorkPackages::EagerLoading::Checksum do
it 'produces a different checksum on changes to the bcf issue id' do
bcf_issue.delete
create(:bcf_issue,
work_package: work_package)
work_package: work_package)
expect(new_checksum)
.not_to eql orig_checksum

@ -24,8 +24,8 @@ describe ::Bim::IfcModels::IfcModel, type: :model do
subject { create :ifc_model_minimal_converted, project: project }
current_user do
create :user,
member_in_project: project,
member_with_permissions: %i[manage_ifc_models]
member_in_project: project,
member_with_permissions: %i[manage_ifc_models]
end
it 'replaces the previous attachment' do

@ -44,11 +44,11 @@ describe Bim::Bcf::API::V2_1::Topics::SingleRepresenter, 'rendering' do
let(:priority) { build_stubbed(:priority) }
let(:work_package) do
build_stubbed(:stubbed_work_package,
assigned_to: assignee,
due_date: Date.today,
status: status,
priority: priority,
type: type).tap do |wp|
assigned_to: assignee,
due_date: Date.today,
status: status,
priority: priority,
type: type).tap do |wp|
allow(wp)
.to receive(:journals)
.and_return(journals)

@ -41,14 +41,14 @@ describe 'BCF 2.1 comments resource', type: :request, content_type: :json, with_
let(:view_only_user) do
create(:user,
member_in_project: project,
member_with_permissions: %i[view_linked_issues view_work_packages])
member_in_project: project,
member_with_permissions: %i[view_linked_issues view_work_packages])
end
let(:edit_user) do
create(:user,
member_in_project: project,
member_with_permissions: %i[view_linked_issues view_work_packages manage_bcf])
member_in_project: project,
member_with_permissions: %i[view_linked_issues view_work_packages manage_bcf])
end
let(:user_without_permission) { create(:user, member_in_project: project) }
@ -563,10 +563,10 @@ describe 'BCF 2.1 comments resource', type: :request, content_type: :json, with_
context 'if the updated comment contains viewpoint reference and is a reply, but update does not set those attributes' do
let(:updated_comment) do
create(:bcf_comment,
issue: bcf_issue,
viewpoint: viewpoint,
reply_to: bcf_comment,
author: edit_user)
issue: bcf_issue,
viewpoint: viewpoint,
reply_to: bcf_comment,
author: edit_user)
end
let(:params) { { comment: "Only change the comment text and leave the reply and viewpoint guid empty." } }

@ -44,8 +44,8 @@ describe 'BCF 2.1 project extensions resource', type: :request, content_type: :j
context 'with only view_project permissions' do
let(:current_user) do
create(:user,
member_in_project: project,
member_with_permissions: [:view_project])
member_in_project: project,
member_with_permissions: [:view_project])
end
before do
@ -74,14 +74,14 @@ describe 'BCF 2.1 project extensions resource', type: :request, content_type: :j
context 'with edit permissions in project' do
let(:current_user) do
create(:user,
member_in_project: project,
member_with_permissions: %i[view_project edit_project manage_bcf view_members])
member_in_project: project,
member_with_permissions: %i[view_project edit_project manage_bcf view_members])
end
let(:other_user) do
create(:user,
member_in_project: project,
member_with_permissions: [:view_project])
member_in_project: project,
member_with_permissions: [:view_project])
end
before do

@ -36,12 +36,12 @@ describe 'BCF 2.1 projects resource', type: :request, content_type: :json do
let(:view_only_user) do
create(:user,
member_in_project: project)
member_in_project: project)
end
let(:edit_user) do
create(:user,
member_in_project: project,
member_with_permissions: [:edit_project])
member_in_project: project,
member_with_permissions: [:edit_project])
end
let(:non_member_user) do
create(:user)
@ -132,9 +132,9 @@ describe 'BCF 2.1 projects resource', type: :request, content_type: :json do
let!(:non_bcf_project) do
create(:project, enabled_module_names: [:work_packages]).tap do |p|
create(:member,
project: p,
user: view_only_user,
roles: view_only_user.members.first.roles)
project: p,
user: view_only_user,
roles: view_only_user.members.first.roles)
end
end

@ -37,40 +37,40 @@ describe 'BCF 2.1 topics resource', type: :request, content_type: :json, with_ma
let(:view_only_user) do
create(:user,
member_in_project: project,
member_with_permissions: %i[view_linked_issues view_work_packages])
member_in_project: project,
member_with_permissions: %i[view_linked_issues view_work_packages])
end
let(:only_member_user) do
create(:user,
member_in_project: project,
member_with_permissions: [])
member_in_project: project,
member_with_permissions: [])
end
let(:edit_member_user) do
create(:user,
member_in_project: project,
member_with_permissions: %i[manage_bcf
add_work_packages
view_linked_issues
view_work_packages
edit_work_packages])
member_in_project: project,
member_with_permissions: %i[manage_bcf
add_work_packages
view_linked_issues
view_work_packages
edit_work_packages])
end
let(:edit_and_delete_member_user) do
create(:user,
member_in_project: project,
member_with_permissions: %i[delete_bcf
delete_work_packages
manage_bcf
add_work_packages
view_linked_issues
view_work_packages])
member_in_project: project,
member_with_permissions: %i[delete_bcf
delete_work_packages
manage_bcf
add_work_packages
view_linked_issues
view_work_packages])
end
let(:edit_work_package_member_user) do
create(:user,
member_in_project: project,
member_with_permissions: %i[add_work_packages
view_linked_issues
edit_work_packages
view_work_packages])
member_in_project: project,
member_with_permissions: %i[add_work_packages
view_linked_issues
edit_work_packages
view_work_packages])
end
let(:non_member_user) do
create(:user)
@ -78,14 +78,14 @@ describe 'BCF 2.1 topics resource', type: :request, content_type: :json, with_ma
let(:project) do
create(:project,
enabled_module_names: %i[bim work_package_tracking])
enabled_module_names: %i[bim work_package_tracking])
end
let(:assignee) { create(:user) }
let(:work_package) do
create(:work_package,
assigned_to: assignee,
due_date: Date.today,
project: project)
assigned_to: assignee,
due_date: Date.today,
project: project)
end
let(:other_status) do
create(:status).tap do |s|
@ -93,10 +93,10 @@ describe 'BCF 2.1 topics resource', type: :request, content_type: :json, with_ma
if member
create(:workflow,
old_status: work_package.status,
new_status: s,
type: work_package.type,
role: member.roles.first)
old_status: work_package.status,
new_status: s,
type: work_package.type,
role: member.roles.first)
end
end
end
@ -505,10 +505,10 @@ describe 'BCF 2.1 topics resource', type: :request, content_type: :json, with_ma
if member
create(:workflow,
old_status: status,
new_status: s,
type: type,
role: member.roles.first)
old_status: status,
new_status: s,
type: type,
role: member.roles.first)
end
end
end
@ -760,10 +760,10 @@ describe 'BCF 2.1 topics resource', type: :request, content_type: :json, with_ma
if member
create(:workflow,
old_status: status,
new_status: s,
type: type,
role: member.roles.first)
old_status: status,
new_status: s,
type: type,
role: member.roles.first)
end
end
end

@ -37,19 +37,19 @@ describe 'BCF 2.1 viewpoints resource', type: :request, content_type: :json, wit
shared_let(:project) do
create(:project,
enabled_module_names: [:bim])
enabled_module_names: [:bim])
end
shared_let(:view_only_user) do
create(:user,
member_in_project: project,
member_with_permissions: [:view_linked_issues])
member_in_project: project,
member_with_permissions: [:view_linked_issues])
end
shared_let(:create_user) do
create(:user,
member_in_project: project,
member_with_permissions: %i[view_linked_issues manage_bcf])
member_in_project: project,
member_with_permissions: %i[view_linked_issues manage_bcf])
end
shared_let(:non_member_user) do

@ -32,20 +32,20 @@ describe 'bim/ifc_models/ifc_models/index', type: :view do
let(:project) { create(:project, enabled_module_names: %i[bim]) }
let(:ifc_model) do
create(:ifc_model,
uploader: uploader_user,
title: "office.ifc",
project: project).tap do |model|
uploader: uploader_user,
title: "office.ifc",
project: project).tap do |model|
model.uploader = uploader_user
end
end
let(:role) do
create(:role,
permissions: %i[view_ifc_models manage_ifc_models])
permissions: %i[view_ifc_models manage_ifc_models])
end
let(:user) do
create :user,
member_in_project: project,
member_through_role: role
member_in_project: project,
member_through_role: role
end
let(:uploader_user) { user }
@ -90,8 +90,8 @@ describe 'bim/ifc_models/ifc_models/index', type: :view do
context 'without ifc_attachment' do
let(:ifc_model) do
create(:ifc_model_without_ifc_attachment,
title: "office.ifc",
project: project)
title: "office.ifc",
project: project)
end
it 'lists the IFC model with all but the download button' do

@ -26,13 +26,13 @@ FactoryBot.define do
end
board.widgets << create(:grid_widget,
identifier: 'work_package_query',
start_row: 1,
end_row: 2,
start_column: 1,
end_column: 1,
options: { 'queryId' => query.id,
"filters" => [{ "manualSort" => { "operator" => "ow", "values" => [] } }] })
identifier: 'work_package_query',
start_row: 1,
end_row: 2,
start_column: 1,
end_column: 1,
options: { 'queryId' => query.id,
"filters" => [{ "manualSort" => { "operator" => "ow", "values" => [] } }] })
end
end
@ -55,13 +55,13 @@ FactoryBot.define do
end
board.widgets << create(:grid_widget,
identifier: 'work_package_query',
start_row: 1,
end_row: 2,
start_column: 1,
end_column: 1,
options: { 'queryId' => query.id,
"filters" => [{ "manualSort" => { "operator" => "ow", "values" => [] } }] })
identifier: 'work_package_query',
start_row: 1,
end_row: 2,
start_column: 1,
end_column: 1,
options: { 'queryId' => query.id,
"filters" => [{ "manualSort" => { "operator" => "ow", "values" => [] } }] })
end
end
end
@ -89,13 +89,13 @@ FactoryBot.define do
board.options = { 'type' => 'action', 'attribute' => 'subproject' }
board.widgets << create(:grid_widget,
identifier: 'work_package_query',
start_row: 1,
end_row: 2,
start_column: 1,
end_column: 1,
options: { 'queryId' => query.id,
'filters' => filters })
identifier: 'work_package_query',
start_row: 1,
end_row: 2,
start_column: 1,
end_column: 1,
options: { 'queryId' => query.id,
'filters' => filters })
end
end
end

@ -35,10 +35,10 @@ describe 'Assignee action board',
js: true do
let(:bobself_user) do
create(:user,
firstname: 'Bob',
lastname: 'Self',
member_in_project: project,
member_through_role: role)
firstname: 'Bob',
lastname: 'Self',
member_in_project: project,
member_through_role: role)
end
let(:admin) { create(:admin) }
let(:type) { create(:type_standard) }
@ -60,26 +60,26 @@ describe 'Assignee action board',
let!(:foobar_user) do
create(:user,
firstname: 'Foo',
lastname: 'Bar',
member_in_project: project,
member_through_role: role)
firstname: 'Foo',
lastname: 'Bar',
member_in_project: project,
member_through_role: role)
end
let!(:group) do
create(:group, name: 'Grouped').tap do |group|
create(:member,
principal: group,
project: project,
roles: [role])
principal: group,
project: project,
roles: [role])
end
end
let!(:work_package) do
create :work_package,
project: project,
assigned_to: bobself_user,
subject: 'Some Task'
project: project,
assigned_to: bobself_user,
subject: 'Some Task'
end
context 'in a project with members' do

@ -33,8 +33,8 @@ require_relative './../support/board_page'
describe 'Custom field filter in boards', type: :feature, js: true do
let(:user) do
create(:user,
member_in_project: project,
member_through_role: role)
member_in_project: project,
member_through_role: role)
end
let(:type) { create(:type_standard) }
let(:project) { create(:project, types: [type], enabled_module_names: %i[work_package_tracking board_view]) }
@ -53,10 +53,10 @@ describe 'Custom field filter in boards', type: :feature, js: true do
let!(:work_package) do
wp = build :work_package,
project: project,
type: type,
subject: 'Foo',
status: open_status
project: project,
type: type,
subject: 'Foo',
status: open_status
wp.custom_field_values = {
custom_field.id => %w[B].map { |s| custom_value_for(s) }

@ -33,8 +33,8 @@ require_relative './../support/board_page'
describe 'Status action board', type: :feature, js: true do
let(:user) do
create(:user,
member_in_project: project,
member_through_role: role)
member_in_project: project,
member_through_role: role)
end
let(:type) { create(:type_standard) }
let(:project) { create(:project, types: [type], enabled_module_names: %i[work_package_tracking board_view]) }
@ -57,24 +57,24 @@ describe 'Status action board', type: :feature, js: true do
let!(:workflow_type) do
create(:workflow,
type: type,
role: role,
old_status_id: open_status.id,
new_status_id: closed_status.id)
type: type,
role: role,
old_status_id: open_status.id,
new_status_id: closed_status.id)
end
let!(:workflow_type_back) do
create(:workflow,
type: type,
role: role,
old_status_id: other_status.id,
new_status_id: open_status.id)
type: type,
role: role,
old_status_id: other_status.id,
new_status_id: open_status.id)
end
let!(:workflow_type_back_open) do
create(:workflow,
type: type,
role: role,
old_status_id: closed_status.id,
new_status_id: open_status.id)
type: type,
role: role,
old_status_id: closed_status.id,
new_status_id: open_status.id)
end
before do

@ -33,8 +33,8 @@ require_relative './../support/board_page'
describe 'Status action board', type: :feature, js: true do
let(:user) do
create(:user,
member_in_project: project,
member_through_role: role)
member_in_project: project,
member_through_role: role)
end
let(:permissions) do
%i[show_board_views manage_board_views add_work_packages
@ -56,47 +56,47 @@ describe 'Status action board', type: :feature, js: true do
let(:task_wp) do
create :work_package,
project: project,
type: type_task,
subject: 'Open task item',
status: open_status
project: project,
type: type_task,
subject: 'Open task item',
status: open_status
end
let(:bug_wp) do
create :work_package,
project: project,
type: type_bug,
subject: 'Closed bug item',
status: closed_status
project: project,
type: type_bug,
subject: 'Closed bug item',
status: closed_status
end
let!(:workflow_task) do
create(:workflow,
type: type_task,
role: role,
old_status_id: open_status.id,
new_status_id: closed_status.id)
type: type_task,
role: role,
old_status_id: open_status.id,
new_status_id: closed_status.id)
end
let!(:workflow_task_back) do
create(:workflow,
type: type_task,
role: role,
old_status_id: closed_status.id,
new_status_id: open_status.id)
type: type_task,
role: role,
old_status_id: closed_status.id,
new_status_id: open_status.id)
end
let!(:workflow_bug) do
create(:workflow,
type: type_bug,
role: role,
old_status_id: open_status.id,
new_status_id: closed_status.id)
type: type_bug,
role: role,
old_status_id: open_status.id,
new_status_id: closed_status.id)
end
let!(:workflow_bug_back) do
create(:workflow,
type: type_bug,
role: role,
old_status_id: closed_status.id,
new_status_id: open_status.id)
type: type_bug,
role: role,
old_status_id: closed_status.id,
new_status_id: open_status.id)
end
let(:filters) { ::Components::WorkPackages::Filters.new }

@ -33,8 +33,8 @@ require_relative './../support/board_page'
describe 'Subproject action board', type: :feature, js: true do
let(:user) do
create(:user,
member_in_project: project,
member_through_role: role)
member_in_project: project,
member_through_role: role)
end
let(:type) { create(:type_standard) }
let(:project) do
@ -75,8 +75,8 @@ describe 'Subproject action board', type: :feature, js: true do
let(:user) do
create(:user,
member_in_projects: [project, subproject1, subproject2],
member_through_role: role)
member_in_projects: [project, subproject1, subproject2],
member_through_role: role)
end
it 'does not allow to move work packages' do
@ -98,14 +98,14 @@ describe 'Subproject action board', type: :feature, js: true do
context 'with permissions in all subprojects' do
let(:user) do
create(:user,
member_in_projects: [project, subproject1, subproject2],
member_through_role: role)
member_in_projects: [project, subproject1, subproject2],
member_through_role: role)
end
let(:only_parent_user) do
create(:user,
member_in_project: project,
member_through_role: role)
member_in_project: project,
member_through_role: role)
end
it 'allows management of subproject work packages' do
@ -179,14 +179,14 @@ describe 'Subproject action board', type: :feature, js: true do
let(:user) do
create(:user,
# The membership in subproject2 gets removed later on
member_in_projects: [project, subproject1, subproject2],
member_through_role: role)
member_in_projects: [project, subproject1, subproject2],
member_through_role: role)
end
let!(:board) do
create(:subproject_board,
project: project,
projects_columns: [subproject1, subproject2])
project: project,
projects_columns: [subproject1, subproject2])
end
let(:board_page) { Pages::Board.new(board) }
@ -219,14 +219,14 @@ describe 'Subproject action board', type: :feature, js: true do
context 'with an archived subproject' do
let(:user) do
create(:user,
member_in_projects: [project, subproject1, subproject2],
member_through_role: role)
member_in_projects: [project, subproject1, subproject2],
member_through_role: role)
end
let!(:board) do
create(:subproject_board,
project: project,
projects_columns: [subproject1])
project: project,
projects_columns: [subproject1])
end
let(:board_page) { Pages::Board.new(board) }

@ -37,8 +37,8 @@ describe 'Subtasks action board', type: :feature, js: true do
let(:user) do
create(:user,
member_in_project: project,
member_through_role: role)
member_in_project: project,
member_through_role: role)
end
let(:board_index) { Pages::BoardIndex.new(project) }
@ -170,7 +170,7 @@ describe 'Subtasks action board', type: :feature, js: true do
board_page.move_card(0, from: 'Parent WP', to: 'Child WP')
board_page.expect_and_dismiss_toaster type: :error,
message: I18n.t('js.boards.error_cannot_move_into_self')
message: I18n.t('js.boards.error_cannot_move_into_self')
child.reload
expect(child.parent).to eq parent

@ -34,14 +34,14 @@ require_relative './../support/board_page'
describe 'Version action board', type: :feature, js: true do
let(:user) do
create(:user,
member_in_projects: [project, second_project],
member_through_role: role)
member_in_projects: [project, second_project],
member_through_role: role)
end
let(:second_user) do
create(:user,
member_in_projects: [project, second_project],
member_through_role: role_board_manager)
member_in_projects: [project, second_project],
member_through_role: role_board_manager)
end
let(:type) { create(:type_standard) }
let!(:priority) { create :default_priority }
@ -308,8 +308,8 @@ describe 'Version action board', type: :feature, js: true do
context 'a user with edit_work_packages, but missing assign_versions permissions' do
let(:no_version_edit_user) do
create(:user,
member_in_projects: [project],
member_through_role: no_version_edit_role)
member_in_projects: [project],
member_through_role: no_version_edit_role)
end
let(:no_version_edit_role) { create(:role, permissions: no_version_edit_permissions) }
let(:no_version_edit_permissions) do

@ -33,8 +33,8 @@ require_relative './support/board_page'
describe 'Board remote changes resolution', type: :feature, js: true do
let(:user1) do
create(:user,
member_in_project: project,
member_through_role: role)
member_in_project: project,
member_through_role: role)
end
let(:type) { create(:type_standard) }
let(:project) { create(:project, types: [type], enabled_module_names: %i[work_package_tracking board_view]) }

@ -33,8 +33,8 @@ require_relative './support/board_page'
describe 'Work Package boards spec', type: :feature, js: true do
let(:user) do
create(:user,
member_in_project: project,
member_through_role: role)
member_in_project: project,
member_through_role: role)
end
let(:project) { create(:project, enabled_module_names: %i[work_package_tracking board_view]) }
let(:permissions) { %i[show_board_views manage_board_views add_work_packages view_work_packages manage_public_queries] }
@ -42,17 +42,17 @@ describe 'Work Package boards spec', type: :feature, js: true do
let!(:wp) do
create(:work_package,
project: project,
type: type,
priority: priority,
status: open_status)
project: project,
type: type,
priority: priority,
status: open_status)
end
let!(:wp2) do
create(:work_package,
project: project,
type: type2,
priority: priority2,
status: open_status)
project: project,
type: type2,
priority: priority2,
status: open_status)
end
let!(:priority) { create :priority, color: color }

@ -33,8 +33,8 @@ require_relative './support/board_page'
describe 'Board management spec', type: :feature, js: true do
let(:user) do
create(:user,
member_in_project: project,
member_through_role: role)
member_in_project: project,
member_through_role: role)
end
let(:project) { create(:project, enabled_module_names: %i[work_package_tracking board_view]) }
let(:role) { create(:role, permissions: permissions) }

@ -33,8 +33,8 @@ require_relative './support/board_page'
describe 'Work Package boards spec', type: :feature, js: true do
let(:user) do
create(:user,
member_in_project: project,
member_through_role: role)
member_in_project: project,
member_through_role: role)
end
# The identifier is important to test https://community.openproject.com/wp/29754
let(:project) { create(:project, identifier: 'boards', enabled_module_names: %i[work_package_tracking board_view]) }

@ -33,8 +33,8 @@ require_relative './support/board_page'
describe 'Board reference work package spec', type: :feature, js: true do
let(:user) do
create(:user,
member_in_project: project,
member_through_role: role)
member_in_project: project,
member_through_role: role)
end
let(:project) { create(:project, enabled_module_names: %i[work_package_tracking board_view]) }
let(:role) { create(:role, permissions: permissions) }
@ -100,8 +100,8 @@ describe 'Board reference work package spec', type: :feature, js: true do
let(:user) do
create(:user,
member_in_projects: [project, child_project],
member_through_role: role)
member_in_projects: [project, child_project],
member_through_role: role)
end
it 'returns the work package when subproject filters is added' do

@ -33,8 +33,8 @@ describe 'boards onboarding tour', js: true do
let(:next_button) { find('.enjoyhint_next_btn') }
let(:user) do
create :admin,
member_in_project: demo_project,
member_through_role: role
member_in_project: demo_project,
member_through_role: role
end
let(:permissions) do
%i[
@ -50,17 +50,17 @@ describe 'boards onboarding tour', js: true do
let(:demo_project) do
create :project,
name: 'Demo project',
identifier: 'demo-project',
public: true,
enabled_module_names: %w[work_package_tracking wiki board_view]
name: 'Demo project',
identifier: 'demo-project',
public: true,
enabled_module_names: %w[work_package_tracking wiki board_view]
end
let(:scrum_project) do
create :project,
name: 'Scrum project',
identifier: 'your-scrum-project',
public: true,
enabled_module_names: %w[work_package_tracking wiki board_view]
name: 'Scrum project',
identifier: 'your-scrum-project',
public: true,
enabled_module_names: %w[work_package_tracking wiki board_view]
end
let!(:wp_1) { create(:work_package, project: demo_project) }
let!(:wp_2) { create(:work_package, project: scrum_project) }

@ -6,8 +6,8 @@ describe OpenProject::Boards::GridRegistration do
let(:board) { create(:board_grid, project: project) }
let(:user) do
create(:user,
member_in_project: project,
member_with_permissions: permissions)
member_in_project: project,
member_with_permissions: permissions)
end
describe 'from_scope' do

@ -33,8 +33,8 @@ require 'spec_helper'
describe Projects::CopyService, 'integration', type: :model do
let(:current_user) do
create(:user,
member_in_project: source,
member_through_role: role)
member_in_project: source,
member_through_role: role)
end
let!(:source) { create :project, enabled_module_names: %w[boards work_package_tracking] }
let(:query) { board_view.contained_queries.first }
@ -57,15 +57,15 @@ describe Projects::CopyService, 'integration', type: :model do
describe 'for a subproject board' do
let(:current_user) do
create(:user,
member_in_projects: [source, child_project],
member_through_role: role)
member_in_projects: [source, child_project],
member_through_role: role)
end
let!(:child_project) { create :project, parent: source }
let!(:board_view) do
create :board_grid_with_query,
project: source,
name: 'Subproject board',
options: { "type" => "action", "attribute" => "subproject" }
project: source,
name: 'Subproject board',
options: { "type" => "action", "attribute" => "subproject" }
end
before do

@ -34,9 +34,9 @@ require 'features/page_objects/notification'
describe 'Upload attachment to budget', js: true do
let(:user) do
create :user,
member_in_project: project,
member_with_permissions: %i[view_budgets
edit_budgets]
member_in_project: project,
member_with_permissions: %i[view_budgets
edit_budgets]
end
let(:project) { create(:project) }
let(:attachments) { ::Components::Attachments.new }

@ -32,18 +32,18 @@ describe 'Copying a budget', type: :feature, js: true do
let(:project) { create :project, enabled_module_names: %i[budgets costs] }
let(:current_user) do
create :user,
member_in_project: project,
member_with_permissions: %i(view_budgets edit_budgets view_hourly_rates view_cost_rates)
member_in_project: project,
member_with_permissions: %i(view_budgets edit_budgets view_hourly_rates view_cost_rates)
end
let(:original_author) { create :user }
let(:budget_subject) { "A budget subject" }
let(:budget_description) { "A budget description" }
let!(:budget) do
create :budget,
subject: budget_subject,
description: budget_description,
author: original_author,
project: project
subject: budget_subject,
description: budget_description,
author: original_author,
project: project
end
let!(:cost_type) do
create :cost_type, name: 'Post-war', unit: 'cap', unit_plural: 'caps'
@ -52,23 +52,23 @@ describe 'Copying a budget', type: :feature, js: true do
let!(:default_hourly_rate) { create :default_hourly_rate, user: original_author, rate: 25.0 }
let!(:material_budget_item) do
create :material_budget_item,
units: 3,
cost_type: cost_type,
budget: budget
units: 3,
cost_type: cost_type,
budget: budget
end
let!(:overwritten_material_budget_item) do
create :material_budget_item,
units: 10,
cost_type: cost_type,
budget: budget,
amount: 600000.00
units: 10,
cost_type: cost_type,
budget: budget,
amount: 600000.00
end
let!(:labor_budget_item) do
create :labor_budget_item,
hours: 5,
user: original_author,
budget: budget
hours: 5,
user: original_author,
budget: budget
end
let(:budget_page) { Pages::EditBudget.new budget.id }

@ -35,10 +35,10 @@ describe 'Deleting a budget', type: :feature, js: true do
let(:budget_description) { "A budget description" }
let!(:budget) do
create :budget,
subject: budget_subject,
description: budget_description,
author: user,
project: project
subject: budget_subject,
description: budget_description,
author: user,
project: project
end
let(:budget_page) { Pages::EditBudget.new budget.id }
@ -101,10 +101,10 @@ describe 'Deleting a budget', type: :feature, js: true do
context 'with another budget to assign to' do
let(:budget2) do
create :budget,
subject: 'Another budget',
description: budget_description,
author: user,
project: project
subject: 'Another budget',
description: budget_description,
author: user,
project: project
end
before do

@ -31,8 +31,8 @@ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
describe 'updating a budget', type: :feature, js: true do
let(:project) do
create :project_with_types,
enabled_module_names: %i[budgets costs],
members: { user => create(:role) }
enabled_module_names: %i[budgets costs],
members: { user => create(:role) }
end
let(:user) { create :admin }
let(:budget) { create :budget, author: user, project: project }
@ -81,16 +81,16 @@ describe 'updating a budget', type: :feature, js: true do
let(:material_budget_item) do
create :material_budget_item,
units: 3,
cost_type: cost_type,
budget: budget
units: 3,
cost_type: cost_type,
budget: budget
end
let(:labor_budget_item) do
create :labor_budget_item,
hours: 5,
user: user,
budget: budget
hours: 5,
user: user,
budget: budget
end
let(:budget_page) { Pages::EditBudget.new budget.id }
@ -145,10 +145,10 @@ describe 'updating a budget', type: :feature, js: true do
let(:material_budget_item2) do
create :material_budget_item,
units: 3,
cost_type: cost_type2,
budget: budget,
amount: 1000.0
units: 3,
cost_type: cost_type2,
budget: budget,
amount: 1000.0
end
it 'retains the overridden budget when opening, but not editing (Regression #32822)' do
@ -176,9 +176,9 @@ describe 'updating a budget', type: :feature, js: true do
context 'with two material budget items' do
let!(:material_budget_item_2) do
create :material_budget_item,
units: 5,
cost_type: cost_type,
budget: budget
units: 5,
cost_type: cost_type,
budget: budget
end
it 'keeps previous planned material costs (Regression test #27692)' do
@ -253,9 +253,9 @@ describe 'updating a budget', type: :feature, js: true do
context 'with two labor budget items' do
let!(:labor_budget_item_2) do
create :labor_budget_item,
hours: 5,
user: user,
budget: budget
hours: 5,
user: user,
budget: budget
end
it 'keeps previous planned labor costs (Regression test #27692)' do

@ -37,9 +37,9 @@ describe 'Filter by budget', js: true do
let(:member) do
create(:member,
user: user,
project: project,
roles: [create(:role)])
user: user,
project: project,
roles: [create(:role)])
end
let(:status) do
create(:status)
@ -51,13 +51,13 @@ describe 'Filter by budget', js: true do
let(:work_package_with_budget) do
create(:work_package,
project: project,
budget: budget)
project: project,
budget: budget)
end
let(:work_package_without_budget) do
create(:work_package,
project: project)
project: project)
end
before do

@ -34,16 +34,16 @@ describe ::API::V3::Budgets::BudgetRepresenter do
let(:project) { build(:project, id: 999) }
let(:user) do
create(:user,
member_in_project: project,
created_at: 1.day.ago,
updated_at: Date.today)
member_in_project: project,
created_at: 1.day.ago,
updated_at: Date.today)
end
let(:budget) do
create(:budget,
author: user,
project: project,
created_at: 1.day.ago,
updated_at: Date.today)
author: user,
project: project,
created_at: 1.day.ago,
updated_at: Date.today)
end
let(:representer) { described_class.new(budget, current_user: user) }

@ -44,9 +44,9 @@ describe LaborBudgetItem, type: :model do
def is_member(project, user, permissions)
create(:member,
project: project,
user: user,
roles: [create(:role, permissions: permissions)])
project: project,
user: user,
roles: [create(:role, permissions: permissions)])
end
describe '#calculated_costs' do

@ -36,8 +36,8 @@ describe 'API v3 Budget resource' do
let(:project) { create(:project, public: false) }
let(:current_user) do
create(:user,
member_in_project: project,
member_with_permissions: [:view_budgets])
member_in_project: project,
member_with_permissions: [:view_budgets])
end
subject(:response) { last_response }

@ -36,18 +36,18 @@ describe 'Calendar drag&dop and resizing', type: :feature, js: true do
let!(:other_user) do
create :user,
firstname: 'Bernd',
member_in_project: project,
member_with_permissions: %w[
view_work_packages view_calendar
]
firstname: 'Bernd',
member_in_project: project,
member_with_permissions: %w[
view_work_packages view_calendar
]
end
let!(:work_package) do
create :work_package,
project: project,
start_date: Time.zone.today.beginning_of_week.next_occurring(:tuesday),
due_date: Time.zone.today.beginning_of_week.next_occurring(:thursday)
project: project,
start_date: Time.zone.today.beginning_of_week.next_occurring(:tuesday),
due_date: Time.zone.today.beginning_of_week.next_occurring(:thursday)
end
before do

@ -34,36 +34,36 @@ describe 'Work package calendars', type: :feature, js: true do
let(:project) { create(:project) }
let(:user) do
create(:user,
member_in_project: project,
member_with_permissions: %i[view_work_packages view_calendar])
member_in_project: project,
member_with_permissions: %i[view_work_packages view_calendar])
end
let!(:current_work_package) do
create(:work_package,
subject: 'Current work package',
project: project,
start_date: Date.today.at_beginning_of_month + 15.days,
due_date: Date.today.at_beginning_of_month + 15.days)
subject: 'Current work package',
project: project,
start_date: Date.today.at_beginning_of_month + 15.days,
due_date: Date.today.at_beginning_of_month + 15.days)
end
let!(:another_current_work_package) do
create(:work_package,
subject: 'Another current work package',
project: project,
start_date: Date.today.at_beginning_of_month + 12.days,
due_date: Date.today.at_beginning_of_month + 18.days)
subject: 'Another current work package',
project: project,
start_date: Date.today.at_beginning_of_month + 12.days,
due_date: Date.today.at_beginning_of_month + 18.days)
end
let!(:future_work_package) do
create(:work_package,
subject: 'Future work package',
project: project,
start_date: Date.today.at_beginning_of_month.next_month + 15.days,
due_date: Date.today.at_beginning_of_month.next_month + 15.days)
subject: 'Future work package',
project: project,
start_date: Date.today.at_beginning_of_month.next_month + 15.days,
due_date: Date.today.at_beginning_of_month.next_month + 15.days)
end
let!(:another_future_work_package) do
create(:work_package,
subject: 'Another future work package',
project: project,
start_date: Date.today.at_beginning_of_month.next_month + 12.days,
due_date: Date.today.at_beginning_of_month.next_month + 18.days)
subject: 'Another future work package',
project: project,
start_date: Date.today.at_beginning_of_month.next_month + 12.days,
due_date: Date.today.at_beginning_of_month.next_month + 18.days)
end
let(:filters) { ::Components::WorkPackages::Filters.new }
let(:current_wp_split_screen) { Pages::SplitWorkPackage.new(current_work_package, project) }

@ -37,45 +37,45 @@ describe 'Calendar query handling', type: :feature, js: true do
shared_let(:type_bug) { create(:type_bug) }
shared_let(:project) do
create(:project,
enabled_module_names: %w[work_package_tracking calendar_view],
types: [type_task, type_bug])
enabled_module_names: %w[work_package_tracking calendar_view],
types: [type_task, type_bug])
end
shared_let(:user) do
create :user,
member_in_project: project,
member_with_permissions: %w[
view_work_packages
edit_work_packages
save_queries
save_public_queries
view_calendar
]
member_in_project: project,
member_with_permissions: %w[
view_work_packages
edit_work_packages
save_queries
save_public_queries
view_calendar
]
end
shared_let(:task) do
create :work_package,
project: project,
type: type_task,
assigned_to: user,
start_date: Time.zone.today - 1.day,
due_date: Time.zone.today + 1.day,
subject: 'A task for the user'
project: project,
type: type_task,
assigned_to: user,
start_date: Time.zone.today - 1.day,
due_date: Time.zone.today + 1.day,
subject: 'A task for the user'
end
shared_let(:bug) do
create :work_package,
project: project,
type: type_bug,
assigned_to: user,
start_date: Time.zone.today - 1.day,
due_date: Time.zone.today + 1.day,
subject: 'A bug for the user'
project: project,
type: type_bug,
assigned_to: user,
start_date: Time.zone.today - 1.day,
due_date: Time.zone.today + 1.day,
subject: 'A bug for the user'
end
shared_let(:saved_query) do
create(:query_with_view_work_packages_calendar,
project: project,
public: true)
project: project,
public: true)
end
let(:calendar_page) { ::Pages::Calendar.new project }

@ -38,11 +38,11 @@ shared_context 'with calendar full access' do
shared_let(:user) do
create :user,
member_in_project: project,
member_with_permissions: %w[
view_work_packages edit_work_packages add_work_packages
view_calendar
]
member_in_project: project,
member_with_permissions: %w[
view_work_packages edit_work_packages add_work_packages
view_calendar
]
end
let(:calendar) { ::Pages::Calendar.new project }

@ -42,7 +42,7 @@ describe TimeEntries::DeleteContract do
let(:other_user) { build_stubbed(:user) }
let(:time_entry_work_package) do
build_stubbed(:work_package,
project: time_entry_project)
project: time_entry_project)
end
let(:time_entry_project) { build_stubbed(:project) }
let(:time_entry_user) { current_user }
@ -55,13 +55,13 @@ describe TimeEntries::DeleteContract do
let(:time_entry) do
build_stubbed(:time_entry,
project: time_entry_project,
work_package: time_entry_work_package,
user: time_entry_user,
activity: time_entry_activity,
spent_on: time_entry_spent_on,
hours: time_entry_hours,
comments: time_entry_comments)
project: time_entry_project,
work_package: time_entry_work_package,
user: time_entry_user,
activity: time_entry_activity,
spent_on: time_entry_spent_on,
hours: time_entry_hours,
comments: time_entry_comments)
end
before do

@ -42,7 +42,7 @@ shared_examples_for 'time entry contract' do
let(:other_user) { build_stubbed(:user) }
let(:time_entry_work_package) do
build_stubbed(:work_package,
project: time_entry_project)
project: time_entry_project)
end
let(:time_entry_project) { build_stubbed(:project) }
let(:time_entry_user) { current_user }

@ -35,13 +35,13 @@ describe TimeEntries::UpdateContract do
it_behaves_like 'time entry contract' do
let(:time_entry) do
build_stubbed(:time_entry,
project: time_entry_project,
work_package: time_entry_work_package,
user: time_entry_user,
activity: time_entry_activity,
spent_on: time_entry_spent_on,
hours: time_entry_hours,
comments: time_entry_comments)
project: time_entry_project,
work_package: time_entry_work_package,
user: time_entry_user,
activity: time_entry_activity,
spent_on: time_entry_spent_on,
hours: time_entry_hours,
comments: time_entry_comments)
end
subject(:contract) { described_class.new(time_entry, current_user) }
let(:permissions) { %i(edit_time_entries) }

@ -45,8 +45,8 @@ describe 'Work Package cost fields', type: :feature, js: true do
end
shared_let(:user) do
create :user,
member_in_project: project,
member_through_role: role
member_in_project: project,
member_through_role: role
end
shared_let(:cost_type1) do
type = create :cost_type, name: 'A', unit: 'A single', unit_plural: 'A plural'
@ -166,8 +166,8 @@ describe 'Work Package cost fields', type: :feature, js: true do
context 'with an additional placeholder user in the project' do
let!(:placeholder_user) do
create :placeholder_user,
member_in_project: project,
member_through_role: role
member_in_project: project,
member_through_role: role
end
it 'does not allow to select them (Regression #36353)' do

@ -42,8 +42,8 @@ describe 'Create cost entry without rate permissions', type: :feature, js: true
end
shared_let(:user) do
create :user,
member_in_project: project,
member_through_role: role
member_in_project: project,
member_through_role: role
end
shared_let(:cost_type) do

@ -32,23 +32,23 @@ describe 'Deleting time entries', type: :feature, js: true do
let(:project) { work_package.project }
let(:user) do
create :user,
member_in_project: project,
member_through_role: role
member_in_project: project,
member_through_role: role
end
let(:role) do
create :role,
permissions: %i[view_work_packages
delete_work_packages
edit_cost_entries
view_cost_entries]
permissions: %i[view_work_packages
delete_work_packages
edit_cost_entries
view_cost_entries]
end
let(:work_package) { create :work_package }
let(:destroy_modal) { Components::WorkPackages::DestroyModal.new }
let(:cost_type) do
type = create :cost_type, name: 'Translations'
create :cost_rate,
cost_type: type,
rate: 7.00
cost_type: type,
rate: 7.00
type
end
let(:budget) do
@ -57,11 +57,11 @@ describe 'Deleting time entries', type: :feature, js: true do
let(:other_work_package) { create :work_package, project: project, budget: budget }
let(:cost_entry) do
create :cost_entry,
work_package: work_package,
project: project,
units: 2.00,
cost_type: cost_type,
user: user
work_package: work_package,
project: project,
units: 2.00,
cost_type: cost_type,
user: user
end
it 'allows to move the time entry to a different work package' do

@ -32,7 +32,7 @@ describe 'hourly rates on a member', type: :feature, js: true do
let(:project) { build :project }
let(:user) do
create :admin,
member_in_project: project
member_in_project: project
end
let(:member) { Member.find_by(project: project, principal: user) }

@ -38,18 +38,18 @@ describe 'Work Package table cost entries', type: :feature, js: true do
let!(:time_entry1) do
create :time_entry,
user: user,
work_package: parent,
project: project,
hours: 10
user: user,
work_package: parent,
project: project,
hours: 10
end
let!(:time_entry2) do
create :time_entry,
user: user,
work_package: work_package,
project: project,
hours: 2.50
user: user,
work_package: work_package,
project: project,
hours: 2.50
end
let(:wp_table) { ::Pages::WorkPackagesTable.new(project) }

@ -32,8 +32,8 @@ describe 'Only see your own rates', type: :feature, js: true do
let(:project) { work_package.project }
let(:user) do
create :user,
member_in_project: project,
member_through_role: role
member_in_project: project,
member_through_role: role
end
let(:role) do
create :role, permissions: %i[view_own_hourly_rate
@ -72,8 +72,8 @@ describe 'Only see your own rates', type: :feature, js: true do
let(:other_role) { create :role, permissions: [] }
let(:other_user) do
create :user,
member_in_project: project,
member_through_role: other_role
member_in_project: project,
member_through_role: other_role
end
let(:other_hourly_rate) do
create :default_hourly_rate, user: other_user,

@ -37,19 +37,19 @@ describe ::API::V3::CostEntries::WorkPackageCostsByTypeRepresenter do
let(:cost_type_B) { create(:cost_type) }
let(:cost_entries_A) do
create_list(:cost_entry,
2,
units: 1,
work_package: work_package,
project: project,
cost_type: cost_type_A)
2,
units: 1,
work_package: work_package,
project: project,
cost_type: cost_type_A)
end
let(:cost_entries_B) do
create_list(:cost_entry,
3,
units: 2,
work_package: work_package,
project: project,
cost_type: cost_type_B)
3,
units: 2,
work_package: work_package,
project: project,
cost_type: cost_type_B)
end
let(:current_user) do
create(:user, member_in_project: project, member_through_role: role)

@ -33,13 +33,13 @@ describe ::API::V3::TimeEntries::TimeEntryRepresenter, 'parsing' do
let(:time_entry) do
build_stubbed(:time_entry,
comments: 'blubs',
spent_on: Date.today - 3.days,
created_at: DateTime.now - 6.hours,
updated_at: DateTime.now - 3.hours,
activity: activity,
project: project,
user: user)
comments: 'blubs',
spent_on: Date.today - 3.days,
created_at: DateTime.now - 6.hours,
updated_at: DateTime.now - 3.hours,
activity: activity,
project: project,
user: user)
end
let(:project) { build_stubbed(:project) }
let(:project2) { build_stubbed(:project) }

@ -33,14 +33,14 @@ describe ::API::V3::TimeEntries::TimeEntryRepresenter, 'rendering' do
let(:time_entry) do
build_stubbed(:time_entry,
comments: 'blubs',
spent_on: Date.today,
created_at: DateTime.now - 6.hours,
updated_at: DateTime.now - 3.hours,
hours: hours,
activity: activity,
project: project,
user: user)
comments: 'blubs',
spent_on: Date.today,
created_at: DateTime.now - 6.hours,
updated_at: DateTime.now - 3.hours,
hours: hours,
activity: activity,
project: project,
user: user)
end
let(:project) { build_stubbed(:project) }
let(:work_package) { time_entry.work_package }

@ -37,17 +37,17 @@ describe Projects::Activity, type: :model do
let(:budget) do
create(:budget,
project: project)
project: project)
end
let(:budget2) do
create(:budget,
project: project)
project: project)
end
let(:work_package) do
create(:work_package,
project: project)
project: project)
end
def latest_activity

@ -39,14 +39,14 @@ describe Projects::Scopes::VisibleWithActivatedTimeActivity, type: :model do
let(:current_user) do
create(:user).tap do |u|
create(:member,
project: project,
principal: u,
roles: [create(:role, permissions: project_permissions)])
project: project,
principal: u,
roles: [create(:role, permissions: project_permissions)])
create(:member,
project: other_project,
principal: u,
roles: [create(:role, permissions: other_project_permissions)])
project: other_project,
principal: u,
roles: [create(:role, permissions: other_project_permissions)])
end
end

@ -35,23 +35,23 @@ describe TimeEntries::Scopes::OfUserAndDay, type: :model do
let(:spent_on) { Date.today }
let!(:time_entry) do
create(:time_entry,
user: user,
spent_on: spent_on)
user: user,
spent_on: spent_on)
end
let!(:other_time_entry) do
create(:time_entry,
user: user,
spent_on: spent_on)
user: user,
spent_on: spent_on)
end
let!(:other_user_time_entry) do
create(:time_entry,
user: create(:user),
spent_on: spent_on)
user: create(:user),
spent_on: spent_on)
end
let!(:other_date_time_entry) do
create(:time_entry,
user: user,
spent_on: spent_on - 3.days)
user: user,
spent_on: spent_on - 3.days)
end
describe '.of_user_and_day' do

@ -34,37 +34,37 @@ describe TimeEntries::Scopes::Visible, type: :model do
let(:project) { create(:project) }
let(:user) do
create(:user,
member_in_project: project,
member_with_permissions: permissions)
member_in_project: project,
member_with_permissions: permissions)
end
let(:permissions) { [:view_time_entries] }
let(:work_package) do
create(:work_package,
project: project,
author: user2)
project: project,
author: user2)
end
let(:user2) do
create(:user)
end
let!(:own_project_time_entry) do
create(:time_entry,
project: project,
work_package: work_package,
hours: 2,
user: user)
project: project,
work_package: work_package,
hours: 2,
user: user)
end
let!(:project_time_entry) do
create(:time_entry,
project: project,
work_package: work_package,
hours: 2,
user: user2)
project: project,
work_package: work_package,
hours: 2,
user: user2)
end
let!(:own_other_project_time_entry) do
create(:time_entry,
project: create(:project),
user: user)
project: create(:project),
user: user)
end
describe '.visible' do

@ -56,31 +56,31 @@ describe TimeEntry, type: :model do
let(:hours) { 5.0 }
let(:time_entry) do
create(:time_entry,
project: project,
work_package: work_package,
spent_on: date,
hours: hours,
user: user,
rate: hourly_one,
comments: 'lorem')
project: project,
work_package: work_package,
spent_on: date,
hours: hours,
user: user,
rate: hourly_one,
comments: 'lorem')
end
let(:time_entry2) do
create(:time_entry,
project: project,
work_package: work_package,
spent_on: date,
hours: hours,
user: user,
rate: hourly_one,
comments: 'lorem')
project: project,
work_package: work_package,
spent_on: date,
hours: hours,
user: user,
rate: hourly_one,
comments: 'lorem')
end
def is_member(project, user, permissions)
create(:member,
project: project,
user: user,
roles: [create(:role, permissions: permissions)])
project: project,
user: user,
roles: [create(:role, permissions: permissions)])
end
describe '#hours' do

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save