diff options
| author | Robb Kidd <robb@thekidds.org> | 2012-05-21 13:30:53 -0400 |
|---|---|---|
| committer | Robb Kidd <robb@thekidds.org> | 2012-06-20 14:09:46 -0400 |
| commit | 6617eaaf9b9ff5a76cb2c4150623a685357966d4 (patch) | |
| tree | 7ab5117abd3461db01b6f2c08d43595416e9744e /spec/models/issue_spec.rb | |
| parent | 356430c3c0e8aed3f8c9f2e181aaeaeaa4f1d693 (diff) | |
| download | gitlab-ce-6617eaaf9b9ff5a76cb2c4150623a685357966d4.tar.gz | |
Make IssueObserver handle issus, not MailerObserver
Diffstat (limited to 'spec/models/issue_spec.rb')
| -rw-r--r-- | spec/models/issue_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index 9668f0b23f2..fd3af62d74d 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -55,6 +55,26 @@ describe Issue do end end + + describe '#is_being_reopened?' do + it 'returns true if the closed attribute has changed and is now false' do + issue = Factory.create(:issue, + :closed => true, + :author => Factory(:user), + :assignee => Factory(:user), + :project => Factory.create(:project)) + issue.closed = false + issue.is_being_reopened?.should be_true + end + it 'returns false if the closed attribute has changed and is now true' do + subject.closed = true + subject.is_being_reopened?.should be_false + end + it 'returns false if the closed attribute has not changed' do + subject.is_being_reopened?.should be_false + end + end + describe "plus 1" do let(:project) { Factory(:project) } subject { @@ -86,6 +106,7 @@ describe Issue do subject.upvotes.should == 2 end end + end # == Schema Information # |
