2014-04-02 10:38:35 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Issues::CreateService do
|
|
|
|
let(:project) { create(:empty_project) }
|
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
describe :execute do
|
|
|
|
context "valid params" do
|
|
|
|
before do
|
|
|
|
project.team << [user, :master]
|
|
|
|
opts = {
|
|
|
|
title: 'Awesome issue',
|
|
|
|
description: 'please fix'
|
|
|
|
}
|
|
|
|
|
|
|
|
@issue = Issues::CreateService.new(project, user, opts).execute
|
|
|
|
end
|
|
|
|
|
2015-02-12 18:17:35 +00:00
|
|
|
it { expect(@issue).to be_valid }
|
|
|
|
it { expect(@issue.title).to eq('Awesome issue') }
|
2014-04-02 10:38:35 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|