Skip to content
Snippets Groups Projects
Commit b79e0088 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Uncommented test observing comment event

parent 0ff46816
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -14,7 +14,7 @@
 
class Milestone < ActiveRecord::Base
attr_accessible :title, :description, :due_date, :closed, :author_id_of_changes
attr_accessor :author_id, :author_id_of_changes
attr_accessor :author_id_of_changes
 
belongs_to :project
has_many :issues
Loading
Loading
@@ -68,4 +68,8 @@ class Milestone < ActiveRecord::Base
def open?
!closed
end
def author_id
author_id_of_changes
end
end
Loading
Loading
@@ -2,7 +2,7 @@ class ActivityObserver < ActiveRecord::Observer
observe :issue, :merge_request, :note, :milestone
 
def after_create(record)
event_author_id = record.author_id || record.author_id_of_changes
event_author_id = record.author_id
 
# Skip status notes
if record.kind_of?(Note) && record.note.include?("_Status changed to ")
Loading
Loading
Loading
Loading
@@ -34,15 +34,17 @@ describe ActivityObserver do
it { @event.target.should == @issue }
end
 
#describe "Issue commented" do
#before do
#@issue = create(:issue, project: project)
#@note = create(:note, noteable: @issue, project: project)
#@event = Event.last
#end
#it_should_be_valid_event
#it { @event.action.should == Event::Commented }
#it { @event.target.should == @note }
#end
describe "Issue commented" do
before do
Note.observers.enable :activity_observer do
@issue = create(:issue, project: project)
@note = create(:note, noteable: @issue, project: project, author: @issue.author)
@event = Event.last
end
end
it_should_be_valid_event
it { @event.action.should == Event::Commented }
it { @event.target.should == @note }
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment