Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-04-02 14:54:41 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-04-02 14:54:41 +0400
commitc4e81ed9de6a5bbfe089e9b61ca0400167e489f3 (patch)
treed1b73c0f36b4f7117108c9f7cfb2b53b4f3e754f /spec
parentcfd9fd30d60c5a880785acda27e9f3d55b17e4ef (diff)
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.rb1
-rw-r--r--spec/services/issues/update_service_spec.rb24
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