diff --git a/spec/controllers/my_projects_overview_controller_spec.rb b/spec/controllers/my_projects_overview_controller_spec.rb index fad572831c..b854dd184c 100644 --- a/spec/controllers/my_projects_overview_controller_spec.rb +++ b/spec/controllers/my_projects_overview_controller_spec.rb @@ -21,8 +21,8 @@ require File.dirname(__FILE__) + '/../spec_helper' describe MyProjectsOverviewsController, type: :controller do - let(:admin) { FactoryGirl.build_stubbed(:admin) } - let(:project) { FactoryGirl.build_stubbed(:project) } + let(:admin) { FactoryBot.build_stubbed(:admin) } + let(:project) { FactoryBot.build_stubbed(:project) } let(:overview) { double(MyProjectsOverview) } let(:custom_block) { %w(a title content) } diff --git a/spec/factories/my_projects_overview_factory.rb b/spec/factories/my_projects_overview_factory.rb index 47064bec30..ba908777e9 100644 --- a/spec/factories/my_projects_overview_factory.rb +++ b/spec/factories/my_projects_overview_factory.rb @@ -26,7 +26,7 @@ # See doc/COPYRIGHT.rdoc for more details. #++ -FactoryGirl.define do +FactoryBot.define do factory :my_projects_overview do project end diff --git a/spec/features/block_editing_spec.rb b/spec/features/block_editing_spec.rb index d4c59dd40d..888cdef26c 100644 --- a/spec/features/block_editing_spec.rb +++ b/spec/features/block_editing_spec.rb @@ -29,16 +29,16 @@ require File.dirname(__FILE__) + '/../spec_helper' describe 'My project page editing', type: :feature, js: true do - let(:project) { FactoryGirl.create :project } - let(:overview) { FactoryGirl.create :my_projects_overview, project: project } + let(:project) { FactoryBot.create :project } + let(:overview) { FactoryBot.create :my_projects_overview, project: project } let(:mypage) { ::Pages::Page.new } let(:button_selector) { '.toolbar a.button' } - let(:user) { FactoryGirl.create :user, + let(:user) { FactoryBot.create :user, member_in_project: project, member_through_role: role } - let(:role) { FactoryGirl.create :role, permissions: [:view_project, + let(:role) { FactoryBot.create :role, permissions: [:view_project, :edit_project] } # Add block select @@ -195,8 +195,8 @@ describe 'My project page editing', type: :feature, js: true do context 'as regular user' do let(:permissions) { %i(view_project) } - let(:role) { FactoryGirl.create :role, permissions: permissions } - let(:user) { FactoryGirl.create(:user, member_in_project: project, member_through_role: role) } + let(:role) { FactoryBot.create :role, permissions: permissions } + let(:user) { FactoryBot.create(:user, member_in_project: project, member_through_role: role) } it 'shows a 403 error' do expect(page).to have_selector('h2', text: '403') diff --git a/spec/features/project_overview_spec.rb b/spec/features/project_overview_spec.rb index 7ce395b1a5..5f2bd7cc38 100644 --- a/spec/features/project_overview_spec.rb +++ b/spec/features/project_overview_spec.rb @@ -29,8 +29,8 @@ require File.dirname(__FILE__) + '/../spec_helper' describe 'My project page overview', type: :feature do - let(:project) { FactoryGirl.create :project } - let(:overview) { FactoryGirl.create :my_projects_overview, project: project } + let(:project) { FactoryBot.create :project } + let(:overview) { FactoryBot.create :my_projects_overview, project: project } let(:button_selector) { '#my-project-page-layout' } @@ -43,7 +43,7 @@ describe 'My project page overview', type: :feature do end context 'as admin' do - let(:user) { FactoryGirl.create :admin } + let(:user) { FactoryBot.create :admin } it 'shows the default blocks and edit button' do expect(page).to have_selector('.widget-box', count: 5) @@ -53,8 +53,8 @@ describe 'My project page overview', type: :feature do context 'as regular user' do let(:permissions) { %i(view_project) } - let(:role) { FactoryGirl.create :role, permissions: permissions } - let(:user) { FactoryGirl.create(:user, member_in_project: project, member_through_role: role) } + let(:role) { FactoryBot.create :role, permissions: permissions } + let(:user) { FactoryBot.create(:user, member_in_project: project, member_through_role: role) } it 'shows the default blocks, but no editing' do expect(page).to have_selector('.widget-box', count: 5) diff --git a/spec/models/my_projects_overview_spec.rb b/spec/models/my_projects_overview_spec.rb index 88345af7af..be67faaaf1 100644 --- a/spec/models/my_projects_overview_spec.rb +++ b/spec/models/my_projects_overview_spec.rb @@ -22,7 +22,7 @@ require File.dirname(__FILE__) + '/../spec_helper' describe MyProjectsOverview, type: :model do let(:enabled_modules) { %w[activity work_package_tracking news wiki] } - let(:project) { FactoryGirl.create(:project, enabled_module_names: @enabled_module_names) } + let(:project) { FactoryBot.create(:project, enabled_module_names: @enabled_module_names) } subject { MyProjectsOverview.new(project_id: project.id) }