diff --git a/features/projects/issues/issues.feature b/features/projects/issues/issues.feature index f0d9b610..2cfda136 100644 --- a/features/projects/issues/issues.feature +++ b/features/projects/issues/issues.feature @@ -66,7 +66,6 @@ Feature: 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" @@ -74,3 +73,11 @@ Feature: Issues When I select milestone "v3.0" And I click link "New Issue" Then I should see selected milestone with title "v3.0" + + @javascript + @current + Scenario: I create Issue with pre-selected assignee + When I select first assignee from "Shop" project + And I click link "New Issue" + Then I should see first assignee from "Shop" as selected assignee + diff --git a/features/step_definitions/project/project_issues_steps.rb b/features/step_definitions/project/project_issues_steps.rb index e4c169ec..d78da53c 100644 --- a/features/step_definitions/project/project_issues_steps.rb +++ b/features/step_definitions/project/project_issues_steps.rb @@ -57,14 +57,25 @@ Given /^I fill in issue search with "(.*?)"$/ do |arg1| end When /^I select milestone "(.*?)"$/ do |milestone_title| - #puts page.body 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") - } + wait_until{ page.has_content?("Details") } page.find(issues_milestone_selector).should have_content(milestone_title) end + +When /^I select first assignee from "(.*?)" project$/ do |project_name| + project = Project.find_by_name project_name + first_assignee = project.users.first + select first_assignee.name, from: "assignee_id" +end + +Then /^I should see first assignee from "(.*?)" as selected assignee$/ do |project_name| + issues_assignee_selector = "#issue_assignee_id_chzn/a" + wait_until{ page.has_content?("Details") } + project = Project.find_by_name project_name + assignee_name = project.users.first.name + page.find(issues_assignee_selector).should have_content(assignee_name) +end