Submit the form after preview.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11348 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2013-02-10 21:28:29 +00:00
parent 0df1b9b1a4
commit eed4954f0a
1 changed files with 24 additions and 22 deletions

View File

@ -23,10 +23,9 @@ class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base
:enumerations, :custom_fields, :custom_values, :custom_fields_trackers,
:watchers
# create an issue
def test_add_issue
def test_create_issue
log_user('jsmith', 'jsmith')
visit new_issue_path(:project_id => 1)
visit '/projects/ecookbook/issues/new'
within('form#issue-form') do
select 'Bug', :from => 'Tracker'
select 'Low', :from => 'Priority'
@ -60,21 +59,21 @@ class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base
def test_create_issue_with_watchers
User.generate!(:firstname => 'Some', :lastname => 'Watcher')
log_user('jsmith', 'jsmith')
visit '/projects/ecookbook/issues/new'
fill_in 'Subject', :with => 'Issue with watchers'
# Add a project member as watcher
check 'Dave Lopper'
# Search for another user
click_link 'Search for watchers to add'
within('form#new-watcher-form') do
assert page.has_content?('Some One')
fill_in 'user_search', :with => 'watch'
assert page.has_no_content?('Some One')
check 'Some Watcher'
click_button 'Add'
end
assert_difference 'Issue.count' do
log_user('jsmith', 'jsmith')
visit '/projects/ecookbook/issues/new'
fill_in 'Subject', :with => 'Issue with watchers'
# Add a project member as watcher
check 'Dave Lopper'
# Search for another user
click_link 'Search for watchers to add'
within('form#new-watcher-form') do
assert page.has_content?('Some One')
fill_in 'user_search', :with => 'watch'
assert page.has_no_content?('Some One')
check 'Some Watcher'
click_button 'Add'
end
find('input[name=commit]').click
end
@ -82,18 +81,21 @@ class Redmine::UiTest::IssuesTest < Redmine::UiTest::Base
assert_equal ['Dave Lopper', 'Some Watcher'], issue.watcher_users.map(&:name).sort
end
# TODO: `fill_in 'Description'` makes all visit calls inoperative
# and breaks all tests that run after that
def test_preview_issue_description
skip("Breaks the test suite")
log_user('jsmith', 'jsmith')
visit new_issue_path(:project_id => 1)
visit '/projects/ecookbook/issues/new'
within('form#issue-form') do
fill_in 'Subject', :with => 'new issue subject'
fill_in 'Description', :with => 'new issue description'
click_link 'Preview'
end
find 'div#preview fieldset', :visible => true, :text => 'new issue description'
assert_difference 'Issue.count' do
find('input[name=commit]').click
end
issue = Issue.order('id desc').first
assert_equal 'new issue description', issue.description
end
def test_watch_issue_via_context_menu