Commit a2281046 authored by jplang's avatar jplang

Adds some system tests.

git-svn-id: https://svn.redmine.org/redmine/trunk@16908 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 1122c865
......@@ -1141,7 +1141,7 @@ div.wiki img {vertical-align:middle; max-width:100%;}
line-height:1.5em;
}
.mypage-box>.contextual {opacity:0; transition: opacity 0.2s;}
.mypage-box>.contextual {opacity:0.001; transition: opacity 0.2s;}
.mypage-box:hover>.contextual {opacity:1;}
.handle {cursor: move;}
......
......@@ -151,6 +151,27 @@ class IssuesTest < ApplicationSystemTestCase
set_fixtures_attachments_directory
end
def test_create_issue_with_new_target_version
log_user('jsmith', 'jsmith')
assert_difference 'Issue.count' do
assert_difference 'Version.count' do
visit '/projects/ecookbook/issues/new'
fill_in 'Subject', :with => 'With a new version'
click_on 'New version'
within '#ajax-modal' do
fill_in 'Name', :with => '4.0'
click_on 'Create'
end
click_on 'Create'
end
end
issue = Issue.order('id desc').first
assert_not_nil issue.fixed_version
assert_equal '4.0', issue.fixed_version.name
end
def test_preview_issue_description
log_user('jsmith', 'jsmith')
visit '/projects/ecookbook/issues/new'
......
......@@ -51,4 +51,50 @@ class MyPageTest < ApplicationSystemTestCase
assert page.has_css?('table.issues.sort-by-tracker')
assert page.has_css?('table.issues.sort-desc')
end
def test_add_block
preferences = User.find(2).pref
preferences.my_page_layout = {'top' => ['issuesassignedtome']}
preferences.save!
log_user('jsmith', 'jsmith')
visit '/my/page'
select 'Watched issues', :from => 'Add'
assert page.has_css?('#block-issueswatched')
assert_equal({'top' => ['issueswatched', 'issuesassignedtome']},
preferences.reload.my_page_layout)
end
def test_add_issue_query_block
preferences = User.find(2).pref
preferences.my_page_layout = {'top' => ['issuesassignedtome']}
preferences.save!
query = IssueQuery.create!(:name => 'My query', :user_id => 2)
log_user('jsmith', 'jsmith')
visit '/my/page'
select 'Issues', :from => 'Add'
# Select which query to display
select query.name, :from => 'Custom query'
click_on 'Save'
assert page.has_css?('#block-issuequery table.issues')
assert_equal({'top' => ['issuequery', 'issuesassignedtome']}, preferences.reload.my_page_layout)
assert_equal({:query_id => query.id.to_s}, preferences.my_page_settings['issuequery'])
end
def test_remove_block
preferences = User.find(2).pref
preferences.my_page_layout = {'top' => ['issuesassignedtome']}
preferences.save!
log_user('jsmith', 'jsmith')
visit '/my/page'
within '#block-issuesassignedtome' do
click_on 'Delete'
end
assert page.has_no_css?('#block-issuesassignedtome')
assert_equal({'top' => []}, preferences.reload.my_page_layout)
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment