From 09263719d536a3935c4b1d801472126ece28f283 Mon Sep 17 00:00:00 2001 From: Alex Denisov <1101.debian@gmail.com> Date: Fri, 7 Sep 2012 13:56:13 +0300 Subject: [PATCH] Preselected Milestone: Cucumber scenario added --- features/projects/issues/issues.feature | 10 ++++++++++ .../step_definitions/project/project_issues_steps.rb | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/features/projects/issues/issues.feature b/features/projects/issues/issues.feature index 42a3d873..f0d9b610 100644 --- a/features/projects/issues/issues.feature +++ b/features/projects/issues/issues.feature @@ -64,3 +64,13 @@ Feature: Issues And I fill in issue search with "" Then I should see "Release 0.4" in issues And I should see "Release 0.3" in issues + + @javascript + @current + Scenario: I create Issue with pre-selected milestone + Given project "Shop" has milestone "v2.2" + And project "Shop" has milestone "v3.0" + And I visit project "Shop" issues page + When I select milestone "v3.0" + And I click link "New Issue" + Then I should see selected milestone with title "v3.0" diff --git a/features/step_definitions/project/project_issues_steps.rb b/features/step_definitions/project/project_issues_steps.rb index e46c1f42..ecf0892f 100644 --- a/features/step_definitions/project/project_issues_steps.rb +++ b/features/step_definitions/project/project_issues_steps.rb @@ -55,3 +55,15 @@ Given /^I fill in issue search with "(.*?)"$/ do |arg1| end fill_in 'issue_search', with: arg1 end + +When /^I select milestone "(.*?)"$/ do |milestone_title| + select milestone_title, from: "milestone_id" +end + +Then /^I should see selected milestone with title "(.*?)"$/ do |milestone_title| + issues_milestone_selector = "#issue_milestone_id_chzn/a" + wait_until{ + page.has_content?("Details") + } + page.find(issues_milestone_selector).should have_content(milestone_title) +end