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:
authorRobb Kidd <robb@thekidds.org>2012-05-21 21:30:53 +0400
committerRobb Kidd <robb@thekidds.org>2012-06-20 22:09:46 +0400
commit6617eaaf9b9ff5a76cb2c4150623a685357966d4 (patch)
tree7ab5117abd3461db01b6f2c08d43595416e9744e /spec/models/issue_spec.rb
parent356430c3c0e8aed3f8c9f2e181aaeaeaa4f1d693 (diff)
Make IssueObserver handle issus, not MailerObserver
Diffstat (limited to 'spec/models/issue_spec.rb')
-rw-r--r--spec/models/issue_spec.rb21
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
#