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
diff options
context:
space:
mode:
authorAngus MacArthur <amacarthur@blackberry.com>2013-10-04 23:11:50 +0400
committerAngus MacArthur <amacarthur@blackberry.com>2013-10-16 09:20:53 +0400
commitaefe2e952f33267ce38fb9270400f4f6f194d37b (patch)
tree3546807c2b7942585a41cfb1163dc5e6a69e40e0 /spec/requests/api/notes_spec.rb
parenta8eb525e72f6883a07539af9429ccd41dbc8698b (diff)
Fixing unsafe use of Thread.current variable :current_user
Diffstat (limited to 'spec/requests/api/notes_spec.rb')
-rw-r--r--spec/requests/api/notes_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/requests/api/notes_spec.rb b/spec/requests/api/notes_spec.rb
index ba18b123039..6ed96eb97f3 100644
--- a/spec/requests/api/notes_spec.rb
+++ b/spec/requests/api/notes_spec.rb
@@ -176,4 +176,16 @@ describe API::API do
end
end
end
+
+ describe "POST /projects/:id/noteable/:noteable_id/notes to test observer on create" do
+ before { enable_observers }
+ after { disable_observers }
+
+ it "should create an activity event when an issue note is created" do
+ Event.should_receive(:create)
+
+ post api("/projects/#{project.id}/issues/#{issue.id}/notes", user), body: 'hi!'
+ end
+ end
+
end