summaryrefslogtreecommitdiff
path: root/spec/models/issue_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/issue_spec.rb')
-rw-r--r--spec/models/issue_spec.rb35
1 files changed, 8 insertions, 27 deletions
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb
index 10db53e0745..99d9f65b0d7 100644
--- a/spec/models/issue_spec.rb
+++ b/spec/models/issue_spec.rb
@@ -9,7 +9,7 @@
# project_id :integer
# created_at :datetime not null
# updated_at :datetime not null
-# closed :boolean default(FALSE), not null
+# state :string default(FALSE), not null
# position :integer default(0)
# branch_name :string(255)
# description :text
@@ -44,34 +44,15 @@ describe Issue do
end
end
- describe '#is_being_closed?' do
- it 'returns true if the closed attribute has changed and is now true' do
- subject.closed = true
- subject.is_being_closed?.should be_true
- end
- it 'returns false if the closed attribute has changed and is now false' do
- issue = create(:closed_issue)
- issue.closed = false
- issue.is_being_closed?.should be_false
- end
- it 'returns false if the closed attribute has not changed' do
- subject.is_being_closed?.should be_false
- end
- end
+ describe '#is_being_reassigned?' do
+ it 'returnes issues assigned to user' do
+ user = create :user
+ 2.times do
+ issue = create :issue, assignee: user
+ end
- describe '#is_being_reopened?' do
- it 'returns true if the closed attribute has changed and is now false' do
- issue = create(:closed_issue)
- 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
+ Issue.open_for(user).count.should eq 2
end
end
end