diff options
author | Andrew8xx8 <avk@8xx8.ru> | 2013-02-18 17:52:39 +0400 |
---|---|---|
committer | Andrew8xx8 <avk@8xx8.ru> | 2013-02-18 17:52:39 +0400 |
commit | 41e97a766b2cf5f75bfca5bb892e49eba720a330 (patch) | |
tree | 823dc1f464bba245d102811d8c7b4917504b2a7c /spec/models/milestone_spec.rb | |
parent | d27ed43daa18476b3fec6e705406c76a1b057f60 (diff) | |
download | gitlab-ce-41e97a766b2cf5f75bfca5bb892e49eba720a330.tar.gz |
Creating test values moved to before
Diffstat (limited to 'spec/models/milestone_spec.rb')
-rw-r--r-- | spec/models/milestone_spec.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb index 0f6317efc1a..b473f843146 100644 --- a/spec/models/milestone_spec.rb +++ b/spec/models/milestone_spec.rb @@ -110,26 +110,31 @@ describe Milestone do end 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 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 end end describe :can_be_closed? do - it 'should be true if milestone active and all nestied issues closed' do + before do 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 end it 'should be false if milestone active and not all nestied issues closed' do - milestone = create :milestone - closed_issue = create :closed_issue, milestone: milestone - issue = create :issue, milestone: milestone + issue.milestone = milestone + issue.save milestone.can_be_closed?.should be_false end |