Commit ceac76ef authored by Vitali Tatarintev's avatar Vitali Tatarintev Committed by Peter Leitzen

Replace set to let_it_be in spec/features

Get rids of set in spec/features
parent b191b3aa
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
describe "Admin Health Check", :feature do describe "Admin Health Check", :feature do
include StubENV include StubENV
set(:admin) { create(:admin) } let_it_be(:admin) { create(:admin) }
before do before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
require 'spec_helper' require 'spec_helper'
describe 'Multiple Issue Boards', :js do describe 'Multiple Issue Boards', :js do
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
set(:project) { create(:project, :public) } let_it_be(:project) { create(:project, :public) }
set(:planning) { create(:label, project: project, name: 'Planning') } let_it_be(:planning) { create(:label, project: project, name: 'Planning') }
set(:board) { create(:board, name: 'board1', project: project) } let_it_be(:board) { create(:board, name: 'board1', project: project) }
set(:board2) { create(:board, name: 'board2', project: project) } let_it_be(:board2) { create(:board, name: 'board2', project: project) }
let(:parent) { project } let(:parent) { project }
let(:boards_path) { project_boards_path(project) } let(:boards_path) { project_boards_path(project) }
......
...@@ -129,10 +129,10 @@ describe 'Issue Boards new issue', :js do ...@@ -129,10 +129,10 @@ describe 'Issue Boards new issue', :js do
end end
context 'group boards' do context 'group boards' do
set(:group) { create(:group, :public) } let_it_be(:group) { create(:group, :public) }
set(:project) { create(:project, namespace: group) } let_it_be(:project) { create(:project, namespace: group) }
set(:group_board) { create(:board, group: group) } let_it_be(:group_board) { create(:board, group: group) }
set(:list) { create(:list, board: group_board, position: 0) } let_it_be(:list) { create(:list, board: group_board, position: 0) }
context 'for unauthorized users' do context 'for unauthorized users' do
before do before do
......
...@@ -3,17 +3,17 @@ ...@@ -3,17 +3,17 @@
require 'spec_helper' require 'spec_helper'
describe 'Root explore' do describe 'Root explore' do
set(:public_project) { create(:project, :public) } let_it_be(:public_project) { create(:project, :public) }
set(:archived_project) { create(:project, :archived) } let_it_be(:archived_project) { create(:project, :archived) }
set(:internal_project) { create(:project, :internal) } let_it_be(:internal_project) { create(:project, :internal) }
set(:private_project) { create(:project, :private) } let_it_be(:private_project) { create(:project, :private) }
before do before do
allow(Gitlab).to receive(:com?).and_return(true) allow(Gitlab).to receive(:com?).and_return(true)
end end
context 'when logged in' do context 'when logged in' do
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
before do before do
sign_in(user) sign_in(user)
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
require 'spec_helper' require 'spec_helper'
describe 'User explores projects' do describe 'User explores projects' do
set(:archived_project) { create(:project, :archived) } let_it_be(:archived_project) { create(:project, :archived) }
set(:internal_project) { create(:project, :internal) } let_it_be(:internal_project) { create(:project, :internal) }
set(:private_project) { create(:project, :private) } let_it_be(:private_project) { create(:project, :private) }
set(:public_project) { create(:project, :public) } let_it_be(:public_project) { create(:project, :public) }
context 'when not signed in' do context 'when not signed in' do
context 'when viewing public projects' do context 'when viewing public projects' do
...@@ -19,7 +19,7 @@ describe 'User explores projects' do ...@@ -19,7 +19,7 @@ describe 'User explores projects' do
end end
context 'when signed in' do context 'when signed in' do
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
before do before do
sign_in(user) sign_in(user)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe 'Groups > Labels > User sees links to issuables' do describe 'Groups > Labels > User sees links to issuables' do
set(:group) { create(:group, :public) } let_it_be(:group) { create(:group, :public) }
before do before do
create(:group_label, group: group, title: 'bug') create(:group_label, group: group, title: 'bug')
......
...@@ -7,7 +7,7 @@ describe "User views issues" do ...@@ -7,7 +7,7 @@ describe "User views issues" do
let!(:open_issue1) { create(:issue, project: project) } let!(:open_issue1) { create(:issue, project: project) }
let!(:open_issue2) { create(:issue, project: project) } let!(:open_issue2) { create(:issue, project: project) }
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
shared_examples "opens issue from list" do shared_examples "opens issue from list" do
it "opens issue" do it "opens issue" do
......
...@@ -5,8 +5,7 @@ require 'spec_helper' ...@@ -5,8 +5,7 @@ require 'spec_helper'
describe 'Merge request > User posts notes', :js do describe 'Merge request > User posts notes', :js do
include NoteInteractionHelpers include NoteInteractionHelpers
set(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let(:user) { project.creator } let(:user) { project.creator }
let(:merge_request) do let(:merge_request) do
create(:merge_request, source_project: project, target_project: project) create(:merge_request, source_project: project, target_project: project)
......
...@@ -10,10 +10,10 @@ describe 'User sorts merge requests' do ...@@ -10,10 +10,10 @@ describe 'User sorts merge requests' do
create(:merge_request_with_diffs, source_project: project, target_project: project, source_branch: 'merge-test') create(:merge_request_with_diffs, source_project: project, target_project: project, source_branch: 'merge-test')
end end
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
set(:group) { create(:group) } let_it_be(:group) { create(:group) }
set(:group_member) { create(:group_member, :maintainer, user: user, group: group) } let_it_be(:group_member) { create(:group_member, :maintainer, user: user, group: group) }
set(:project) { create(:project, :public, group: group) } let_it_be(:project) { create(:project, :public, group: group) }
before do before do
sign_in(user) sign_in(user)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe 'User views open merge requests' do describe 'User views open merge requests' do
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
shared_examples_for 'shows merge requests' do shared_examples_for 'shows merge requests' do
it 'shows merge requests' do it 'shows merge requests' do
...@@ -12,7 +12,7 @@ describe 'User views open merge requests' do ...@@ -12,7 +12,7 @@ describe 'User views open merge requests' do
end end
context 'when project is public' do context 'when project is public' do
set(:project) { create(:project, :public, :repository) } let_it_be(:project) { create(:project, :public, :repository) }
context 'when not signed in' do context 'when not signed in' do
context "when the target branch is the project's default branch" do context "when the target branch is the project's default branch" do
...@@ -114,7 +114,7 @@ describe 'User views open merge requests' do ...@@ -114,7 +114,7 @@ describe 'User views open merge requests' do
context 'when project is internal' do context 'when project is internal' do
let!(:merge_request) { create(:merge_request, source_project: project, target_project: project) } let!(:merge_request) { create(:merge_request, source_project: project, target_project: project) }
set(:project) { create(:project, :internal, :repository) } let_it_be(:project) { create(:project, :internal, :repository) }
context 'when signed in' do context 'when signed in' do
before do before do
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
require 'spec_helper' require 'spec_helper'
describe "User creates milestone", :js do describe "User creates milestone", :js do
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
set(:project) { create(:project) } let_it_be(:project) { create(:project) }
before do before do
project.add_developer(user) project.add_developer(user)
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
require 'spec_helper' require 'spec_helper'
describe "User edits milestone", :js do describe "User edits milestone", :js do
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
set(:project) { create(:project) } let_it_be(:project) { create(:project) }
set(:milestone) { create(:milestone, project: project, start_date: Date.today, due_date: 5.days.from_now) } let_it_be(:milestone) { create(:milestone, project: project, start_date: Date.today, due_date: 5.days.from_now) }
before do before do
project.add_developer(user) project.add_developer(user)
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
require 'spec_helper' require 'spec_helper'
describe 'User promotes milestone' do describe 'User promotes milestone' do
set(:group) { create(:group) } let_it_be(:group) { create(:group) }
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
set(:project) { create(:project, namespace: group) } let_it_be(:project) { create(:project, namespace: group) }
set(:milestone) { create(:milestone, project: project) } let_it_be(:milestone) { create(:milestone, project: project) }
context 'when user can admin group milestones' do context 'when user can admin group milestones' do
before do before do
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
require 'spec_helper' require 'spec_helper'
describe "User views milestone" do describe "User views milestone" do
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
set(:project) { create(:project) } let_it_be(:project) { create(:project) }
set(:milestone) { create(:milestone, project: project) } let_it_be(:milestone) { create(:milestone, project: project) }
set(:labels) { create_list(:label, 2, project: project) } let_it_be(:labels) { create_list(:label, 2, project: project) }
before do before do
project.add_developer(user) project.add_developer(user)
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
require 'spec_helper' require 'spec_helper'
describe "User views milestones" do describe "User views milestones" do
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
set(:project) { create(:project) } let_it_be(:project) { create(:project) }
set(:milestone) { create(:milestone, project: project) } let_it_be(:milestone) { create(:milestone, project: project) }
before do before do
project.add_developer(user) project.add_developer(user)
...@@ -22,8 +22,8 @@ describe "User views milestones" do ...@@ -22,8 +22,8 @@ describe "User views milestones" do
end end
context "with issues" do context "with issues" do
set(:issue) { create(:issue, project: project, milestone: milestone) } let_it_be(:issue) { create(:issue, project: project, milestone: milestone) }
set(:closed_issue) { create(:closed_issue, project: project, milestone: milestone) } let_it_be(:closed_issue) { create(:closed_issue, project: project, milestone: milestone) }
it "opens milestone" do it "opens milestone" do
click_link(milestone.title) click_link(milestone.title)
...@@ -38,7 +38,7 @@ describe "User views milestones" do ...@@ -38,7 +38,7 @@ describe "User views milestones" do
end end
context "with associated releases" do context "with associated releases" do
set(:first_release) { create(:release, project: project, name: "The first release", milestones: [milestone], released_at: Time.zone.parse('2019-10-07')) } let_it_be(:first_release) { create(:release, project: project, name: "The first release", milestones: [milestone], released_at: Time.zone.parse('2019-10-07')) }
context "with a single associated release" do context "with a single associated release" do
it "shows the associated release" do it "shows the associated release" do
...@@ -48,10 +48,10 @@ describe "User views milestones" do ...@@ -48,10 +48,10 @@ describe "User views milestones" do
end end
context "with lots of associated releases" do context "with lots of associated releases" do
set(:second_release) { create(:release, project: project, name: "The second release", milestones: [milestone], released_at: first_release.released_at + 1.day) } let_it_be(:second_release) { create(:release, project: project, name: "The second release", milestones: [milestone], released_at: first_release.released_at + 1.day) }
set(:third_release) { create(:release, project: project, name: "The third release", milestones: [milestone], released_at: second_release.released_at + 1.day) } let_it_be(:third_release) { create(:release, project: project, name: "The third release", milestones: [milestone], released_at: second_release.released_at + 1.day) }
set(:fourth_release) { create(:release, project: project, name: "The fourth release", milestones: [milestone], released_at: third_release.released_at + 1.day) } let_it_be(:fourth_release) { create(:release, project: project, name: "The fourth release", milestones: [milestone], released_at: third_release.released_at + 1.day) }
set(:fifth_release) { create(:release, project: project, name: "The fifth release", milestones: [milestone], released_at: fourth_release.released_at + 1.day) } let_it_be(:fifth_release) { create(:release, project: project, name: "The fifth release", milestones: [milestone], released_at: fourth_release.released_at + 1.day) }
it "shows the associated releases and the truncation text" do it "shows the associated releases and the truncation text" do
expect(page).to have_content("Releases #{fifth_release.name}#{fourth_release.name}#{third_release.name} • 2 more releases") expect(page).to have_content("Releases #{fifth_release.name}#{fourth_release.name}#{third_release.name} • 2 more releases")
...@@ -66,9 +66,9 @@ describe "User views milestones" do ...@@ -66,9 +66,9 @@ describe "User views milestones" do
end end
describe "User views milestones with no MR" do describe "User views milestones with no MR" do
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
set(:project) { create(:project, :merge_requests_disabled) } let_it_be(:project) { create(:project, :merge_requests_disabled) }
set(:milestone) { create(:milestone, project: project) } let_it_be(:milestone) { create(:milestone, project: project) }
before do before do
project.add_developer(user) project.add_developer(user)
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
require "spec_helper" require "spec_helper"
describe "User downloads artifacts" do describe "User downloads artifacts" do
set(:project) { create(:project, :repository, :public) } let_it_be(:project) { create(:project, :repository, :public) }
set(:pipeline) { create(:ci_empty_pipeline, status: :success, sha: project.commit.id, project: project) } let_it_be(:pipeline) { create(:ci_empty_pipeline, status: :success, sha: project.commit.id, project: project) }
set(:job) { create(:ci_build, :artifacts, :success, pipeline: pipeline) } let_it_be(:job) { create(:ci_build, :artifacts, :success, pipeline: pipeline) }
shared_examples "downloading" do shared_examples "downloading" do
it "downloads the zip" do it "downloads the zip" do
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe 'Pipeline Badge' do describe 'Pipeline Badge' do
set(:project) { create(:project, :repository, :public) } let_it_be(:project) { create(:project, :repository, :public) }
let(:ref) { project.default_branch } let(:ref) { project.default_branch }
context 'when the project has a pipeline' do context 'when the project has a pipeline' do
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require "spec_helper" require "spec_helper"
describe "User deletes branch", :js do describe "User deletes branch", :js do
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
before do before do
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
require "spec_helper" require "spec_helper"
describe "User views branches" do describe "User views branches" do
set(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
set(:user) { project.owner } let_it_be(:user) { project.owner }
before do before do
sign_in(user) sign_in(user)
...@@ -23,7 +23,7 @@ describe "User views branches" do ...@@ -23,7 +23,7 @@ describe "User views branches" do
end end
context "protected branches" do context "protected branches" do
set(:protected_branch) { create(:protected_branch, project: project) } let_it_be(:protected_branch) { create(:protected_branch, project: project) }
before do before do
visit(project_protected_branches_path(project)) visit(project_protected_branches_path(project))
......
...@@ -5,8 +5,8 @@ require 'spec_helper' ...@@ -5,8 +5,8 @@ require 'spec_helper'
describe 'Project > Commit > View user status' do describe 'Project > Commit > View user status' do
include RepoHelpers include RepoHelpers
set(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
let(:commit_author) { create(:user, email: sample_commit.author_email) } let(:commit_author) { create(:user, email: sample_commit.author_email) }
before do before do
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
require "spec_helper" require "spec_helper"
describe "User creates labels" do describe "User creates labels" do
set(:project) { create(:project_empty_repo, :public) } let_it_be(:project) { create(:project_empty_repo, :public) }
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
shared_examples_for "label creation" do shared_examples_for "label creation" do
it "creates new label" do it "creates new label" do
...@@ -66,7 +66,7 @@ describe "User creates labels" do ...@@ -66,7 +66,7 @@ describe "User creates labels" do
end end
context "in another project" do context "in another project" do
set(:another_project) { create(:project_empty_repo, :public) } let_it_be(:another_project) { create(:project_empty_repo, :public) }
before do before do
create(:label, project: project, title: "bug") # Create label for `project` (not `another_project`) project. create(:label, project: project, title: "bug") # Create label for `project` (not `another_project`) project.
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
require "spec_helper" require "spec_helper"
describe "User edits labels" do describe "User edits labels" do
set(:project) { create(:project_empty_repo, :public) } let_it_be(:project) { create(:project_empty_repo, :public) }
set(:label) { create(:label, project: project) } let_it_be(:label) { create(:label, project: project) }
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
before do before do
project.add_maintainer(user) project.add_maintainer(user)
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
require 'spec_helper' require 'spec_helper'
describe 'User promotes label' do describe 'User promotes label' do
set(:group) { create(:group) } let_it_be(:group) { create(:group) }
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
set(:project) { create(:project, namespace: group) } let_it_be(:project) { create(:project, namespace: group) }
set(:label) { create(:label, project: project) } let_it_be(:label) { create(:label, project: project) }
context 'when user can admin group labels' do context 'when user can admin group labels' do
before do before do
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe 'Projects > Labels > User sees links to issuables' do describe 'Projects > Labels > User sees links to issuables' do
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
before do before do
label # creates the label label # creates the label
...@@ -50,7 +50,7 @@ describe 'Projects > Labels > User sees links to issuables' do ...@@ -50,7 +50,7 @@ describe 'Projects > Labels > User sees links to issuables' do
end end
context 'with a group label' do context 'with a group label' do
set(:group) { create(:group) } let_it_be(:group) { create(:group) }
let(:label) { create(:group_label, group: group, title: 'bug') } let(:label) { create(:group_label, group: group, title: 'bug') }
context 'when merge requests and issues are enabled for the project' do context 'when merge requests and issues are enabled for the project' do
......
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
require "spec_helper" require "spec_helper"
describe "User views labels" do describe "User views labels" do
set(:project) { create(:project_empty_repo, :public) } let_it_be(:project) { create(:project_empty_repo, :public) }
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
let(:label_titles) { %w[bug enhancement feature] } let(:label_titles) { %w[bug enhancement feature] }
let!(:prioritized_label) { create(:label, project: project, title: 'prioritized-label-name', priority: 1) } let!(:prioritized_label) { create(:label, project: project, title: 'prioritized-label-name', priority: 1) }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe 'Projects settings' do describe 'Projects settings' do
set(:project) { create(:project) } let_it_be(:project) { create(:project) }
let(:user) { project.owner } let(:user) { project.owner }
let(:panel) { find('.general-settings', match: :first) } let(:panel) { find('.general-settings', match: :first) }
let(:button) { panel.find('.btn.js-settings-toggle') } let(:button) { panel.find('.btn.js-settings-toggle') }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe 'Projects > Show > User sees Git instructions' do describe 'Projects > Show > User sees Git instructions' do
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
shared_examples_for 'redirects to the sign in page' do shared_examples_for 'redirects to the sign in page' do
it 'redirects to the sign in page' do it 'redirects to the sign in page' do
...@@ -49,7 +49,7 @@ describe 'Projects > Show > User sees Git instructions' do ...@@ -49,7 +49,7 @@ describe 'Projects > Show > User sees Git instructions' do
context 'when project is public' do context 'when project is public' do
context 'when project has no repo' do context 'when project has no repo' do
set(:project) { create(:project, :public) } let_it_be(:project) { create(:project, :public) }
before do before do
sign_in(project.owner) sign_in(project.owner)
...@@ -60,7 +60,7 @@ describe 'Projects > Show > User sees Git instructions' do ...@@ -60,7 +60,7 @@ describe 'Projects > Show > User sees Git instructions' do
end end
context 'when project is empty' do context 'when project is empty' do
set(:project) { create(:project_empty_repo, :public) } let_it_be(:project) { create(:project_empty_repo, :public) }
context 'when not signed in' do context 'when not signed in' do
before do before do
...@@ -98,7 +98,7 @@ describe 'Projects > Show > User sees Git instructions' do ...@@ -98,7 +98,7 @@ describe 'Projects > Show > User sees Git instructions' do
end end
context 'when project is not empty' do context 'when project is not empty' do
set(:project) { create(:project, :public, :repository) } let_it_be(:project) { create(:project, :public, :repository) }
before do before do
visit(project_path(project)) visit(project_path(project))
...@@ -141,7 +141,7 @@ describe 'Projects > Show > User sees Git instructions' do ...@@ -141,7 +141,7 @@ describe 'Projects > Show > User sees Git instructions' do
end end
context 'when project is internal' do context 'when project is internal' do
set(:project) { create(:project, :internal, :repository) } let_it_be(:project) { create(:project, :internal, :repository) }
context 'when not signed in' do context 'when not signed in' do
before do before do
...@@ -163,7 +163,7 @@ describe 'Projects > Show > User sees Git instructions' do ...@@ -163,7 +163,7 @@ describe 'Projects > Show > User sees Git instructions' do
end end
context 'when project is private' do context 'when project is private' do
set(:project) { create(:project, :private) } let_it_be(:project) { create(:project, :private) }
before do before do
visit(project_path(project)) visit(project_path(project))
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe 'Projects > Show > User sees last commit CI status' do describe 'Projects > Show > User sees last commit CI status' do
set(:project) { create(:project, :repository, :public) } let_it_be(:project) { create(:project, :repository, :public) }
it 'shows the project README', :js do it 'shows the project README', :js do
project.enable_ci project.enable_ci
......
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
require 'spec_helper' require 'spec_helper'
describe 'Projects > Show > User sees README' do describe 'Projects > Show > User sees README' do
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project, :repository, :public) }
set(:project) { create(:project, :repository, :public) }
it 'shows the project README', :js do it 'shows the project README', :js do
visit project_path(project) visit project_path(project)
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe 'User sees user popover', :js do describe 'User sees user popover', :js do
set(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let(:user) { project.creator } let(:user) { project.creator }
let(:merge_request) do let(:merge_request) do
create(:merge_request, source_project: project, target_project: project) create(:merge_request, source_project: project, target_project: project)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe 'Projects > Wiki > User previews markdown changes', :js do describe 'Projects > Wiki > User previews markdown changes', :js do
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
let(:project) { create(:project, :wiki_repo, namespace: user.namespace) } let(:project) { create(:project, :wiki_repo, namespace: user.namespace) }
let(:wiki_page) { create(:wiki_page, wiki: project.wiki, attrs: { title: 'home', content: '[some link](other-page)' }) } let(:wiki_page) { create(:wiki_page, wiki: project.wiki, attrs: { title: 'home', content: '[some link](other-page)' }) }
let(:wiki_content) do let(:wiki_content) do
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
describe 'read-only message' do describe 'read-only message' do
set(:user) { create(:user) } let_it_be(:user) { create(:user) }
before do before do
sign_in(user) sign_in(user)
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
describe "Internal Project Access" do describe "Internal Project Access" do
include AccessMatchers include AccessMatchers
set(:project) { create(:project, :internal, :repository) } let_it_be(:project, reload: true) { create(:project, :internal, :repository) }
describe "Project should be internal" do describe "Project should be internal" do
describe '#internal?' do describe '#internal?' do
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
describe "Private Project Access" do describe "Private Project Access" do
include AccessMatchers include AccessMatchers
set(:project) { create(:project, :private, :repository, public_builds: false) } let_it_be(:project, reload: true) { create(:project, :private, :repository, public_builds: false) }
describe "Project should be private" do describe "Project should be private" do
describe '#private?' do describe '#private?' do
......
...@@ -5,7 +5,7 @@ require 'spec_helper' ...@@ -5,7 +5,7 @@ require 'spec_helper'
describe "Public Project Access" do describe "Public Project Access" do
include AccessMatchers include AccessMatchers
set(:project) { create(:project, :public, :repository) } let_it_be(:project, reload: true) { create(:project, :public, :repository) }
describe "Project should be public" do describe "Project should be public" do
describe '#public?' do describe '#public?' do
......
...@@ -10,10 +10,10 @@ describe "User sorts things" do ...@@ -10,10 +10,10 @@ describe "User sorts things" do
include Spec::Support::Helpers::Features::SortingHelpers include Spec::Support::Helpers::Features::SortingHelpers
include DashboardHelper include DashboardHelper
set(:project) { create(:project_empty_repo, :public) } let_it_be(:project) { create(:project_empty_repo, :public) }
set(:current_user) { create(:user) } # Using `current_user` instead of just `user` because of the hardoced call in `assigned_mrs_dashboard_path` which is used below. let_it_be(:current_user) { create(:user) } # Using `current_user` instead of just `user` because of the hardoced call in `assigned_mrs_dashboard_path` which is used below.
set(:issue) { create(:issue, project: project, author: current_user) } let_it_be(:issue) { create(:issue, project: project, author: current_user) }
set(:merge_request) { create(:merge_request, target_project: project, source_project: project, author: current_user) } let_it_be(:merge_request) { create(:merge_request, target_project: project, source_project: project, author: current_user) }
before do before do
project.add_developer(current_user) project.add_developer(current_user)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment