Commit 41e97a76 authored by Andrew8xx8's avatar Andrew8xx8

Creating test values moved to before

parent d27ed43d
...@@ -110,26 +110,31 @@ describe Milestone do ...@@ -110,26 +110,31 @@ describe Milestone do
end end
describe :is_empty? do describe :is_empty? do
it 'Should return total count of issues and merge requests assigned to milestone' do before do
issue = create :closed_issue, milestone: milestone issue = create :closed_issue, milestone: milestone
merge_request = create :merge_request, milestone: milestone merge_request = create :merge_request, milestone: milestone
end
it 'Should return total count of issues and merge requests assigned to milestone' do
milestone.total_items_count.should eq 2 milestone.total_items_count.should eq 2
end end
end end
describe :can_be_closed? do describe :can_be_closed? do
it 'should be true if milestone active and all nestied issues closed' do before do
milestone = create :milestone milestone = create :milestone
closed_issue = create :closed_issue, milestone: milestone create :closed_issue, milestone: milestone
issue = create :issue
end
it 'should be true if milestone active and all nestied issues closed' do
milestone.can_be_closed?.should be_true milestone.can_be_closed?.should be_true
end end
it 'should be false if milestone active and not all nestied issues closed' do it 'should be false if milestone active and not all nestied issues closed' do
milestone = create :milestone issue.milestone = milestone
closed_issue = create :closed_issue, milestone: milestone issue.save
issue = create :issue, milestone: milestone
milestone.can_be_closed?.should be_false milestone.can_be_closed?.should be_false
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment