diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-04-02 13:54:41 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-04-02 13:54:41 +0300 |
commit | c4e81ed9de6a5bbfe089e9b61ca0400167e489f3 (patch) | |
tree | d1b73c0f36b4f7117108c9f7cfb2b53b4f3e754f /spec | |
parent | cfd9fd30d60c5a880785acda27e9f3d55b17e4ef (diff) | |
download | gitlab-ce-c4e81ed9de6a5bbfe089e9b61ca0400167e489f3.tar.gz |
Move update issue code to separate service
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/issues/create_service_spec.rb | 1 | ||||
-rw-r--r-- | spec/services/issues/update_service_spec.rb | 24 |
2 files changed, 25 insertions, 0 deletions
diff --git a/spec/services/issues/create_service_spec.rb b/spec/services/issues/create_service_spec.rb index 7e2d5ad2e81..90720be5ded 100644 --- a/spec/services/issues/create_service_spec.rb +++ b/spec/services/issues/create_service_spec.rb @@ -17,6 +17,7 @@ describe Issues::CreateService do end it { @issue.should be_valid } + it { @issue.title.should == 'Awesome issue' } end end end diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb new file mode 100644 index 00000000000..9bfc0f674de --- /dev/null +++ b/spec/services/issues/update_service_spec.rb @@ -0,0 +1,24 @@ +require 'spec_helper' + +describe Issues::UpdateService do + let(:project) { create(:empty_project) } + let(:user) { create(:user) } + let(:issue) { create(:issue) } + + describe :execute do + context "valid params" do + before do + project.team << [user, :master] + opts = { + title: 'New title', + description: 'Also please fix' + } + + @issue = Issues::UpdateService.new(project, user, opts).execute(issue) + end + + it { @issue.should be_valid } + it { @issue.title.should == 'New title' } + end + end +end |