summaryrefslogtreecommitdiffstats
path: root/test/ui
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-02-10 21:28:29 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-02-10 21:28:29 +0000
commiteed4954f0a43883b4ced7aa32f152538816b8d96 (patch)
treea82eca062bd705802eed4c8b94c94e4c38a70b7b /test/ui
parent0df1b9b1a4866f833522172042620b93c1ed52c4 (diff)
downloadredmine-eed4954f0a43883b4ced7aa32f152538816b8d96.tar.gz
redmine-eed4954f0a43883b4ced7aa32f152538816b8d96.zip
Submit the form after preview.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11348 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/ui')
-rw-r--r--test/ui/issues_test.rb46
1 files changed, 24 insertions, 22 deletions
diff --git a/test/ui/issues_test.rb b/test/ui/issues_test.rb
index 27de63a96..b0243bfda 100644
--- a/test/ui/issues_test.rb
+++ b/test/ui/issues_test.rb
@@ -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