diff options
Diffstat (limited to 'spec/models/issue_spec.rb')
-rw-r--r-- | spec/models/issue_spec.rb | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index bf97c6ececd..fa22eee3dea 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Issue, models: true do +describe Issue do describe "Associations" do it { is_expected.to belong_to(:milestone) } it { is_expected.to have_many(:assignees) } @@ -24,7 +24,7 @@ describe Issue, models: true do end describe '#order_by_position_and_priority' do - let(:project) { create :empty_project } + let(:project) { create :project } let(:p1) { create(:label, title: 'P1', project: project, priority: 1) } let(:p2) { create(:label, title: 'P2', project: project, priority: 2) } let!(:issue1) { create(:labeled_issue, project: project, labels: [p1]) } @@ -74,7 +74,7 @@ describe Issue, models: true do describe '#to_reference' do let(:namespace) { build(:namespace, path: 'sample-namespace') } - let(:project) { build(:empty_project, name: 'sample-project', namespace: namespace) } + let(:project) { build(:project, name: 'sample-project', namespace: namespace) } let(:issue) { build(:issue, iid: 1, project: project) } let(:group) { create(:group, name: 'Group', path: 'sample-group') } @@ -99,7 +99,7 @@ describe Issue, models: true do end context 'when cross namespace project argument' do - let(:another_namespace_project) { create(:empty_project, name: 'another-project') } + let(:another_namespace_project) { create(:project, name: 'another-project') } it 'returns complete path to the issue' do expect(issue.to_reference(another_namespace_project)).to eq 'sample-namespace/sample-project#1' @@ -107,12 +107,12 @@ describe Issue, models: true do end it 'supports a cross-project reference' do - another_project = build(:empty_project, name: 'another-project', namespace: project.namespace) + another_project = build(:project, name: 'another-project', namespace: project.namespace) expect(issue.to_reference(another_project)).to eq "sample-project#1" end context 'when same namespace / cross-project argument' do - let(:another_project) { create(:empty_project, namespace: namespace) } + let(:another_project) { create(:project, namespace: namespace) } it 'returns path to the issue with the project name' do expect(issue.to_reference(another_project)).to eq 'sample-project#1' @@ -121,7 +121,7 @@ describe Issue, models: true do context 'when different namespace / cross-project argument' do let(:another_namespace) { create(:namespace, path: 'another-namespace') } - let(:another_project) { create(:empty_project, path: 'another-project', namespace: another_namespace) } + let(:another_project) { create(:project, path: 'another-project', namespace: another_namespace) } it 'returns full path to the issue' do expect(issue.to_reference(another_project)).to eq 'sample-namespace/sample-project#1' @@ -209,7 +209,7 @@ describe Issue, models: true do describe '#referenced_merge_requests' do it 'returns the referenced merge requests' do - project = create(:empty_project, :public) + project = create(:project, :public) mr1 = create(:merge_request, source_project: project, @@ -242,7 +242,7 @@ describe Issue, models: true do end context 'user is reporter in project issue belongs to' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } before do @@ -258,7 +258,7 @@ describe Issue, models: true do context 'checking destination project also' do subject { issue.can_move?(user, to_project) } - let(:to_project) { create(:empty_project) } + let(:to_project) { create(:project) } context 'destination project allowed' do before do @@ -380,7 +380,7 @@ describe Issue, models: true do describe '#participants' do context 'using a public project' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project) } let!(:note1) do @@ -402,7 +402,7 @@ describe Issue, models: true do context 'using a private project' do it 'does not include mentioned users that do not have access to the project' do - project = create(:empty_project) + project = create(:project) user = create(:user) issue = create(:issue, project: project) @@ -420,7 +420,7 @@ describe Issue, models: true do it 'updates when assignees change' do user1 = create(:user) user2 = create(:user) - project = create(:empty_project) + project = create(:project) issue = create(:issue, assignees: [user1], project: project) project.add_developer(user1) project.add_developer(user2) @@ -490,7 +490,7 @@ describe Issue, models: true do let(:user) { create(:user) } context 'using a public project' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } it 'returns true for a regular issue' do issue = build(:issue, project: project) @@ -506,7 +506,7 @@ describe Issue, models: true do end context 'using an internal project' do - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } context 'using an internal user' do it 'returns true for a regular issue' do @@ -542,7 +542,7 @@ describe Issue, models: true do end context 'using a private project' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } it 'returns false for a regular issue' do issue = build(:issue, project: project) @@ -578,7 +578,7 @@ describe Issue, models: true do context 'with a regular user that is a team member' do let(:user) { create(:user) } - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } context 'using a public project' do before do @@ -599,7 +599,7 @@ describe Issue, models: true do end context 'using an internal project' do - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } before do project.team << [user, Gitlab::Access::DEVELOPER] @@ -619,7 +619,7 @@ describe Issue, models: true do end context 'using a private project' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } before do project.team << [user, Gitlab::Access::DEVELOPER] @@ -640,7 +640,7 @@ describe Issue, models: true do end context 'with an admin user' do - let(:project) { create(:empty_project) } + let(:project) { create(:project) } let(:user) { create(:admin) } it 'returns true for a regular issue' do @@ -659,7 +659,7 @@ describe Issue, models: true do describe '#publicly_visible?' do context 'using a public project' do - let(:project) { create(:empty_project, :public) } + let(:project) { create(:project, :public) } it 'returns true for a regular issue' do issue = build(:issue, project: project) @@ -675,7 +675,7 @@ describe Issue, models: true do end context 'using an internal project' do - let(:project) { create(:empty_project, :internal) } + let(:project) { create(:project, :internal) } it 'returns false for a regular issue' do issue = build(:issue, project: project) @@ -691,7 +691,7 @@ describe Issue, models: true do end context 'using a private project' do - let(:project) { create(:empty_project, :private) } + let(:project) { create(:project, :private) } it 'returns false for a regular issue' do issue = build(:issue, project: project) |