Revision 441:cbce1fd3b1b7 test/integration/.svn/text-base
| test/integration/.svn/text-base/issues_test.rb.svn-base | ||
|---|---|---|
| 1 |
# redMine - project management software
|
|
| 2 |
# Copyright (C) 2006-2008 Jean-Philippe Lang
|
|
| 1 |
# Redmine - project management software
|
|
| 2 |
# Copyright (C) 2006-2011 Jean-Philippe Lang
|
|
| 3 | 3 |
# |
| 4 | 4 |
# This program is free software; you can redistribute it and/or |
| 5 | 5 |
# modify it under the terms of the GNU General Public License |
| ... | ... | |
| 65 | 65 |
end |
| 66 | 66 |
|
| 67 | 67 |
# add then remove 2 attachments to an issue |
| 68 |
def test_issue_attachements
|
|
| 68 |
def test_issue_attachments |
|
| 69 | 69 |
log_user('jsmith', 'jsmith')
|
| 70 | 70 |
set_tmp_attachments_directory |
| 71 | 71 |
|
| ... | ... | |
| 126 | 126 |
:attributes => { :href => '/projects/ecookbook/issues?page=2' }
|
| 127 | 127 |
|
| 128 | 128 |
end |
| 129 |
|
|
| 130 |
def test_issue_with_user_custom_field |
|
| 131 |
@field = IssueCustomField.create!(:name => 'Tester', :field_format => 'user', :is_for_all => true, :trackers => Tracker.all) |
|
| 132 |
Role.anonymous.add_permission! :add_issues, :edit_issues |
|
| 133 |
users = Project.find(1).users |
|
| 134 |
tester = users.first |
|
| 135 |
|
|
| 136 |
# Issue form |
|
| 137 |
get '/projects/ecookbook/issues/new' |
|
| 138 |
assert_response :success |
|
| 139 |
assert_tag :select, |
|
| 140 |
:attributes => {:name => "issue[custom_field_values][#{@field.id}]"},
|
|
| 141 |
:children => {:count => (users.size + 1)}, # +1 for blank value
|
|
| 142 |
:child => {
|
|
| 143 |
:tag => 'option', |
|
| 144 |
:attributes => {:value => tester.id.to_s},
|
|
| 145 |
:content => tester.name |
|
| 146 |
} |
|
| 147 |
|
|
| 148 |
# Create issue |
|
| 149 |
assert_difference 'Issue.count' do |
|
| 150 |
post '/projects/ecookbook/issues', |
|
| 151 |
:issue => {
|
|
| 152 |
:tracker_id => '1', |
|
| 153 |
:priority_id => '4', |
|
| 154 |
:subject => 'Issue with user custom field', |
|
| 155 |
:custom_field_values => {@field.id.to_s => users.first.id.to_s}
|
|
| 156 |
} |
|
| 157 |
end |
|
| 158 |
issue = Issue.first(:order => 'id DESC') |
|
| 159 |
assert_response 302 |
|
| 160 |
|
|
| 161 |
# Issue view |
|
| 162 |
follow_redirect! |
|
| 163 |
assert_tag :th, |
|
| 164 |
:content => /Tester/, |
|
| 165 |
:sibling => {
|
|
| 166 |
:tag => 'td', |
|
| 167 |
:content => tester.name |
|
| 168 |
} |
|
| 169 |
assert_tag :select, |
|
| 170 |
:attributes => {:name => "issue[custom_field_values][#{@field.id}]"},
|
|
| 171 |
:children => {:count => (users.size + 1)}, # +1 for blank value
|
|
| 172 |
:child => {
|
|
| 173 |
:tag => 'option', |
|
| 174 |
:attributes => {:value => tester.id.to_s, :selected => 'selected'},
|
|
| 175 |
:content => tester.name |
|
| 176 |
} |
|
| 177 |
|
|
| 178 |
# Update issue |
|
| 179 |
new_tester = users[1] |
|
| 180 |
assert_difference 'Journal.count' do |
|
| 181 |
put "/issues/#{issue.id}",
|
|
| 182 |
:notes => 'Updating custom field', |
|
| 183 |
:issue => {
|
|
| 184 |
:custom_field_values => {@field.id.to_s => new_tester.id.to_s}
|
|
| 185 |
} |
|
| 186 |
end |
|
| 187 |
assert_response 302 |
|
| 188 |
|
|
| 189 |
# Issue view |
|
| 190 |
follow_redirect! |
|
| 191 |
assert_tag :content => 'Tester', |
|
| 192 |
:ancestor => {:tag => 'ul', :attributes => {:class => /details/}},
|
|
| 193 |
:sibling => {
|
|
| 194 |
:content => tester.name, |
|
| 195 |
:sibling => {
|
|
| 196 |
:content => new_tester.name |
|
| 197 |
} |
|
| 198 |
} |
|
| 199 |
end |
|
| 129 | 200 |
end |
| test/integration/.svn/text-base/layout_test.rb.svn-base | ||
|---|---|---|
| 21 | 21 |
assert_response :forbidden |
| 22 | 22 |
assert_select "#admin-menu", :count => 0 |
| 23 | 23 |
end |
| 24 |
|
|
| 25 |
def test_top_menu_and_search_not_visible_when_login_required |
|
| 26 |
with_settings :login_required => '1' do |
|
| 27 |
get '/' |
|
| 28 |
assert_select "#top-menu > ul", 0 |
|
| 29 |
assert_select "#quick-search", 0 |
|
| 30 |
end |
|
| 31 |
end |
|
| 32 |
|
|
| 33 |
def test_top_menu_and_search_visible_when_login_not_required |
|
| 34 |
with_settings :login_required => '0' do |
|
| 35 |
get '/' |
|
| 36 |
assert_select "#top-menu > ul" |
|
| 37 |
assert_select "#quick-search" |
|
| 38 |
end |
|
| 39 |
end |
|
| 40 |
|
|
| 41 |
def test_wiki_formatter_header_tags |
|
| 42 |
Role.anonymous.add_permission! :add_issues |
|
| 43 |
|
|
| 44 |
get '/projects/ecookbook/issues/new' |
|
| 45 |
assert_tag :script, |
|
| 46 |
:attributes => {:src => %r{^/javascripts/jstoolbar/textile.js}},
|
|
| 47 |
:parent => {:tag => 'head'}
|
|
| 48 |
end |
|
| 24 | 49 |
end |
| test/integration/.svn/text-base/routing_test.rb.svn-base | ||
|---|---|---|
| 91 | 91 |
should_route :post, "/issues/1/quoted", :controller => 'journals', :action => 'new', :id => '1' |
| 92 | 92 |
|
| 93 | 93 |
should_route :get, "/issues/calendar", :controller => 'calendars', :action => 'show' |
| 94 |
should_route :put, "/issues/calendar", :controller => 'calendars', :action => 'update' |
|
| 95 | 94 |
should_route :get, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'show', :project_id => 'project-name' |
| 96 |
should_route :put, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'update', :project_id => 'project-name' |
|
| 97 | 95 |
|
| 98 | 96 |
should_route :get, "/issues/gantt", :controller => 'gantts', :action => 'show' |
| 99 |
should_route :put, "/issues/gantt", :controller => 'gantts', :action => 'update'
|
|
| 97 |
should_route :get, "/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :format => 'pdf'
|
|
| 100 | 98 |
should_route :get, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'show', :project_id => 'project-name' |
| 101 |
should_route :put, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'update', :project_id => 'project-name'
|
|
| 99 |
should_route :get, "/projects/project-name/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :project_id => 'project-name', :format => 'pdf'
|
|
| 102 | 100 |
|
| 103 | 101 |
should_route :get, "/issues/auto_complete", :controller => 'auto_completes', :action => 'issues' |
| 104 | 102 |
|
| ... | ... | |
| 197 | 195 |
should_route :delete, "/projects/1.xml", :controller => 'projects', :action => 'destroy', :id => '1', :format => 'xml' |
| 198 | 196 |
should_route :delete, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'destroy', :project_id => '64' |
| 199 | 197 |
end |
| 198 |
|
|
| 199 |
context "queries" do |
|
| 200 |
should_route :get, "/queries/new", :controller => 'queries', :action => 'new' |
|
| 201 |
should_route :get, "/projects/redmine/queries/new", :controller => 'queries', :action => 'new', :project_id => 'redmine' |
|
| 202 |
|
|
| 203 |
should_route :post, "/queries/new", :controller => 'queries', :action => 'new' |
|
| 204 |
should_route :post, "/projects/redmine/queries/new", :controller => 'queries', :action => 'new', :project_id => 'redmine' |
|
| 205 |
end |
|
| 200 | 206 |
|
| 201 | 207 |
context "repositories" do |
| 202 | 208 |
should_route :get, "/projects/redmine/repository", :controller => 'repositories', :action => 'show', :id => 'redmine' |
Also available in: Unified diff