: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'
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
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