Cucumber scenario on pre-selected assignee added

This commit is contained in:
Alex Denisov 2012-09-07 16:51:37 +03:00
parent 26552051b7
commit c818c93aa7
2 changed files with 23 additions and 5 deletions

View file

@ -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

View file

@ -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