diff options
| author | Robb Kidd <robb@thekidds.org> | 2012-05-20 14:35:03 -0400 |
|---|---|---|
| committer | Robb Kidd <robb@thekidds.org> | 2012-06-20 14:09:46 -0400 |
| commit | 02924de3e1555bcd89097353ffb7eb552113b42e (patch) | |
| tree | c95cca6ff9727a1b866bb93853164ac76e7a0828 /spec/models/note_spec.rb | |
| parent | 00ec81eacb881fbe0223183737d9c95b801ab01c (diff) | |
| download | gitlab-ce-02924de3e1555bcd89097353ffb7eb552113b42e.tar.gz | |
Add method to Note to create notes about status changes.
Diffstat (limited to 'spec/models/note_spec.rb')
| -rw-r--r-- | spec/models/note_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index c74f7277810..af6ee9b889b 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -70,6 +70,25 @@ describe Note do end end + describe '#create_status_change_note' do + let(:project) { Factory.create(:project) } + let(:thing) { Factory.create(:issue, :project => project) } + let(:author) { Factory(:user) } + let(:status) { 'new_status' } + + subject { Note.create_status_change_note(thing, author, status) } + + it 'creates and saves a Note' do + should be_a Note + subject.id.should_not be_nil + end + + its(:noteable) { should == thing } + its(:project) { should == thing.project } + its(:author) { should == author } + its(:note) { should =~ /Status changed to #{status}/ } + end + describe :authorization do before do @p1 = project |
