Commit 5210778d authored by Douwe Maan's avatar Douwe Maan

Fix specs.

parent 6960e83b
require 'spec_helper' require 'spec_helper'
describe Issues::CloseService do describe Issues::CloseService do
let(:project) { create(:empty_project) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:user2) { create(:user) } let(:user2) { create(:user) }
let(:issue) { create(:issue, assignee: user2) } let(:issue) { create(:issue, assignee: user2) }
let(:project) { issue.project }
before do before do
project.team << [user, :master] project.team << [user, :master]
......
require 'spec_helper' require 'spec_helper'
describe Issues::UpdateService do describe Issues::UpdateService do
let(:project) { create(:empty_project) }
let(:user) { create(:user) } let(:user) { create(:user) }
let(:user2) { create(:user) } let(:user2) { create(:user) }
let(:issue) { create(:issue) } let(:issue) { create(:issue) }
let(:label) { create(:label) } let(:label) { create(:label) }
let(:project) { issue.project }
before do before do
project.team << [user, :master] project.team << [user, :master]
......
...@@ -31,7 +31,8 @@ describe NotificationService do ...@@ -31,7 +31,8 @@ describe NotificationService do
describe 'Notes' do describe 'Notes' do
context 'issue note' do context 'issue note' do
let(:issue) { create(:issue, assignee: create(:user)) } let(:project) { create(:empty_project, :public) }
let(:issue) { create(:issue, project: project, assignee: create(:user)) }
let(:mentioned_issue) { create(:issue, assignee: issue.assignee) } let(:mentioned_issue) { create(:issue, assignee: issue.assignee) }
let(:note) { create(:note_on_issue, noteable: issue, project_id: issue.project_id, note: '@mention referenced') } let(:note) { create(:note_on_issue, noteable: issue, project_id: issue.project_id, note: '@mention referenced') }
...@@ -101,7 +102,8 @@ describe NotificationService do ...@@ -101,7 +102,8 @@ describe NotificationService do
end end
context 'issue note mention' do context 'issue note mention' do
let(:issue) { create(:issue, assignee: create(:user)) } let(:project) { create(:empty_project, :public) }
let(:issue) { create(:issue, project: project, assignee: create(:user)) }
let(:mentioned_issue) { create(:issue, assignee: issue.assignee) } let(:mentioned_issue) { create(:issue, assignee: issue.assignee) }
let(:note) { create(:note_on_issue, noteable: issue, project_id: issue.project_id, note: '@all mentioned') } let(:note) { create(:note_on_issue, noteable: issue, project_id: issue.project_id, note: '@all mentioned') }
...@@ -145,7 +147,8 @@ describe NotificationService do ...@@ -145,7 +147,8 @@ describe NotificationService do
end end
context 'commit note' do context 'commit note' do
let(:note) { create(:note_on_commit) } let(:project) { create(:project, :public) }
let(:note) { create(:note_on_commit, project: project) }
before do before do
build_team(note.project) build_team(note.project)
...@@ -192,7 +195,8 @@ describe NotificationService do ...@@ -192,7 +195,8 @@ describe NotificationService do
end end
describe 'Issues' do describe 'Issues' do
let(:issue) { create :issue, assignee: create(:user), description: 'cc @participant' } let(:project) { create(:empty_project, :public) }
let(:issue) { create :issue, project: project, assignee: create(:user), description: 'cc @participant' }
before do before do
build_team(issue.project) build_team(issue.project)
...@@ -295,7 +299,8 @@ describe NotificationService do ...@@ -295,7 +299,8 @@ describe NotificationService do
end end
describe 'Merge Requests' do describe 'Merge Requests' do
let(:merge_request) { create :merge_request, assignee: create(:user) } let(:project) { create(:project, :public) }
let(:merge_request) { create :merge_request, source_project: project, assignee: create(:user) }
before do before do
build_team(merge_request.target_project) build_team(merge_request.target_project)
......
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