Fix specs.

This commit is contained in:
Douwe Maan 2015-05-15 15:38:05 +02:00
parent 6960e83b1e
commit 5210778d6e
3 changed files with 12 additions and 7 deletions

View file

@ -1,10 +1,10 @@
require 'spec_helper'
describe Issues::CloseService do
let(:project) { create(:empty_project) }
let(:user) { create(:user) }
let(:user2) { create(:user) }
let(:issue) { create(:issue, assignee: user2) }
let(:project) { issue.project }
before do
project.team << [user, :master]

View file

@ -1,11 +1,11 @@
require 'spec_helper'
describe Issues::UpdateService do
let(:project) { create(:empty_project) }
let(:user) { create(:user) }
let(:user2) { create(:user) }
let(:issue) { create(:issue) }
let(:label) { create(:label) }
let(:project) { issue.project }
before do
project.team << [user, :master]

View file

@ -31,7 +31,8 @@ describe NotificationService do
describe 'Notes' 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(:note) { create(:note_on_issue, noteable: issue, project_id: issue.project_id, note: '@mention referenced') }
@ -101,7 +102,8 @@ describe NotificationService do
end
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(:note) { create(:note_on_issue, noteable: issue, project_id: issue.project_id, note: '@all mentioned') }
@ -145,7 +147,8 @@ describe NotificationService do
end
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
build_team(note.project)
@ -192,7 +195,8 @@ describe NotificationService do
end
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
build_team(issue.project)
@ -295,7 +299,8 @@ describe NotificationService do
end
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
build_team(merge_request.target_project)