diff options
Diffstat (limited to 'spec/helpers/issues_helper_spec.rb')
-rw-r--r-- | spec/helpers/issues_helper_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/helpers/issues_helper_spec.rb b/spec/helpers/issues_helper_spec.rb index ffd8ebae029..df0eb22d6f6 100644 --- a/spec/helpers/issues_helper_spec.rb +++ b/spec/helpers/issues_helper_spec.rb @@ -148,4 +148,19 @@ describe IssuesHelper do expect(awards_sort(data).keys).to eq(["thumbsup", "thumbsdown", "lifter"]) end end + + describe "#milestone options" do + let!(:closed_milestone) { create :closed_milestone, title: "closed milestone", project: project } + let!(:milestone1) { create :milestone, title: "open milestone 1", project: project } + let!(:milestone2) { create :milestone, title: "open milestone 2", project: project } + + before { issue.update_attributes(milestone_id: closed_milestone.id) } + + it "gets closed milestone from current issue" do + options = milestone_options(issue) + expect(options).to have_selector('option[selected]', text: closed_milestone.title) + expect(options).to have_selector('option', text: milestone1.title) + expect(options).to have_selector('option', text: milestone2.title) + end + end end |