<% end %>
- <% @project.custom_values.each do |custom_value| %>
+ <% @project.visible_custom_field_values.each do |custom_value| %>
<% if !custom_value.value.blank? %>
<% end %>
- <% @project.custom_values.each do |custom_value| %>
+ <% @project.visible_custom_field_values.each do |custom_value| %>
<% if !custom_value.value.blank? %>
<% end %>
- <% for custom_value in @custom_values %>
+ <% @user.visible_custom_field_values.each do |custom_value| %>
<% if !custom_value.value.blank? %>
<% end %>
- <% for custom_value in @custom_values %>
+ <% @user.visible_custom_field_values.each do |custom_value| %>
<% if !custom_value.value.blank? %>
'
- out
- end
- end
-
AUTO_LINK_RE = %r{
( # leading text
<\w+.*?>| # leading HTML tag, or
@@ -121,7 +76,7 @@
(\S+?) # url
(\/)? # slash
)
- ([^\w\=\/;\(\)]*?) # post
+ ((?:>)?|[^\w\=\/;\(\)]*?) # post
(?=<|\s|$)
}x unless const_defined?(:AUTO_LINK_RE)
diff -r 09b1d4349da3 -r 371eac10df0b lib/tasks/.svn/all-wcprops
--- a/lib/tasks/.svn/all-wcprops Thu Oct 21 11:19:14 2010 +0100
+++ b/lib/tasks/.svn/all-wcprops Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
K 25
svn:wc:ra_dav:version-url
V 34
-/svn/!svn/ver/4167/trunk/lib/tasks
+/svn/!svn/ver/4405/trunk/lib/tasks
END
deprecated.rake
K 25
@@ -27,18 +27,18 @@
V 48
/svn/!svn/ver/4167/trunk/lib/tasks/reminder.rake
END
+initializers.rake
+K 25
+svn:wc:ra_dav:version-url
+V 52
+/svn/!svn/ver/4405/trunk/lib/tasks/initializers.rake
+END
metrics.rake
K 25
svn:wc:ra_dav:version-url
V 47
/svn/!svn/ver/2825/trunk/lib/tasks/metrics.rake
END
-initializers.rake
-K 25
-svn:wc:ra_dav:version-url
-V 52
-/svn/!svn/ver/3785/trunk/lib/tasks/initializers.rake
-END
permissions.rake
K 25
svn:wc:ra_dav:version-url
@@ -63,23 +63,23 @@
V 48
/svn/!svn/ver/3167/trunk/lib/tasks/watchers.rake
END
+yardoc.rake
+K 25
+svn:wc:ra_dav:version-url
+V 46
+/svn/!svn/ver/3922/trunk/lib/tasks/yardoc.rake
+END
plugins.rake
K 25
svn:wc:ra_dav:version-url
V 47
/svn/!svn/ver/1786/trunk/lib/tasks/plugins.rake
END
-yardoc.rake
-K 25
-svn:wc:ra_dav:version-url
-V 46
-/svn/!svn/ver/3922/trunk/lib/tasks/yardoc.rake
-END
locales.rake
K 25
svn:wc:ra_dav:version-url
V 47
-/svn/!svn/ver/2502/trunk/lib/tasks/locales.rake
+/svn/!svn/ver/4254/trunk/lib/tasks/locales.rake
END
migrate_from_trac.rake
K 25
@@ -91,13 +91,13 @@
K 25
svn:wc:ra_dav:version-url
V 59
-/svn/!svn/ver/3328/trunk/lib/tasks/migrate_from_mantis.rake
+/svn/!svn/ver/4403/trunk/lib/tasks/migrate_from_mantis.rake
END
email.rake
K 25
svn:wc:ra_dav:version-url
V 45
-/svn/!svn/ver/3330/trunk/lib/tasks/email.rake
+/svn/!svn/ver/4256/trunk/lib/tasks/email.rake
END
migrate_plugins.rake
K 25
diff -r 09b1d4349da3 -r 371eac10df0b lib/tasks/.svn/entries
--- a/lib/tasks/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/lib/tasks/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,15 +1,15 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/lib/tasks
http://redmine.rubyforge.org/svn
-2010-09-20T23:17:51.402972Z
-4167
-edavis10
+2010-11-14T15:14:19.280754Z
+4405
+jplang
@@ -162,6 +162,40 @@
1606
+initializers.rake
+file
+
+
+
+
+2010-11-19T13:04:51.424933Z
+c25b466de7654465538a91e5f5ab32b9
+2010-11-14T15:14:19.280754Z
+4405
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1343
+
metrics.rake
file
@@ -196,40 +230,6 @@
113
-initializers.rake
-file
-
-
-
-
-2010-09-23T14:37:45.063748Z
-561f310a7d3a42b31ab7271aec396633
-2010-06-19T20:04:47.615499Z
-3785
-edavis10
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1351
-
permissions.rake
file
@@ -366,6 +366,40 @@
180
+yardoc.rake
+file
+
+
+
+
+2010-09-23T14:37:45.067787Z
+5c9889bed6f4a4d18dbeb3d904855bb6
+2010-08-07T15:11:26.667915Z
+3922
+edavis10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+578
+
plugins.rake
file
@@ -400,51 +434,17 @@
1256
-yardoc.rake
-file
-
-
-
-
-2010-09-23T14:37:45.067787Z
-5c9889bed6f4a4d18dbeb3d904855bb6
-2010-08-07T15:11:26.667915Z
-3922
-edavis10
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-578
-
locales.rake
file
-2010-09-23T14:37:45.063748Z
-4b8985b7b23bbc48dc414dbd1999ca1b
-2009-02-21T15:21:31.040851Z
-2502
-jplang
+2010-11-19T13:04:51.424933Z
+8cb19171aae8528b3149b7efa211fc50
+2010-10-15T22:41:47.658318Z
+4254
+edavis10
has-props
@@ -466,7 +466,7 @@
-961
+3360
migrate_from_trac.rake
file
@@ -508,10 +508,10 @@
-2010-09-23T14:37:45.063748Z
-da88af55c1e96cf9caca3be6a29b3259
-2010-01-17T12:00:45.233005Z
-3328
+2010-11-19T13:04:51.424933Z
+d58affc991ec64b615bcbf3f9a1bb176
+2010-11-14T13:16:39.968867Z
+4403
jplang
@@ -534,7 +534,7 @@
-19302
+19253
email.rake
file
@@ -542,11 +542,11 @@
-2010-09-23T14:37:45.063748Z
-09d22d744d29edd8922bc899e4ec8be2
-2010-01-17T13:53:13.544777Z
-3330
-jplang
+2010-11-19T13:04:51.424933Z
+7875b7a15307c626a93c284f33757320
+2010-10-15T22:50:33.240825Z
+4256
+edavis10
@@ -568,7 +568,7 @@
-7537
+8244
migrate_plugins.rake
file
diff -r 09b1d4349da3 -r 371eac10df0b lib/tasks/.svn/text-base/email.rake.svn-base
--- a/lib/tasks/.svn/text-base/email.rake.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/lib/tasks/.svn/text-base/email.rake.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -165,5 +165,22 @@
Redmine::POP3.check(pop_options, options)
end
+
+ desc "Send a test email to the user with the provided login name"
+ task :test, :login, :needs => :environment do |task, args|
+ include Redmine::I18n
+ abort l(:notice_email_error, "Please include the user login to test with. Example: login=examle-login") if args[:login].blank?
+
+ user = User.find_by_login(args[:login])
+ abort l(:notice_email_error, "User #{args[:login]} not found") unless user.logged?
+
+ ActionMailer::Base.raise_delivery_errors = true
+ begin
+ Mailer.deliver_test(User.current)
+ puts l(:notice_email_sent, user.mail)
+ rescue Exception => e
+ abort l(:notice_email_error, e.message)
+ end
+ end
end
end
diff -r 09b1d4349da3 -r 371eac10df0b lib/tasks/.svn/text-base/initializers.rake.svn-base
--- a/lib/tasks/.svn/text-base/initializers.rake.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/lib/tasks/.svn/text-base/initializers.rake.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -16,7 +16,7 @@
# secret is at least 30 characters and all random, no regular words or
# you'll be exposed to dictionary attacks.
ActionController::Base.session = {
- :session_key => '_redmine_session',
+ :key => '_redmine_session',
#
# Uncomment and edit the :session_path below if are hosting your Redmine
# at a suburi and don't want the top level path to access the cookies
diff -r 09b1d4349da3 -r 371eac10df0b lib/tasks/.svn/text-base/locales.rake.svn-base
--- a/lib/tasks/.svn/text-base/locales.rake.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/lib/tasks/.svn/text-base/locales.rake.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -28,4 +28,62 @@
lang.close
end
end
+
+ desc <<-END_DESC
+Removes a translation string from all locale file (only works for top-level childless non-multiline keys, probably doesn\'t work on windows).
+
+Options:
+ key=key_1,key_2 Comma-separated list of keys to delete
+ skip=en,de Comma-separated list of locale files to ignore (filename without extension)
+END_DESC
+
+ task :remove_key do
+ dir = ENV['DIR'] || './config/locales'
+ files = Dir.glob(File.join(dir,'*.yml'))
+ skips = ENV['skip'] ? Regexp.union(ENV['skip'].split(',')) : nil
+ deletes = ENV['key'] ? Regexp.union(ENV['key'].split(',')) : nil
+ # Ignore multiline keys (begin with | or >) and keys with children (nothing meaningful after :)
+ delete_regex = /\A #{deletes}: +[^\|>\s#].*\z/
+
+ files.each do |path|
+ # Skip certain locales
+ (puts "Skipping #{path}"; next) if File.basename(path, ".yml") =~ skips
+ puts "Deleting selected keys from #{path}"
+ orig_content = File.open(path, 'r') {|file| file.read}
+ File.open(path, 'w') {|file| orig_content.each_line {|line| file.puts line unless line.chomp =~ delete_regex}}
+ end
+ end
+
+ desc <<-END_DESC
+Adds a new top-level translation string to all locale file (only works for childless keys, probably doesn\'t work on windows, doesn't check for duplicates).
+
+Options:
+ key="some_key=foo"
+ key1="another_key=bar"
+ key_fb="foo=bar" Keys to add in the form key=value, every option of the form key[,\\d,_*] will be recognised
+ skip=en,de Comma-separated list of locale files to ignore (filename without extension)
+END_DESC
+
+ task :add_key do
+ dir = ENV['DIR'] || './config/locales'
+ files = Dir.glob(File.join(dir,'*.yml'))
+ skips = ENV['skip'] ? Regexp.union(ENV['skip'].split(',')) : nil
+ keys_regex = /\Akey(\d+|_.+)?\z/
+ adds = ENV.reject {|k,v| !(k =~ keys_regex)}.values.collect {|v| Array.new v.split("=",2)}
+ key_list = adds.collect {|v| v[0]}.join(", ")
+
+ files.each do |path|
+ # Skip certain locales
+ (puts "Skipping #{path}"; next) if File.basename(path, ".yml") =~ skips
+ # TODO: Check for dupliate/existing keys
+ puts "Adding #{key_list} to #{path}"
+ File.open(path, 'a') do |file|
+ adds.each do |kv|
+ Hash[*kv].to_yaml.each_line do |line|
+ file.puts " #{line}" unless (line =~ /^---/ || line.empty?)
+ end
+ end
+ end
+ end
+ end
end
diff -r 09b1d4349da3 -r 371eac10df0b lib/tasks/.svn/text-base/migrate_from_mantis.rake.svn-base
--- a/lib/tasks/.svn/text-base/migrate_from_mantis.rake.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/lib/tasks/.svn/text-base/migrate_from_mantis.rake.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -120,12 +120,8 @@
has_many :news, :class_name => "MantisNews", :foreign_key => :project_id
has_many :members, :class_name => "MantisProjectUser", :foreign_key => :project_id
- def name
- read_attribute(:name)[0..29]
- end
-
def identifier
- read_attribute(:name).underscore[0..19].gsub(/[^a-z0-9\-]/, '-')
+ read_attribute(:name).gsub(/[^a-z0-9\-]+/, '-').slice(0, Project::IDENTIFIER_MAX_LENGTH)
end
end
diff -r 09b1d4349da3 -r 371eac10df0b lib/tasks/email.rake
--- a/lib/tasks/email.rake Thu Oct 21 11:19:14 2010 +0100
+++ b/lib/tasks/email.rake Wed Nov 24 12:20:08 2010 +0000
@@ -165,5 +165,22 @@
Redmine::POP3.check(pop_options, options)
end
+
+ desc "Send a test email to the user with the provided login name"
+ task :test, :login, :needs => :environment do |task, args|
+ include Redmine::I18n
+ abort l(:notice_email_error, "Please include the user login to test with. Example: login=examle-login") if args[:login].blank?
+
+ user = User.find_by_login(args[:login])
+ abort l(:notice_email_error, "User #{args[:login]} not found") unless user.logged?
+
+ ActionMailer::Base.raise_delivery_errors = true
+ begin
+ Mailer.deliver_test(User.current)
+ puts l(:notice_email_sent, user.mail)
+ rescue Exception => e
+ abort l(:notice_email_error, e.message)
+ end
+ end
end
end
diff -r 09b1d4349da3 -r 371eac10df0b lib/tasks/initializers.rake
--- a/lib/tasks/initializers.rake Thu Oct 21 11:19:14 2010 +0100
+++ b/lib/tasks/initializers.rake Wed Nov 24 12:20:08 2010 +0000
@@ -16,7 +16,7 @@
# secret is at least 30 characters and all random, no regular words or
# you'll be exposed to dictionary attacks.
ActionController::Base.session = {
- :session_key => '_redmine_session',
+ :key => '_redmine_session',
#
# Uncomment and edit the :session_path below if are hosting your Redmine
# at a suburi and don't want the top level path to access the cookies
diff -r 09b1d4349da3 -r 371eac10df0b lib/tasks/locales.rake
--- a/lib/tasks/locales.rake Thu Oct 21 11:19:14 2010 +0100
+++ b/lib/tasks/locales.rake Wed Nov 24 12:20:08 2010 +0000
@@ -28,4 +28,62 @@
lang.close
end
end
+
+ desc <<-END_DESC
+Removes a translation string from all locale file (only works for top-level childless non-multiline keys, probably doesn\'t work on windows).
+
+Options:
+ key=key_1,key_2 Comma-separated list of keys to delete
+ skip=en,de Comma-separated list of locale files to ignore (filename without extension)
+END_DESC
+
+ task :remove_key do
+ dir = ENV['DIR'] || './config/locales'
+ files = Dir.glob(File.join(dir,'*.yml'))
+ skips = ENV['skip'] ? Regexp.union(ENV['skip'].split(',')) : nil
+ deletes = ENV['key'] ? Regexp.union(ENV['key'].split(',')) : nil
+ # Ignore multiline keys (begin with | or >) and keys with children (nothing meaningful after :)
+ delete_regex = /\A #{deletes}: +[^\|>\s#].*\z/
+
+ files.each do |path|
+ # Skip certain locales
+ (puts "Skipping #{path}"; next) if File.basename(path, ".yml") =~ skips
+ puts "Deleting selected keys from #{path}"
+ orig_content = File.open(path, 'r') {|file| file.read}
+ File.open(path, 'w') {|file| orig_content.each_line {|line| file.puts line unless line.chomp =~ delete_regex}}
+ end
+ end
+
+ desc <<-END_DESC
+Adds a new top-level translation string to all locale file (only works for childless keys, probably doesn\'t work on windows, doesn't check for duplicates).
+
+Options:
+ key="some_key=foo"
+ key1="another_key=bar"
+ key_fb="foo=bar" Keys to add in the form key=value, every option of the form key[,\\d,_*] will be recognised
+ skip=en,de Comma-separated list of locale files to ignore (filename without extension)
+END_DESC
+
+ task :add_key do
+ dir = ENV['DIR'] || './config/locales'
+ files = Dir.glob(File.join(dir,'*.yml'))
+ skips = ENV['skip'] ? Regexp.union(ENV['skip'].split(',')) : nil
+ keys_regex = /\Akey(\d+|_.+)?\z/
+ adds = ENV.reject {|k,v| !(k =~ keys_regex)}.values.collect {|v| Array.new v.split("=",2)}
+ key_list = adds.collect {|v| v[0]}.join(", ")
+
+ files.each do |path|
+ # Skip certain locales
+ (puts "Skipping #{path}"; next) if File.basename(path, ".yml") =~ skips
+ # TODO: Check for dupliate/existing keys
+ puts "Adding #{key_list} to #{path}"
+ File.open(path, 'a') do |file|
+ adds.each do |kv|
+ Hash[*kv].to_yaml.each_line do |line|
+ file.puts " #{line}" unless (line =~ /^---/ || line.empty?)
+ end
+ end
+ end
+ end
+ end
end
diff -r 09b1d4349da3 -r 371eac10df0b lib/tasks/migrate_from_mantis.rake
--- a/lib/tasks/migrate_from_mantis.rake Thu Oct 21 11:19:14 2010 +0100
+++ b/lib/tasks/migrate_from_mantis.rake Wed Nov 24 12:20:08 2010 +0000
@@ -120,12 +120,8 @@
has_many :news, :class_name => "MantisNews", :foreign_key => :project_id
has_many :members, :class_name => "MantisProjectUser", :foreign_key => :project_id
- def name
- read_attribute(:name)[0..29]
- end
-
def identifier
- read_attribute(:name).underscore[0..19].gsub(/[^a-z0-9\-]/, '-')
+ read_attribute(:name).gsub(/[^a-z0-9\-]+/, '-').slice(0, Project::IDENTIFIER_MAX_LENGTH)
end
end
diff -r 09b1d4349da3 -r 371eac10df0b log/.svn/entries
--- a/log/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/log/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/log
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b public/.svn/all-wcprops
--- a/public/.svn/all-wcprops Thu Oct 21 11:19:14 2010 +0100
+++ b/public/.svn/all-wcprops Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
K 25
svn:wc:ra_dav:version-url
V 31
-/svn/!svn/ver/4072/trunk/public
+/svn/!svn/ver/4377/trunk/public
END
dispatch.fcgi.example
K 25
diff -r 09b1d4349da3 -r 371eac10df0b public/.svn/entries
--- a/public/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/public/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,15 +1,15 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/public
http://redmine.rubyforge.org/svn
-2010-09-10T03:09:02.311267Z
-4072
-edavis10
+2010-11-06T18:52:07.556711Z
+4377
+jplang
has-props
diff -r 09b1d4349da3 -r 371eac10df0b public/help/.svn/all-wcprops
--- a/public/help/.svn/all-wcprops Thu Oct 21 11:19:14 2010 +0100
+++ b/public/help/.svn/all-wcprops Wed Nov 24 12:20:08 2010 +0000
@@ -1,13 +1,13 @@
K 25
svn:wc:ra_dav:version-url
V 36
-/svn/!svn/ver/3595/trunk/public/help
+/svn/!svn/ver/4308/trunk/public/help
END
wiki_syntax_detailed.html
K 25
svn:wc:ra_dav:version-url
V 62
-/svn/!svn/ver/3595/trunk/public/help/wiki_syntax_detailed.html
+/svn/!svn/ver/4308/trunk/public/help/wiki_syntax_detailed.html
END
wiki_syntax.html
K 25
diff -r 09b1d4349da3 -r 371eac10df0b public/help/.svn/entries
--- a/public/help/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/public/help/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,15 +1,15 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/public/help
http://redmine.rubyforge.org/svn
-2010-03-16T21:48:21.610865Z
-3595
-jplang
+2010-10-29T22:48:59.506153Z
+4308
+jbbarth
@@ -32,11 +32,11 @@
-2010-09-23T14:37:45.075747Z
-73d1d55e3e3341a687d13e571825b6b9
-2010-03-16T21:48:21.610865Z
-3595
-jplang
+2010-11-19T13:04:51.444942Z
+380699b753ffb01cba5c9504216ff64b
+2010-10-29T22:48:59.506153Z
+4308
+jbbarth
@@ -58,7 +58,7 @@
-10590
+11397
wiki_syntax.html
file
diff -r 09b1d4349da3 -r 371eac10df0b public/help/.svn/text-base/wiki_syntax_detailed.html.svn-base
--- a/public/help/.svn/text-base/wiki_syntax_detailed.html.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/public/help/.svn/text-base/wiki_syntax_detailed.html.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -66,7 +66,7 @@
Wiki links are displayed in red if the page doesn't exist yet, eg: Nonexistent page.
-
Links to others resources (0.7):
+
Links to other resources:
Documents:
@@ -74,6 +74,7 @@
document#17 (link to document with id 17)
document:Greetings (link to the document with title "Greetings")
document:"Some document" (double quotes can be used when document title contains spaces)
+
document:some_project:"Some document" (link to a document with title "Some document" in other project "some_project")
@@ -95,19 +96,36 @@
-
Repository files
+
Repository files:
-
source:some/file -- Link to the file located at /some/file in the project's repository
-
source:some/file@52 -- Link to the file's revision 52
-
source:some/file#L120 -- Link to line 120 of the file
-
source:some/file@52#L120 -- Link to line 120 of the file's revision 52
-
export:some/file -- Force the download of the file
-
+
source:some/file (link to the file located at /some/file in the project's repository)
+
source:some/file@52 (link to the file's revision 52)
+
source:some/file#L120 (link to line 120 of the file)
+
source:some/file@52#L120 (link to line 120 of the file's revision 52)
+
source:"some file@52#L120" (use double quotes when the URL contains spaces
+
export:some/file (force the download of the file)
+
-
-
Escaping (0.7):
+
Forum messages:
+
+
message#1218 (link to message with id 1218)
+
+
+
+
+
Projects:
+
+
project#3 (link to project with id 3)
+
project:someproject (link to project named "someproject")
+
+
+
+
+
Escaping:
+
+
You can prevent Redmine links from being parsed by preceding them with an exclamation mark: !
@@ -219,7 +237,7 @@
Code highlighting
-
Code highlightment relies on CodeRay, a fast syntax highlighting library written completely in Ruby. It currently supports c, html, javascript, rhtml, ruby, scheme, xml languages.
+
Code highlightment relies on CodeRay, a fast syntax highlighting library written completely in Ruby. It currently supports c, cpp, css, delphi, groovy, html, java, javascript, json, php, python, rhtml, ruby, scheme, sql, xml and yaml languages.
You can highlight code in your wiki page using this syntax:
Wiki links are displayed in red if the page doesn't exist yet, eg: Nonexistent page.
-
Links to others resources (0.7):
+
Links to other resources:
Documents:
@@ -74,6 +74,7 @@
document#17 (link to document with id 17)
document:Greetings (link to the document with title "Greetings")
document:"Some document" (double quotes can be used when document title contains spaces)
+
document:some_project:"Some document" (link to a document with title "Some document" in other project "some_project")
@@ -95,19 +96,36 @@
-
Repository files
+
Repository files:
-
source:some/file -- Link to the file located at /some/file in the project's repository
-
source:some/file@52 -- Link to the file's revision 52
-
source:some/file#L120 -- Link to line 120 of the file
-
source:some/file@52#L120 -- Link to line 120 of the file's revision 52
-
export:some/file -- Force the download of the file
-
+
source:some/file (link to the file located at /some/file in the project's repository)
+
source:some/file@52 (link to the file's revision 52)
+
source:some/file#L120 (link to line 120 of the file)
+
source:some/file@52#L120 (link to line 120 of the file's revision 52)
+
source:"some file@52#L120" (use double quotes when the URL contains spaces
+
export:some/file (force the download of the file)
+
-
-
Escaping (0.7):
+
Forum messages:
+
+
message#1218 (link to message with id 1218)
+
+
+
+
+
Projects:
+
+
project#3 (link to project with id 3)
+
project:someproject (link to project named "someproject")
+
+
+
+
+
Escaping:
+
+
You can prevent Redmine links from being parsed by preceding them with an exclamation mark: !
@@ -219,7 +237,7 @@
Code highlighting
-
Code highlightment relies on CodeRay, a fast syntax highlighting library written completely in Ruby. It currently supports c, html, javascript, rhtml, ruby, scheme, xml languages.
+
Code highlightment relies on CodeRay, a fast syntax highlighting library written completely in Ruby. It currently supports c, cpp, css, delphi, groovy, html, java, javascript, json, php, python, rhtml, ruby, scheme, sql, xml and yaml languages.
You can highlight code in your wiki page using this syntax:
diff -r 09b1d4349da3 -r 371eac10df0b public/images/.svn/entries
--- a/public/images/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/public/images/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/public/images
http://redmine.rubyforge.org/svn
@@ -162,6 +162,74 @@
218
+milestone_late.png
+file
+
+
+
+
+2010-09-24T12:48:29.823793Z
+ecc1979ed435769c700725495428359f
+2010-09-10T03:09:02.311267Z
+4072
+edavis10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+160
+
+2downarrow.png
+file
+
+
+
+
+2010-09-23T14:37:45.123788Z
+6730b4ea633194233bec98ee5f7a3977
+2010-02-13T09:08:12.698526Z
+3419
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+282
+
folder_open_add.png
file
@@ -196,74 +264,6 @@
375
-2downarrow.png
-file
-
-
-
-
-2010-09-23T14:37:45.123788Z
-6730b4ea633194233bec98ee5f7a3977
-2010-02-13T09:08:12.698526Z
-3419
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-282
-
-milestone_late.png
-file
-
-
-
-
-2010-09-24T12:48:29.823793Z
-ecc1979ed435769c700725495428359f
-2010-09-10T03:09:02.311267Z
-4072
-edavis10
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-160
-
warning.png
file
@@ -298,6 +298,74 @@
613
+fav_off.png
+file
+
+
+
+
+2010-09-23T14:37:45.131805Z
+ff96c02d8f18116bb3f005f2c8b86e91
+2010-02-13T09:08:12.698526Z
+3419
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+211
+
+move.png
+file
+
+
+
+
+2010-09-23T14:37:45.155802Z
+0a2ceb01cbc3c01186fdcc25ced8eb0d
+2010-02-13T09:08:12.698526Z
+3419
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+321
+
reload.png
file
@@ -332,74 +400,6 @@
549
-move.png
-file
-
-
-
-
-2010-09-23T14:37:45.155802Z
-0a2ceb01cbc3c01186fdcc25ced8eb0d
-2010-02-13T09:08:12.698526Z
-3419
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-321
-
-fav_off.png
-file
-
-
-
-
-2010-09-23T14:37:45.131805Z
-ff96c02d8f18116bb3f005f2c8b86e91
-2010-02-13T09:08:12.698526Z
-3419
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-211
-
project_marker.png
file
@@ -468,6 +468,40 @@
641
+zoom_in.png
+file
+
+
+
+
+2010-09-23T14:37:45.163769Z
+91b883d074b727f1a95cd0ce48510a3c
+2010-02-13T09:08:12.698526Z
+3419
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+461
+
copy.png
file
@@ -502,40 +536,6 @@
925
-zoom_in.png
-file
-
-
-
-
-2010-09-23T14:37:45.163769Z
-91b883d074b727f1a95cd0ce48510a3c
-2010-02-13T09:08:12.698526Z
-3419
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-461
-
news.png
file
@@ -1083,6 +1083,40 @@
137
+bullet_delete.png
+file
+
+
+
+
+2010-09-23T14:37:45.123788Z
+fba036d7348ff28f7ab7dacbc52bc32a
+2010-02-13T09:08:12.698526Z
+3419
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+255
+
text_list_bullets.png
file
@@ -1117,40 +1151,6 @@
291
-bullet_delete.png
-file
-
-
-
-
-2010-09-23T14:37:45.123788Z
-fba036d7348ff28f7ab7dacbc52bc32a
-2010-02-13T09:08:12.698526Z
-3419
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-255
-
bullet_arrow_left.png
file
@@ -1423,6 +1423,40 @@
403
+textfield.png
+file
+
+
+
+
+2010-09-23T14:37:45.159811Z
+985a1dadffeaa303ff1eef4ea53ec0f4
+2010-02-13T09:08:12.698526Z
+3419
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+100
+
attachment.png
file
@@ -1457,40 +1491,6 @@
939
-textfield.png
-file
-
-
-
-
-2010-09-23T14:37:45.159811Z
-985a1dadffeaa303ff1eef4ea53ec0f4
-2010-02-13T09:08:12.698526Z
-3419
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-100
-
false.png
file
@@ -1525,6 +1525,40 @@
459
+unlock.png
+file
+
+
+
+
+2010-09-23T14:37:45.159811Z
+fa1be48a747127ee34d4fae020b825d4
+2010-02-14T13:13:16.743297Z
+3430
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+448
+
bullet_toggle_plus.png
file
@@ -1559,40 +1593,6 @@
217
-unlock.png
-file
-
-
-
-
-2010-09-23T14:37:45.159811Z
-fa1be48a747127ee34d4fae020b825d4
-2010-02-14T13:13:16.743297Z
-3430
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-448
-
group.png
file
@@ -1627,6 +1627,108 @@
700
+save.png
+file
+
+
+
+
+2010-09-23T14:37:45.155802Z
+9e64db8f4905a17e3a6f68792cd5e199
+2010-02-13T09:08:12.698526Z
+3419
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+440
+
+bullet_blue.png
+file
+
+
+
+
+2010-09-23T14:37:45.123788Z
+3363f60299360fb5539b769d089e145f
+2010-02-13T09:08:12.698526Z
+3419
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+241
+
+loading.gif
+file
+
+
+
+
+2010-09-23T14:37:45.151760Z
+03ce3dcc84af110e9da8699a841e5200
+2006-12-03T19:55:45.161980Z
+62
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1553
+
plugin.png
file
@@ -1661,108 +1763,6 @@
538
-loading.gif
-file
-
-
-
-
-2010-09-23T14:37:45.151760Z
-03ce3dcc84af110e9da8699a841e5200
-2006-12-03T19:55:45.161980Z
-62
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1553
-
-bullet_blue.png
-file
-
-
-
-
-2010-09-23T14:37:45.123788Z
-3363f60299360fb5539b769d089e145f
-2010-02-13T09:08:12.698526Z
-3419
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-241
-
-save.png
-file
-
-
-
-
-2010-09-23T14:37:45.155802Z
-9e64db8f4905a17e3a6f68792cd5e199
-2010-02-13T09:08:12.698526Z
-3419
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-440
-
bullet_add.png
file
@@ -1831,6 +1831,40 @@
1885
+milestone_done.png
+file
+
+
+
+
+2010-09-24T12:48:29.823793Z
+40c58172e0c52eee4deb5227ec37f0cf
+2010-09-10T03:09:02.311267Z
+4072
+edavis10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+137
+
exclamation.png
file
@@ -1865,40 +1899,6 @@
648
-milestone_done.png
-file
-
-
-
-
-2010-09-24T12:48:29.823793Z
-40c58172e0c52eee4deb5227ec37f0cf
-2010-09-10T03:09:02.311267Z
-4072
-edavis10
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-137
-
ticket_go.png
file
@@ -1933,6 +1933,74 @@
608
+zoom_out.png
+file
+
+
+
+
+2010-09-23T14:37:45.163769Z
+42b319d6ad0249fb20833a17d5f373a4
+2010-02-13T09:08:12.698526Z
+3419
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+461
+
+report.png
+file
+
+
+
+
+2010-09-23T14:37:45.155802Z
+8d8ec49f5773997411ff708a82e40568
+2010-02-13T09:08:12.698526Z
+3419
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1014
+
folder.png
file
@@ -1967,74 +2035,6 @@
970
-report.png
-file
-
-
-
-
-2010-09-23T14:37:45.155802Z
-8d8ec49f5773997411ff708a82e40568
-2010-02-13T09:08:12.698526Z
-3419
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1014
-
-zoom_out.png
-file
-
-
-
-
-2010-09-23T14:37:45.163769Z
-42b319d6ad0249fb20833a17d5f373a4
-2010-02-13T09:08:12.698526Z
-3419
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-461
-
fav.png
file
@@ -2069,6 +2069,40 @@
378
+bullet_purple.png
+file
+
+
+
+
+2010-09-23T14:37:45.127811Z
+c4c76ce450e3e838afd6aa8f34a8d9a8
+2010-02-13T09:08:12.698526Z
+3419
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+244
+
document.png
file
@@ -2103,40 +2137,6 @@
333
-bullet_purple.png
-file
-
-
-
-
-2010-09-23T14:37:45.127811Z
-c4c76ce450e3e838afd6aa8f34a8d9a8
-2010-02-13T09:08:12.698526Z
-3419
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-244
-
true.png
file
diff -r 09b1d4349da3 -r 371eac10df0b public/images/files/.svn/entries
--- a/public/images/files/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/public/images/files/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/public/images/files
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b public/images/jstoolbar/.svn/entries
--- a/public/images/jstoolbar/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/public/images/jstoolbar/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/public/images/jstoolbar
http://redmine.rubyforge.org/svn
@@ -94,6 +94,74 @@
252
+bt_code.png
+file
+
+
+
+
+2010-09-23T14:37:45.151760Z
+ef6624df45946b54e3b23db2a0c6b77b
+2010-02-13T09:08:12.698526Z
+3419
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+927
+
+bt_h3.png
+file
+
+
+
+
+2010-09-23T14:37:45.151760Z
+cb940b592da5ed0367305cb0514d5684
+2010-02-13T09:08:12.698526Z
+3419
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+261
+
bt_ol.png
file
@@ -128,14 +196,14 @@
248
-bt_h3.png
+bt_img.png
file
2010-09-23T14:37:45.151760Z
-cb940b592da5ed0367305cb0514d5684
+04a0e86c9eec7d85d445e7627b5fc8ea
2010-02-13T09:08:12.698526Z
3419
jplang
@@ -160,41 +228,7 @@
-261
-
-bt_code.png
-file
-
-
-
-
-2010-09-23T14:37:45.151760Z
-ef6624df45946b54e3b23db2a0c6b77b
-2010-02-13T09:08:12.698526Z
-3419
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-927
+1027
bt_strong.png
file
@@ -230,40 +264,6 @@
244
-bt_img.png
-file
-
-
-
-
-2010-09-23T14:37:45.151760Z
-04a0e86c9eec7d85d445e7627b5fc8ea
-2010-02-13T09:08:12.698526Z
-3419
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1027
-
bt_bq_remove.png
file
diff -r 09b1d4349da3 -r 371eac10df0b public/javascripts/.svn/all-wcprops
--- a/public/javascripts/.svn/all-wcprops Thu Oct 21 11:19:14 2010 +0100
+++ b/public/javascripts/.svn/all-wcprops Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
K 25
svn:wc:ra_dav:version-url
V 43
-/svn/!svn/ver/4060/trunk/public/javascripts
+/svn/!svn/ver/4222/trunk/public/javascripts
END
prototype.js
K 25
@@ -43,7 +43,7 @@
K 25
svn:wc:ra_dav:version-url
V 58
-/svn/!svn/ver/3879/trunk/public/javascripts/application.js
+/svn/!svn/ver/4222/trunk/public/javascripts/application.js
END
controls.js
K 25
diff -r 09b1d4349da3 -r 371eac10df0b public/javascripts/.svn/entries
--- a/public/javascripts/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/public/javascripts/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,15 +1,15 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/public/javascripts
http://redmine.rubyforge.org/svn
-2010-09-05T11:33:08.614151Z
-4060
-winterheart
+2010-09-28T21:09:06.467392Z
+4222
+edavis10
@@ -242,11 +242,11 @@
-2010-09-23T14:37:45.171796Z
-6645a3ecbb861b6ed2923565afa744aa
-2010-07-25T10:34:55.569539Z
-3879
-jplang
+2010-11-19T13:04:51.565792Z
+cff005d7bada484046dc85e1caaeebe2
+2010-09-28T21:09:06.467392Z
+4222
+edavis10
has-props
@@ -268,7 +268,7 @@
-6439
+6581
controls.js
file
diff -r 09b1d4349da3 -r 371eac10df0b public/javascripts/.svn/text-base/application.js.svn-base
--- a/public/javascripts/.svn/text-base/application.js.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/public/javascripts/.svn/text-base/application.js.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -17,6 +17,13 @@
for (i = 0; i < boxes.length; i++) { boxes[i].checked = !all_checked; }
}
+function setCheckboxesBySelector(checked, selector) {
+ var boxes = $$(selector);
+ boxes.each(function(ele) {
+ ele.checked = checked;
+ });
+}
+
function showAndScrollTo(id, focus) {
Element.show(id);
if (focus!=null) { Form.Element.focus(focus); }
@@ -56,7 +63,6 @@
dLabel.addClassName('inline');
// Pulls the languge value used for Optional Description
dLabel.update($('attachment_description_label_content').innerHTML)
-
p = document.getElementById("attachments_fields");
p.appendChild(document.createElement("br"));
p.appendChild(f);
diff -r 09b1d4349da3 -r 371eac10df0b public/javascripts/application.js
--- a/public/javascripts/application.js Thu Oct 21 11:19:14 2010 +0100
+++ b/public/javascripts/application.js Wed Nov 24 12:20:08 2010 +0000
@@ -17,6 +17,13 @@
for (i = 0; i < boxes.length; i++) { boxes[i].checked = !all_checked; }
}
+function setCheckboxesBySelector(checked, selector) {
+ var boxes = $$(selector);
+ boxes.each(function(ele) {
+ ele.checked = checked;
+ });
+}
+
function showAndScrollTo(id, focus) {
Element.show(id);
if (focus!=null) { Form.Element.focus(focus); }
@@ -56,7 +63,6 @@
dLabel.addClassName('inline');
// Pulls the languge value used for Optional Description
dLabel.update($('attachment_description_label_content').innerHTML)
-
p = document.getElementById("attachments_fields");
p.appendChild(document.createElement("br"));
p.appendChild(f);
diff -r 09b1d4349da3 -r 371eac10df0b public/javascripts/calendar/.svn/entries
--- a/public/javascripts/calendar/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/public/javascripts/calendar/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/public/javascripts/calendar
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b public/javascripts/calendar/lang/.svn/entries
--- a/public/javascripts/calendar/lang/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/public/javascripts/calendar/lang/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/public/javascripts/calendar/lang
http://redmine.rubyforge.org/svn
@@ -570,6 +570,40 @@
3845
+calendar-gl.js
+file
+
+
+
+
+2010-09-23T14:37:45.195758Z
+c4f74e36f6a3debcf8ec065bc6886f04
+2009-01-23T15:37:59.406714Z
+2296
+winterheart
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3855
+
calendar-en.js
file
@@ -604,40 +638,6 @@
3600
-calendar-gl.js
-file
-
-
-
-
-2010-09-23T14:37:45.195758Z
-c4f74e36f6a3debcf8ec065bc6886f04
-2009-01-23T15:37:59.406714Z
-2296
-winterheart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3855
-
calendar-fr.js
file
@@ -672,6 +672,74 @@
3870
+calendar-zh-tw.js
+file
+
+
+
+
+2010-09-23T14:37:45.203758Z
+0bed4c9c046772a12267b4118bf1504a
+2008-06-07T09:03:20.687527Z
+1498
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3841
+
+calendar-hr.js
+file
+
+
+
+
+2010-09-23T14:37:45.195758Z
+f8d0daa275cf612206c43d4c9be95d08
+2010-01-17T10:33:30.937961Z
+3320
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3646
+
calendar-nl.js
file
@@ -706,74 +774,6 @@
3701
-calendar-hr.js
-file
-
-
-
-
-2010-09-23T14:37:45.195758Z
-f8d0daa275cf612206c43d4c9be95d08
-2010-01-17T10:33:30.937961Z
-3320
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3646
-
-calendar-zh-tw.js
-file
-
-
-
-
-2010-09-23T14:37:45.203758Z
-0bed4c9c046772a12267b4118bf1504a
-2008-06-07T09:03:20.687527Z
-1498
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3841
-
calendar-mn.js
file
@@ -808,40 +808,6 @@
3904
-calendar-pl.js
-file
-
-
-
-
-2010-09-23T14:37:45.199778Z
-eabf711c28d30bb9474f3f505766f286
-2007-09-22T14:56:09.057923Z
-749
-jplang
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3974
-
calendar-th.js
file
@@ -876,6 +842,40 @@
4417
+calendar-pl.js
+file
+
+
+
+
+2010-09-23T14:37:45.199778Z
+eabf711c28d30bb9474f3f505766f286
+2007-09-22T14:56:09.057923Z
+749
+jplang
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3974
+
calendar-it.js
file
@@ -978,40 +978,6 @@
3909
-calendar-lv.js
-file
-
-
-
-
-2010-09-23T14:37:45.199778Z
-b260d88c13c01ebf4e7c94b9cb022930
-2010-05-14T18:15:41.754813Z
-3737
-winterheart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3803
-
calendar-zh.js
file
@@ -1046,6 +1012,40 @@
3600
+calendar-lv.js
+file
+
+
+
+
+2010-09-23T14:37:45.199778Z
+b260d88c13c01ebf4e7c94b9cb022930
+2010-05-14T18:15:41.754813Z
+3737
+winterheart
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3803
+
calendar-ca.js
file
diff -r 09b1d4349da3 -r 371eac10df0b public/javascripts/jstoolbar/.svn/entries
--- a/public/javascripts/jstoolbar/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/public/javascripts/jstoolbar/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/public/javascripts/jstoolbar
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b public/javascripts/jstoolbar/lang/.svn/entries
--- a/public/javascripts/jstoolbar/lang/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/public/javascripts/jstoolbar/lang/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/public/javascripts/jstoolbar/lang
http://redmine.rubyforge.org/svn
@@ -570,6 +570,74 @@
753
+jstoolbar-zh-tw.js
+file
+
+
+
+
+2010-09-23T14:37:45.239756Z
+be45a6e710f3a07e9fab41d795a64030
+2008-06-07T09:03:20.687527Z
+1498
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+716
+
+jstoolbar-hr.js
+file
+
+
+
+
+2010-09-23T14:37:45.231813Z
+f13f0553753c4b53bd96c294ca6ce15e
+2010-01-17T10:33:30.937961Z
+3320
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+721
+
jstoolbar-nl.js
file
@@ -604,74 +672,6 @@
753
-jstoolbar-hr.js
-file
-
-
-
-
-2010-09-23T14:37:45.231813Z
-f13f0553753c4b53bd96c294ca6ce15e
-2010-01-17T10:33:30.937961Z
-3320
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-721
-
-jstoolbar-zh-tw.js
-file
-
-
-
-
-2010-09-23T14:37:45.239756Z
-be45a6e710f3a07e9fab41d795a64030
-2008-06-07T09:03:20.687527Z
-1498
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-716
-
jstoolbar-mn.js
file
@@ -706,6 +706,40 @@
916
+jstoolbar-th.js
+file
+
+
+
+
+2010-09-23T14:37:45.239756Z
+3f844a6495d4eebb122b5c7b21696282
+2008-05-30T16:35:36.510811Z
+1479
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+931
+
jstoolbar-pl.js
file
@@ -740,40 +774,6 @@
851
-jstoolbar-th.js
-file
-
-
-
-
-2010-09-23T14:37:45.239756Z
-3f844a6495d4eebb122b5c7b21696282
-2008-05-30T16:35:36.510811Z
-1479
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-931
-
jstoolbar-it.js
file
@@ -876,40 +876,6 @@
754
-jstoolbar-lv.js
-file
-
-
-
-
-2010-09-23T14:37:45.235815Z
-5a44b7a9bd5b7db86d0a7398ee5bc779
-2010-05-14T18:15:41.754813Z
-3737
-winterheart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-836
-
jstoolbar-zh.js
file
@@ -944,6 +910,74 @@
722
+jstoolbar-lv.js
+file
+
+
+
+
+2010-09-23T14:37:45.235815Z
+5a44b7a9bd5b7db86d0a7398ee5bc779
+2010-05-14T18:15:41.754813Z
+3737
+winterheart
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+836
+
+jstoolbar-ca.js
+file
+
+
+
+
+2010-09-23T14:37:45.231813Z
+6aacb53ed49e6e14831baf8c38096662
+2008-09-15T16:07:30.857601Z
+1865
+winterheart
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+763
+
jstoolbar-pt.js
file
@@ -978,39 +1012,39 @@
823
-jstoolbar-ca.js
+jstoolbar-da.js
file
2010-09-23T14:37:45.231813Z
-6aacb53ed49e6e14831baf8c38096662
-2008-09-15T16:07:30.857601Z
-1865
-winterheart
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-763
+4061b38de5e085dac922f77f94bd254a
+2009-10-11T09:24:45.635758Z
+2921
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+746
jstoolbar-pt-br.js
file
@@ -1046,40 +1080,6 @@
819
-jstoolbar-da.js
-file
-
-
-
-
-2010-09-23T14:37:45.231813Z
-4061b38de5e085dac922f77f94bd254a
-2009-10-11T09:24:45.635758Z
-2921
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-746
-
jstoolbar-sr.js
file
diff -r 09b1d4349da3 -r 371eac10df0b public/stylesheets/.svn/all-wcprops
--- a/public/stylesheets/.svn/all-wcprops Thu Oct 21 11:19:14 2010 +0100
+++ b/public/stylesheets/.svn/all-wcprops Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
K 25
svn:wc:ra_dav:version-url
V 43
-/svn/!svn/ver/4072/trunk/public/stylesheets
+/svn/!svn/ver/4377/trunk/public/stylesheets
END
context_menu.css
K 25
@@ -49,5 +49,5 @@
K 25
svn:wc:ra_dav:version-url
V 59
-/svn/!svn/ver/4072/trunk/public/stylesheets/application.css
+/svn/!svn/ver/4377/trunk/public/stylesheets/application.css
END
diff -r 09b1d4349da3 -r 371eac10df0b public/stylesheets/.svn/entries
--- a/public/stylesheets/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/public/stylesheets/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,15 +1,15 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/public/stylesheets
http://redmine.rubyforge.org/svn
-2010-09-10T03:09:02.311267Z
-4072
-edavis10
+2010-11-06T18:52:07.556711Z
+4377
+jplang
@@ -271,9 +271,9 @@
-e6a7b38459368e48b9c463dadb2e9f5f
-2010-09-10T03:09:02.311267Z
-4072
-edavis10
+d7fddb955f6ccbe8119b5ba02b0fc466
+2010-11-06T18:52:07.556711Z
+4377
+jplang
has-props
diff -r 09b1d4349da3 -r 371eac10df0b public/stylesheets/.svn/text-base/application.css.svn-base
--- a/public/stylesheets/.svn/text-base/application.css.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/public/stylesheets/.svn/text-base/application.css.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -113,7 +113,7 @@
tr.project td.name a { white-space:nowrap; }
-tr.project.idnt td.name a {background: url(../images/bullet_arrow_right.png) no-repeat 0 50%; padding-left: 16px;}
+tr.project.idnt td.name span {background: url(../images/bullet_arrow_right.png) no-repeat 0 50%; padding-left: 16px;}
tr.project.idnt-1 td.name {padding-left: 0.5em;}
tr.project.idnt-2 td.name {padding-left: 2em;}
tr.project.idnt-3 td.name {padding-left: 3.5em;}
@@ -419,6 +419,7 @@
.tabular.settings textarea { width: 99%; }
fieldset.settings label { display: block; }
+.parent { padding-left: 20px; }
.required {color: #bb0000;}
.summary {font-style: italic;}
@@ -714,9 +715,10 @@
div.wiki ul.toc.right { float: right; margin-left: 12px; margin-right: 0; width: auto; }
div.wiki ul.toc.left { float: left; margin-right: 12px; margin-left: 0; width: auto; }
-div.wiki ul.toc li { list-style-type:none;}
-div.wiki ul.toc li.heading2 { margin-left: 6px; }
-div.wiki ul.toc li.heading3 { margin-left: 12px; font-size: 0.8em; }
+div.wiki ul.toc ul { margin: 0; padding: 0; }
+div.wiki ul.toc li { list-style-type:none; margin: 0;}
+div.wiki ul.toc li li { margin-left: 1.5em; }
+div.wiki ul.toc li li li { font-size: 0.8em; }
div.wiki ul.toc a {
font-size: 0.9em;
@@ -853,6 +855,8 @@
.icon-summary { background-image: url(../images/lightning.png); }
.icon-server-authentication { background-image: url(../images/server_key.png); }
.icon-issue { background-image: url(../images/ticket.png); }
+.icon-zoom-in { background-image: url(../images/zoom_in.png); }
+.icon-zoom-out { background-image: url(../images/zoom_out.png); }
.icon-file { background-image: url(../images/files/default.png); }
.icon-file.text-plain { background-image: url(../images/files/text.png); }
diff -r 09b1d4349da3 -r 371eac10df0b public/stylesheets/application.css
--- a/public/stylesheets/application.css Thu Oct 21 11:19:14 2010 +0100
+++ b/public/stylesheets/application.css Wed Nov 24 12:20:08 2010 +0000
@@ -113,7 +113,7 @@
tr.project td.name a { white-space:nowrap; }
-tr.project.idnt td.name a {background: url(../images/bullet_arrow_right.png) no-repeat 0 50%; padding-left: 16px;}
+tr.project.idnt td.name span {background: url(../images/bullet_arrow_right.png) no-repeat 0 50%; padding-left: 16px;}
tr.project.idnt-1 td.name {padding-left: 0.5em;}
tr.project.idnt-2 td.name {padding-left: 2em;}
tr.project.idnt-3 td.name {padding-left: 3.5em;}
@@ -419,6 +419,7 @@
.tabular.settings textarea { width: 99%; }
fieldset.settings label { display: block; }
+.parent { padding-left: 20px; }
.required {color: #bb0000;}
.summary {font-style: italic;}
@@ -714,9 +715,10 @@
div.wiki ul.toc.right { float: right; margin-left: 12px; margin-right: 0; width: auto; }
div.wiki ul.toc.left { float: left; margin-right: 12px; margin-left: 0; width: auto; }
-div.wiki ul.toc li { list-style-type:none;}
-div.wiki ul.toc li.heading2 { margin-left: 6px; }
-div.wiki ul.toc li.heading3 { margin-left: 12px; font-size: 0.8em; }
+div.wiki ul.toc ul { margin: 0; padding: 0; }
+div.wiki ul.toc li { list-style-type:none; margin: 0;}
+div.wiki ul.toc li li { margin-left: 1.5em; }
+div.wiki ul.toc li li li { font-size: 0.8em; }
div.wiki ul.toc a {
font-size: 0.9em;
@@ -853,6 +855,8 @@
.icon-summary { background-image: url(../images/lightning.png); }
.icon-server-authentication { background-image: url(../images/server_key.png); }
.icon-issue { background-image: url(../images/ticket.png); }
+.icon-zoom-in { background-image: url(../images/zoom_in.png); }
+.icon-zoom-out { background-image: url(../images/zoom_out.png); }
.icon-file { background-image: url(../images/files/default.png); }
.icon-file.text-plain { background-image: url(../images/files/text.png); }
diff -r 09b1d4349da3 -r 371eac10df0b public/themes/.svn/entries
--- a/public/themes/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/public/themes/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/public/themes
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b public/themes/alternate/.svn/entries
--- a/public/themes/alternate/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/public/themes/alternate/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/public/themes/alternate
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b public/themes/alternate/stylesheets/.svn/entries
--- a/public/themes/alternate/stylesheets/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/public/themes/alternate/stylesheets/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/public/themes/alternate/stylesheets
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b public/themes/classic/.svn/entries
--- a/public/themes/classic/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/public/themes/classic/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/public/themes/classic
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b public/themes/classic/images/.svn/entries
--- a/public/themes/classic/images/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/public/themes/classic/images/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/public/themes/classic/images
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b public/themes/classic/stylesheets/.svn/entries
--- a/public/themes/classic/stylesheets/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/public/themes/classic/stylesheets/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/public/themes/classic/stylesheets
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b script/.svn/all-wcprops
--- a/script/.svn/all-wcprops Thu Oct 21 11:19:14 2010 +0100
+++ b/script/.svn/all-wcprops Wed Nov 24 12:20:08 2010 +0000
@@ -1,59 +1,59 @@
K 25
svn:wc:ra_dav:version-url
V 31
-/svn/!svn/ver/2783/trunk/script
+/svn/!svn/ver/4359/trunk/script
END
console
K 25
svn:wc:ra_dav:version-url
-V 38
-/svn/!svn/ver/331/trunk/script/console
+V 39
+/svn/!svn/ver/4359/trunk/script/console
END
breakpointer
K 25
svn:wc:ra_dav:version-url
-V 43
-/svn/!svn/ver/331/trunk/script/breakpointer
+V 44
+/svn/!svn/ver/4359/trunk/script/breakpointer
END
server
K 25
svn:wc:ra_dav:version-url
-V 37
-/svn/!svn/ver/331/trunk/script/server
+V 38
+/svn/!svn/ver/4359/trunk/script/server
END
dbconsole
K 25
svn:wc:ra_dav:version-url
V 41
-/svn/!svn/ver/1623/trunk/script/dbconsole
+/svn/!svn/ver/4359/trunk/script/dbconsole
END
destroy
K 25
svn:wc:ra_dav:version-url
-V 38
-/svn/!svn/ver/331/trunk/script/destroy
+V 39
+/svn/!svn/ver/4359/trunk/script/destroy
END
runner
K 25
svn:wc:ra_dav:version-url
-V 37
-/svn/!svn/ver/331/trunk/script/runner
+V 38
+/svn/!svn/ver/4359/trunk/script/runner
END
about
K 25
svn:wc:ra_dav:version-url
V 37
-/svn/!svn/ver/2783/trunk/script/about
+/svn/!svn/ver/4359/trunk/script/about
END
generate
K 25
svn:wc:ra_dav:version-url
-V 39
-/svn/!svn/ver/331/trunk/script/generate
+V 40
+/svn/!svn/ver/4359/trunk/script/generate
END
plugin
K 25
svn:wc:ra_dav:version-url
-V 37
-/svn/!svn/ver/331/trunk/script/plugin
+V 38
+/svn/!svn/ver/4359/trunk/script/plugin
END
diff -r 09b1d4349da3 -r 371eac10df0b script/.svn/entries
--- a/script/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/script/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,15 +1,15 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/script
http://redmine.rubyforge.org/svn
-2009-06-07T18:22:27.408484Z
-2783
-edavis10
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
@@ -35,11 +35,11 @@
-2010-09-23T14:37:45.263770Z
-e9da4d9bd98b629d856b280caa927f42
-2007-03-12T17:29:04.309051Z
-331
-jplang
+2010-11-19T13:04:51.017028Z
+623b2f8265970f73bdb3489872d00eb6
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
has-props
@@ -61,7 +61,7 @@
-97
+104
breakpointer
file
@@ -69,11 +69,11 @@
-2010-09-23T14:37:45.263770Z
-efe05546991854cb1323026c0cdc7d27
-2007-03-12T17:29:04.309051Z
-331
-jplang
+2010-11-19T13:04:51.017028Z
+2ac529bf7a654b9b91b2fea2275aa44e
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
has-props
@@ -95,7 +95,7 @@
-102
+109
server
file
@@ -103,11 +103,11 @@
-2010-09-23T14:37:45.271755Z
-bba2905059daec6033f7a51cff19aff6
-2007-03-12T17:29:04.309051Z
-331
-jplang
+2010-11-19T13:04:51.017028Z
+ff97a702418dbc85fec089b97506281f
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
has-props
@@ -129,7 +129,7 @@
-96
+103
dbconsole
file
@@ -137,11 +137,11 @@
-2010-09-23T14:37:45.263770Z
-5a6a7708fafd8f806775405f2f33fe99
-2008-07-04T17:58:14.743502Z
-1623
-jplang
+2010-11-19T13:04:51.017028Z
+1fd5fa2d4aeee5b4111a40f62ae85446
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
has-props
@@ -163,7 +163,7 @@
-100
+106
destroy
file
@@ -171,11 +171,11 @@
-2010-09-23T14:37:45.263770Z
-f09bb329fb28e89340567a704a4619f8
-2007-03-12T17:29:04.309051Z
-331
-jplang
+2010-11-19T13:04:51.017028Z
+95866cb3b894816b540afd282b952618
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
has-props
@@ -197,7 +197,7 @@
-97
+104
runner
file
@@ -205,11 +205,11 @@
-2010-09-23T14:37:45.271755Z
-78522a2f43ce4bf932cf237076c0d2a1
-2007-03-12T17:29:04.309051Z
-331
-jplang
+2010-11-19T13:04:51.017028Z
+0cccc4eabf129ebd7b571d3eceda8893
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
has-props
@@ -231,7 +231,7 @@
-96
+103
about
file
@@ -239,11 +239,11 @@
-2010-09-23T14:37:45.263770Z
-a1b78de0b704be4cfa29b11cfbd35a5e
-2009-06-07T18:22:27.408484Z
-2783
-edavis10
+2010-11-19T13:04:51.017028Z
+b0aeca2e257a2226502c570e671e1b76
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
has-props
@@ -265,7 +265,7 @@
-187
+193
generate
file
@@ -273,11 +273,11 @@
-2010-09-23T14:37:45.267755Z
-ef69c53ee39f550f43a4bd3a09482ff7
-2007-03-12T17:29:04.309051Z
-331
-jplang
+2010-11-19T13:04:51.017028Z
+fb51df9bca94c25a928f40468354700f
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
has-props
@@ -299,7 +299,7 @@
-98
+105
process
dir
@@ -310,11 +310,11 @@
-2010-09-23T14:37:45.267755Z
-4c5aa44730cde119ab839486212f4ac5
-2007-03-12T17:29:04.309051Z
-331
-jplang
+2010-11-19T13:04:51.017028Z
+db0dd437d39c21fe52e1fc05a0680163
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
has-props
@@ -336,5 +336,5 @@
-96
+103
diff -r 09b1d4349da3 -r 371eac10df0b script/.svn/text-base/about.svn-base
--- a/script/.svn/text-base/about.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/script/.svn/text-base/about.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
+require File.expand_path('../../config/boot', __FILE__)
$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
require 'commands/about'
diff -r 09b1d4349da3 -r 371eac10df0b script/.svn/text-base/breakpointer.svn-base
--- a/script/.svn/text-base/breakpointer.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/script/.svn/text-base/breakpointer.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/breakpointer'
\ No newline at end of file
+require File.expand_path('../../config/boot', __FILE__)
+require 'commands/breakpointer'
diff -r 09b1d4349da3 -r 371eac10df0b script/.svn/text-base/console.svn-base
--- a/script/.svn/text-base/console.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/script/.svn/text-base/console.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/console'
\ No newline at end of file
+require File.expand_path('../../config/boot', __FILE__)
+require 'commands/console'
diff -r 09b1d4349da3 -r 371eac10df0b script/.svn/text-base/dbconsole.svn-base
--- a/script/.svn/text-base/dbconsole.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/script/.svn/text-base/dbconsole.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
+require File.expand_path('../../config/boot', __FILE__)
require 'commands/dbconsole'
diff -r 09b1d4349da3 -r 371eac10df0b script/.svn/text-base/destroy.svn-base
--- a/script/.svn/text-base/destroy.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/script/.svn/text-base/destroy.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/destroy'
\ No newline at end of file
+require File.expand_path('../../config/boot', __FILE__)
+require 'commands/destroy'
diff -r 09b1d4349da3 -r 371eac10df0b script/.svn/text-base/generate.svn-base
--- a/script/.svn/text-base/generate.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/script/.svn/text-base/generate.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/generate'
\ No newline at end of file
+require File.expand_path('../../config/boot', __FILE__)
+require 'commands/generate'
diff -r 09b1d4349da3 -r 371eac10df0b script/.svn/text-base/plugin.svn-base
--- a/script/.svn/text-base/plugin.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/script/.svn/text-base/plugin.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/plugin'
\ No newline at end of file
+require File.expand_path('../../config/boot', __FILE__)
+require 'commands/plugin'
diff -r 09b1d4349da3 -r 371eac10df0b script/.svn/text-base/runner.svn-base
--- a/script/.svn/text-base/runner.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/script/.svn/text-base/runner.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/runner'
\ No newline at end of file
+require File.expand_path('../../config/boot', __FILE__)
+require 'commands/runner'
diff -r 09b1d4349da3 -r 371eac10df0b script/.svn/text-base/server.svn-base
--- a/script/.svn/text-base/server.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/script/.svn/text-base/server.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/server'
\ No newline at end of file
+require File.expand_path('../../config/boot', __FILE__)
+require 'commands/server'
diff -r 09b1d4349da3 -r 371eac10df0b script/about
--- a/script/about Thu Oct 21 11:19:14 2010 +0100
+++ b/script/about Wed Nov 24 12:20:08 2010 +0000
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
+require File.expand_path('../../config/boot', __FILE__)
$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
require 'commands/about'
diff -r 09b1d4349da3 -r 371eac10df0b script/breakpointer
--- a/script/breakpointer Thu Oct 21 11:19:14 2010 +0100
+++ b/script/breakpointer Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/breakpointer'
\ No newline at end of file
+require File.expand_path('../../config/boot', __FILE__)
+require 'commands/breakpointer'
diff -r 09b1d4349da3 -r 371eac10df0b script/console
--- a/script/console Thu Oct 21 11:19:14 2010 +0100
+++ b/script/console Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/console'
\ No newline at end of file
+require File.expand_path('../../config/boot', __FILE__)
+require 'commands/console'
diff -r 09b1d4349da3 -r 371eac10df0b script/dbconsole
--- a/script/dbconsole Thu Oct 21 11:19:14 2010 +0100
+++ b/script/dbconsole Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
+require File.expand_path('../../config/boot', __FILE__)
require 'commands/dbconsole'
diff -r 09b1d4349da3 -r 371eac10df0b script/destroy
--- a/script/destroy Thu Oct 21 11:19:14 2010 +0100
+++ b/script/destroy Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/destroy'
\ No newline at end of file
+require File.expand_path('../../config/boot', __FILE__)
+require 'commands/destroy'
diff -r 09b1d4349da3 -r 371eac10df0b script/generate
--- a/script/generate Thu Oct 21 11:19:14 2010 +0100
+++ b/script/generate Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/generate'
\ No newline at end of file
+require File.expand_path('../../config/boot', __FILE__)
+require 'commands/generate'
diff -r 09b1d4349da3 -r 371eac10df0b script/performance/.svn/all-wcprops
--- a/script/performance/.svn/all-wcprops Thu Oct 21 11:19:14 2010 +0100
+++ b/script/performance/.svn/all-wcprops Wed Nov 24 12:20:08 2010 +0000
@@ -1,23 +1,23 @@
K 25
svn:wc:ra_dav:version-url
V 43
-/svn/!svn/ver/1623/trunk/script/performance
+/svn/!svn/ver/4359/trunk/script/performance
END
benchmarker
K 25
svn:wc:ra_dav:version-url
-V 54
-/svn/!svn/ver/331/trunk/script/performance/benchmarker
+V 55
+/svn/!svn/ver/4359/trunk/script/performance/benchmarker
END
profiler
K 25
svn:wc:ra_dav:version-url
-V 51
-/svn/!svn/ver/331/trunk/script/performance/profiler
+V 52
+/svn/!svn/ver/4359/trunk/script/performance/profiler
END
request
K 25
svn:wc:ra_dav:version-url
V 51
-/svn/!svn/ver/1623/trunk/script/performance/request
+/svn/!svn/ver/4359/trunk/script/performance/request
END
diff -r 09b1d4349da3 -r 371eac10df0b script/performance/.svn/entries
--- a/script/performance/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/script/performance/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,15 +1,15 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/script/performance
http://redmine.rubyforge.org/svn
-2008-07-04T17:58:14.743502Z
-1623
-jplang
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
@@ -32,11 +32,11 @@
-2010-09-23T14:37:45.267755Z
-91086af38733556c5aabc91eb4b20bed
-2007-03-12T17:29:04.309051Z
-331
-jplang
+2010-11-19T13:04:50.988983Z
+33063b7a3d4dbef12ac8bcb55a5e6e3e
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
has-props
@@ -58,7 +58,7 @@
-117
+123
profiler
file
@@ -66,11 +66,11 @@
-2010-09-23T14:37:45.267755Z
-4dd7faa9b0b5f678082e19c97852b005
-2007-03-12T17:29:04.309051Z
-331
-jplang
+2010-11-19T13:04:50.988983Z
+9d3b872769337c49e648b9fe47e4e280
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
has-props
@@ -92,7 +92,7 @@
-114
+120
request
file
@@ -100,11 +100,11 @@
-2010-09-23T14:37:45.267755Z
-9316140f20aace6cf628d17b5bfd1119
-2008-07-04T17:58:14.743502Z
-1623
-jplang
+2010-11-19T13:04:50.988983Z
+b6500710f6029724e44cbd25f80eaaf1
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
has-props
@@ -126,5 +126,5 @@
-113
+116
diff -r 09b1d4349da3 -r 371eac10df0b script/performance/.svn/text-base/benchmarker.svn-base
--- a/script/performance/.svn/text-base/benchmarker.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/script/performance/.svn/text-base/benchmarker.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
+require File.expand_path('../../../config/boot', __FILE__)
require 'commands/performance/benchmarker'
diff -r 09b1d4349da3 -r 371eac10df0b script/performance/.svn/text-base/profiler.svn-base
--- a/script/performance/.svn/text-base/profiler.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/script/performance/.svn/text-base/profiler.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
+require File.expand_path('../../../config/boot', __FILE__)
require 'commands/performance/profiler'
diff -r 09b1d4349da3 -r 371eac10df0b script/performance/.svn/text-base/request.svn-base
--- a/script/performance/.svn/text-base/request.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/script/performance/.svn/text-base/request.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
+require File.expand_path('../../config/boot', __FILE__)
require 'commands/performance/request'
diff -r 09b1d4349da3 -r 371eac10df0b script/performance/benchmarker
--- a/script/performance/benchmarker Thu Oct 21 11:19:14 2010 +0100
+++ b/script/performance/benchmarker Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
+require File.expand_path('../../../config/boot', __FILE__)
require 'commands/performance/benchmarker'
diff -r 09b1d4349da3 -r 371eac10df0b script/performance/profiler
--- a/script/performance/profiler Thu Oct 21 11:19:14 2010 +0100
+++ b/script/performance/profiler Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
+require File.expand_path('../../../config/boot', __FILE__)
require 'commands/performance/profiler'
diff -r 09b1d4349da3 -r 371eac10df0b script/performance/request
--- a/script/performance/request Thu Oct 21 11:19:14 2010 +0100
+++ b/script/performance/request Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
+require File.expand_path('../../config/boot', __FILE__)
require 'commands/performance/request'
diff -r 09b1d4349da3 -r 371eac10df0b script/plugin
--- a/script/plugin Thu Oct 21 11:19:14 2010 +0100
+++ b/script/plugin Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/plugin'
\ No newline at end of file
+require File.expand_path('../../config/boot', __FILE__)
+require 'commands/plugin'
diff -r 09b1d4349da3 -r 371eac10df0b script/process/.svn/all-wcprops
--- a/script/process/.svn/all-wcprops Thu Oct 21 11:19:14 2010 +0100
+++ b/script/process/.svn/all-wcprops Wed Nov 24 12:20:08 2010 +0000
@@ -1,29 +1,29 @@
K 25
svn:wc:ra_dav:version-url
V 39
-/svn/!svn/ver/1623/trunk/script/process
+/svn/!svn/ver/4359/trunk/script/process
END
spawner
K 25
svn:wc:ra_dav:version-url
-V 46
-/svn/!svn/ver/331/trunk/script/process/spawner
+V 47
+/svn/!svn/ver/4359/trunk/script/process/spawner
END
inspector
K 25
svn:wc:ra_dav:version-url
V 49
-/svn/!svn/ver/1623/trunk/script/process/inspector
+/svn/!svn/ver/4359/trunk/script/process/inspector
END
reaper
K 25
svn:wc:ra_dav:version-url
-V 45
-/svn/!svn/ver/331/trunk/script/process/reaper
+V 46
+/svn/!svn/ver/4359/trunk/script/process/reaper
END
spinner
K 25
svn:wc:ra_dav:version-url
-V 46
-/svn/!svn/ver/331/trunk/script/process/spinner
+V 47
+/svn/!svn/ver/4359/trunk/script/process/spinner
END
diff -r 09b1d4349da3 -r 371eac10df0b script/process/.svn/entries
--- a/script/process/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/script/process/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,15 +1,15 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/script/process
http://redmine.rubyforge.org/svn
-2008-07-04T17:58:14.743502Z
-1623
-jplang
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
@@ -32,11 +32,11 @@
-2010-09-23T14:37:45.271755Z
-e7e52ded28489a821b5eb156f92ca0f5
-2007-03-12T17:29:04.309051Z
-331
-jplang
+2010-11-19T13:04:51.012938Z
+47bf41d8d2c97d220d9f70916e94c651
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
has-props
@@ -58,7 +58,7 @@
-109
+112
inspector
file
@@ -66,11 +66,11 @@
-2010-09-23T14:37:45.271755Z
-73662c6991e4d3ea2332b5fcadd5b3d3
-2008-07-04T17:58:14.743502Z
-1623
-jplang
+2010-11-19T13:04:51.012938Z
+9137857ebdaf61d57a3496f7e61fede3
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
has-props
@@ -92,7 +92,7 @@
-111
+114
reaper
file
@@ -100,11 +100,11 @@
-2010-09-23T14:37:45.271755Z
-77608fa9e09e9f24410e7374c67956b7
-2007-03-12T17:29:04.309051Z
-331
-jplang
+2010-11-19T13:04:51.012938Z
+99af2666610d48d13e2eeceacf487d16
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
has-props
@@ -126,7 +126,7 @@
-108
+111
spinner
file
@@ -134,11 +134,11 @@
-2010-09-23T14:37:45.271755Z
-69800f080d6bdd2f06c76c32f23c2c86
-2007-03-12T17:29:04.309051Z
-331
-jplang
+2010-11-19T13:04:51.012938Z
+64b5316e88e7555bf827ad04edbce4a6
+2010-11-02T00:20:21.419252Z
+4359
+jbbarth
has-props
@@ -160,5 +160,5 @@
-109
+112
diff -r 09b1d4349da3 -r 371eac10df0b script/process/.svn/text-base/inspector.svn-base
--- a/script/process/.svn/text-base/inspector.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/script/process/.svn/text-base/inspector.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
+require File.expand_path('../../config/boot', __FILE__)
require 'commands/process/inspector'
diff -r 09b1d4349da3 -r 371eac10df0b script/process/.svn/text-base/reaper.svn-base
--- a/script/process/.svn/text-base/reaper.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/script/process/.svn/text-base/reaper.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
+require File.expand_path('../../config/boot', __FILE__)
require 'commands/process/reaper'
diff -r 09b1d4349da3 -r 371eac10df0b script/process/.svn/text-base/spawner.svn-base
--- a/script/process/.svn/text-base/spawner.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/script/process/.svn/text-base/spawner.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
+require File.expand_path('../../config/boot', __FILE__)
require 'commands/process/spawner'
diff -r 09b1d4349da3 -r 371eac10df0b script/process/.svn/text-base/spinner.svn-base
--- a/script/process/.svn/text-base/spinner.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/script/process/.svn/text-base/spinner.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
+require File.expand_path('../../config/boot', __FILE__)
require 'commands/process/spinner'
diff -r 09b1d4349da3 -r 371eac10df0b script/process/inspector
--- a/script/process/inspector Thu Oct 21 11:19:14 2010 +0100
+++ b/script/process/inspector Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
+require File.expand_path('../../config/boot', __FILE__)
require 'commands/process/inspector'
diff -r 09b1d4349da3 -r 371eac10df0b script/process/reaper
--- a/script/process/reaper Thu Oct 21 11:19:14 2010 +0100
+++ b/script/process/reaper Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
+require File.expand_path('../../config/boot', __FILE__)
require 'commands/process/reaper'
diff -r 09b1d4349da3 -r 371eac10df0b script/process/spawner
--- a/script/process/spawner Thu Oct 21 11:19:14 2010 +0100
+++ b/script/process/spawner Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
+require File.expand_path('../../config/boot', __FILE__)
require 'commands/process/spawner'
diff -r 09b1d4349da3 -r 371eac10df0b script/process/spinner
--- a/script/process/spinner Thu Oct 21 11:19:14 2010 +0100
+++ b/script/process/spinner Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
+require File.expand_path('../../config/boot', __FILE__)
require 'commands/process/spinner'
diff -r 09b1d4349da3 -r 371eac10df0b script/runner
--- a/script/runner Thu Oct 21 11:19:14 2010 +0100
+++ b/script/runner Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/runner'
\ No newline at end of file
+require File.expand_path('../../config/boot', __FILE__)
+require 'commands/runner'
diff -r 09b1d4349da3 -r 371eac10df0b script/server
--- a/script/server Thu Oct 21 11:19:14 2010 +0100
+++ b/script/server Wed Nov 24 12:20:08 2010 +0000
@@ -1,3 +1,3 @@
#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/server'
\ No newline at end of file
+require File.expand_path('../../config/boot', __FILE__)
+require 'commands/server'
diff -r 09b1d4349da3 -r 371eac10df0b test/.svn/all-wcprops
--- a/test/.svn/all-wcprops Thu Oct 21 11:19:14 2010 +0100
+++ b/test/.svn/all-wcprops Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
K 25
svn:wc:ra_dav:version-url
V 29
-/svn/!svn/ver/4172/trunk/test
+/svn/!svn/ver/4411/trunk/test
END
object_daddy_helpers.rb
K 25
@@ -13,7 +13,7 @@
K 25
svn:wc:ra_dav:version-url
V 44
-/svn/!svn/ver/4010/trunk/test/test_helper.rb
+/svn/!svn/ver/4366/trunk/test/test_helper.rb
END
helper_testcase.rb
K 25
diff -r 09b1d4349da3 -r 371eac10df0b test/.svn/entries
--- a/test/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,15 +1,15 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test
http://redmine.rubyforge.org/svn
-2010-09-23T15:20:19.085385Z
-4172
-edavis10
+2010-11-17T18:27:38.712585Z
+4411
+jplang
@@ -72,10 +72,10 @@
-2010-09-23T14:37:45.443777Z
-ac78351cc24dae03cb70f9e4bd9163fa
-2010-08-19T22:24:42.251508Z
-4010
+2010-11-19T13:04:46.868876Z
+cc87df32bc2794f57f75ec6b0ed7e373
+2010-11-05T17:49:20.446583Z
+4366
edavis10
has-props
@@ -98,7 +98,7 @@
-6789
+16405
functional
dir
diff -r 09b1d4349da3 -r 371eac10df0b test/.svn/text-base/test_helper.rb.svn-base
--- a/test/.svn/text-base/test_helper.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/.svn/text-base/test_helper.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -113,11 +113,15 @@
def self.repository_configured?(vendor)
File.directory?(repository_path(vendor))
end
+
+ def assert_error_tag(options={})
+ assert_tag({:tag => 'p', :attributes => { :id => 'errorExplanation' }}.merge(options))
+ end
# Shoulda macros
def self.should_render_404
should_respond_with :not_found
- should_render_template 'common/404'
+ should_render_template 'common/error'
end
def self.should_have_before_filter(expected_method, options = {})
@@ -181,4 +185,236 @@
assert !user.new_record?
end
end
+
+ # Test that a request allows the three types of API authentication
+ #
+ # * HTTP Basic with username and password
+ # * HTTP Basic with an api key for the username
+ # * Key based with the key=X parameter
+ #
+ # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
+ # @param [String] url the request url
+ # @param [optional, Hash] parameters additional request parameters
+ # @param [optional, Hash] options additional options
+ # @option options [Symbol] :success_code Successful response code (:success)
+ # @option options [Symbol] :failure_code Failure response code (:unauthorized)
+ def self.should_allow_api_authentication(http_method, url, parameters={}, options={})
+ should_allow_http_basic_auth_with_username_and_password(http_method, url, parameters, options)
+ should_allow_http_basic_auth_with_key(http_method, url, parameters, options)
+ should_allow_key_based_auth(http_method, url, parameters, options)
+ end
+
+ # Test that a request allows the username and password for HTTP BASIC
+ #
+ # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
+ # @param [String] url the request url
+ # @param [optional, Hash] parameters additional request parameters
+ # @param [optional, Hash] options additional options
+ # @option options [Symbol] :success_code Successful response code (:success)
+ # @option options [Symbol] :failure_code Failure response code (:unauthorized)
+ def self.should_allow_http_basic_auth_with_username_and_password(http_method, url, parameters={}, options={})
+ success_code = options[:success_code] || :success
+ failure_code = options[:failure_code] || :unauthorized
+
+ context "should allow http basic auth using a username and password for #{http_method} #{url}" do
+ context "with a valid HTTP authentication" do
+ setup do
+ @user = User.generate_with_protected!(:password => 'my_password', :password_confirmation => 'my_password', :admin => true) # Admin so they can access the project
+ @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'my_password')
+ send(http_method, url, parameters, {:authorization => @authorization})
+ end
+
+ should_respond_with success_code
+ should_respond_with_content_type_based_on_url(url)
+ should "login as the user" do
+ assert_equal @user, User.current
+ end
+ end
+
+ context "with an invalid HTTP authentication" do
+ setup do
+ @user = User.generate_with_protected!
+ @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'wrong_password')
+ send(http_method, url, parameters, {:authorization => @authorization})
+ end
+
+ should_respond_with failure_code
+ should_respond_with_content_type_based_on_url(url)
+ should "not login as the user" do
+ assert_equal User.anonymous, User.current
+ end
+ end
+
+ context "without credentials" do
+ setup do
+ send(http_method, url, parameters, {:authorization => ''})
+ end
+
+ should_respond_with failure_code
+ should_respond_with_content_type_based_on_url(url)
+ should "include_www_authenticate_header" do
+ assert @controller.response.headers.has_key?('WWW-Authenticate')
+ end
+ end
+ end
+
+ end
+
+ # Test that a request allows the API key with HTTP BASIC
+ #
+ # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
+ # @param [String] url the request url
+ # @param [optional, Hash] parameters additional request parameters
+ # @param [optional, Hash] options additional options
+ # @option options [Symbol] :success_code Successful response code (:success)
+ # @option options [Symbol] :failure_code Failure response code (:unauthorized)
+ def self.should_allow_http_basic_auth_with_key(http_method, url, parameters={}, options={})
+ success_code = options[:success_code] || :success
+ failure_code = options[:failure_code] || :unauthorized
+
+ context "should allow http basic auth with a key for #{http_method} #{url}" do
+ context "with a valid HTTP authentication using the API token" do
+ setup do
+ @user = User.generate_with_protected!(:admin => true)
+ @token = Token.generate!(:user => @user, :action => 'api')
+ @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'X')
+ send(http_method, url, parameters, {:authorization => @authorization})
+ end
+
+ should_respond_with success_code
+ should_respond_with_content_type_based_on_url(url)
+ should_be_a_valid_response_string_based_on_url(url)
+ should "login as the user" do
+ assert_equal @user, User.current
+ end
+ end
+
+ context "with an invalid HTTP authentication" do
+ setup do
+ @user = User.generate_with_protected!
+ @token = Token.generate!(:user => @user, :action => 'feeds')
+ @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'X')
+ send(http_method, url, parameters, {:authorization => @authorization})
+ end
+
+ should_respond_with failure_code
+ should_respond_with_content_type_based_on_url(url)
+ should "not login as the user" do
+ assert_equal User.anonymous, User.current
+ end
+ end
+ end
+ end
+
+ # Test that a request allows full key authentication
+ #
+ # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
+ # @param [String] url the request url, without the key=ZXY parameter
+ # @param [optional, Hash] parameters additional request parameters
+ # @param [optional, Hash] options additional options
+ # @option options [Symbol] :success_code Successful response code (:success)
+ # @option options [Symbol] :failure_code Failure response code (:unauthorized)
+ def self.should_allow_key_based_auth(http_method, url, parameters={}, options={})
+ success_code = options[:success_code] || :success
+ failure_code = options[:failure_code] || :unauthorized
+
+ context "should allow key based auth using key=X for #{http_method} #{url}" do
+ context "with a valid api token" do
+ setup do
+ @user = User.generate_with_protected!(:admin => true)
+ @token = Token.generate!(:user => @user, :action => 'api')
+ # Simple url parse to add on ?key= or &key=
+ request_url = if url.match(/\?/)
+ url + "&key=#{@token.value}"
+ else
+ url + "?key=#{@token.value}"
+ end
+ send(http_method, request_url, parameters)
+ end
+
+ should_respond_with success_code
+ should_respond_with_content_type_based_on_url(url)
+ should_be_a_valid_response_string_based_on_url(url)
+ should "login as the user" do
+ assert_equal @user, User.current
+ end
+ end
+
+ context "with an invalid api token" do
+ setup do
+ @user = User.generate_with_protected!
+ @token = Token.generate!(:user => @user, :action => 'feeds')
+ # Simple url parse to add on ?key= or &key=
+ request_url = if url.match(/\?/)
+ url + "&key=#{@token.value}"
+ else
+ url + "?key=#{@token.value}"
+ end
+ send(http_method, request_url, parameters)
+ end
+
+ should_respond_with failure_code
+ should_respond_with_content_type_based_on_url(url)
+ should "not login as the user" do
+ assert_equal User.anonymous, User.current
+ end
+ end
+ end
+
+ end
+
+ # Uses should_respond_with_content_type based on what's in the url:
+ #
+ # '/project/issues.xml' => should_respond_with_content_type :xml
+ # '/project/issues.json' => should_respond_with_content_type :json
+ #
+ # @param [String] url Request
+ def self.should_respond_with_content_type_based_on_url(url)
+ case
+ when url.match(/xml/i)
+ should_respond_with_content_type :xml
+ when url.match(/json/i)
+ should_respond_with_content_type :json
+ else
+ raise "Unknown content type for should_respond_with_content_type_based_on_url: #{url}"
+ end
+
+ end
+
+ # Uses the url to assert which format the response should be in
+ #
+ # '/project/issues.xml' => should_be_a_valid_xml_string
+ # '/project/issues.json' => should_be_a_valid_json_string
+ #
+ # @param [String] url Request
+ def self.should_be_a_valid_response_string_based_on_url(url)
+ case
+ when url.match(/xml/i)
+ should_be_a_valid_xml_string
+ when url.match(/json/i)
+ should_be_a_valid_json_string
+ else
+ raise "Unknown content type for should_be_a_valid_response_based_on_url: #{url}"
+ end
+
+ end
+
+ # Checks that the response is a valid JSON string
+ def self.should_be_a_valid_json_string
+ should "be a valid JSON string (or empty)" do
+ assert (response.body.blank? || ActiveSupport::JSON.decode(response.body))
+ end
+ end
+
+ # Checks that the response is a valid XML string
+ def self.should_be_a_valid_xml_string
+ should "be a valid XML string" do
+ assert REXML::Document.new(response.body)
+ end
+ end
+
end
+
+# Simple module to "namespace" all of the API tests
+module ApiTest
+end
diff -r 09b1d4349da3 -r 371eac10df0b test/exemplars/.svn/all-wcprops
--- a/test/exemplars/.svn/all-wcprops Thu Oct 21 11:19:14 2010 +0100
+++ b/test/exemplars/.svn/all-wcprops Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
K 25
svn:wc:ra_dav:version-url
V 39
-/svn/!svn/ver/4010/trunk/test/exemplars
+/svn/!svn/ver/4406/trunk/test/exemplars
END
message_exemplar.rb
K 25
@@ -79,7 +79,7 @@
K 25
svn:wc:ra_dav:version-url
V 59
-/svn/!svn/ver/3759/trunk/test/exemplars/project_exemplar.rb
+/svn/!svn/ver/4406/trunk/test/exemplars/project_exemplar.rb
END
custom_value_exemplar.rb
K 25
@@ -135,17 +135,23 @@
V 57
/svn/!svn/ver/3340/trunk/test/exemplars/board_exemplar.rb
END
+member_role_exemplar.rb
+K 25
+svn:wc:ra_dav:version-url
+V 63
+/svn/!svn/ver/3340/trunk/test/exemplars/member_role_exemplar.rb
+END
issue_exemplar.rb
K 25
svn:wc:ra_dav:version-url
V 57
/svn/!svn/ver/3398/trunk/test/exemplars/issue_exemplar.rb
END
-member_role_exemplar.rb
+tracker_exemplar.rb
K 25
svn:wc:ra_dav:version-url
-V 63
-/svn/!svn/ver/3340/trunk/test/exemplars/member_role_exemplar.rb
+V 59
+/svn/!svn/ver/2930/trunk/test/exemplars/tracker_exemplar.rb
END
issue_status_exemplar.rb
K 25
@@ -153,11 +159,11 @@
V 64
/svn/!svn/ver/2930/trunk/test/exemplars/issue_status_exemplar.rb
END
-tracker_exemplar.rb
+time_entry_activity.rb
K 25
svn:wc:ra_dav:version-url
-V 59
-/svn/!svn/ver/2930/trunk/test/exemplars/tracker_exemplar.rb
+V 62
+/svn/!svn/ver/2930/trunk/test/exemplars/time_entry_activity.rb
END
subversion_repository_exemplar.rb
K 25
@@ -165,11 +171,11 @@
V 73
/svn/!svn/ver/3340/trunk/test/exemplars/subversion_repository_exemplar.rb
END
-time_entry_activity.rb
+role_exemplar.rb
K 25
svn:wc:ra_dav:version-url
-V 62
-/svn/!svn/ver/2930/trunk/test/exemplars/time_entry_activity.rb
+V 56
+/svn/!svn/ver/2930/trunk/test/exemplars/role_exemplar.rb
END
changeset_exemplar.rb
K 25
@@ -177,12 +183,6 @@
V 61
/svn/!svn/ver/3340/trunk/test/exemplars/changeset_exemplar.rb
END
-role_exemplar.rb
-K 25
-svn:wc:ra_dav:version-url
-V 56
-/svn/!svn/ver/2930/trunk/test/exemplars/role_exemplar.rb
-END
comment_exemplar.rb
K 25
svn:wc:ra_dav:version-url
@@ -211,7 +211,7 @@
K 25
svn:wc:ra_dav:version-url
V 56
-/svn/!svn/ver/3010/trunk/test/exemplars/user_exemplar.rb
+/svn/!svn/ver/4218/trunk/test/exemplars/user_exemplar.rb
END
time_entry_exemplar.rb
K 25
diff -r 09b1d4349da3 -r 371eac10df0b test/exemplars/.svn/entries
--- a/test/exemplars/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/exemplars/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,15 +1,15 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test/exemplars
http://redmine.rubyforge.org/svn
-2010-08-19T22:24:42.251508Z
-4010
-edavis10
+2010-11-14T16:24:21.989522Z
+4406
+jplang
@@ -440,33 +440,33 @@
-2010-09-23T14:37:45.291809Z
-0b0e9ab56f34b8d5f3fd7265d2dd4ffe
-2010-05-27T17:16:05.103190Z
-3759
-edavis10
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-816
+2010-11-19T13:04:41.365641Z
+9be3a10325013fa24b00903db30d1ca3
+2010-11-14T16:24:21.989522Z
+4406
+jplang
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+810
custom_value_exemplar.rb
file
@@ -774,6 +774,40 @@
481
+issue_exemplar.rb
+file
+
+
+
+
+2010-09-23T14:37:45.287807Z
+92ac53d6b3a2e00ae1a9e0e4bc5d548b
+2010-02-08T18:53:12.750770Z
+3398
+edavis10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+449
+
member_role_exemplar.rb
file
@@ -808,16 +842,16 @@
250
-issue_exemplar.rb
+issue_status_exemplar.rb
file
2010-09-23T14:37:45.287807Z
-92ac53d6b3a2e00ae1a9e0e4bc5d548b
-2010-02-08T18:53:12.750770Z
-3398
+d17dfd87c9c081965089712a4ce42a6d
+2009-10-18T22:25:00.956502Z
+2930
edavis10
@@ -840,7 +874,7 @@
-449
+182
tracker_exemplar.rb
file
@@ -876,16 +910,16 @@
179
-issue_status_exemplar.rb
+subversion_repository_exemplar.rb
file
-2010-09-23T14:37:45.287807Z
-d17dfd87c9c081965089712a4ce42a6d
-2009-10-18T22:25:00.956502Z
-2930
+2010-09-23T14:37:45.291809Z
+908d8689f3ff469978b8af8bb55084b4
+2010-01-27T18:29:03.119133Z
+3340
edavis10
@@ -908,7 +942,7 @@
-182
+235
time_entry_activity.rb
file
@@ -944,14 +978,14 @@
236
-subversion_repository_exemplar.rb
+changeset_exemplar.rb
file
-2010-09-23T14:37:45.291809Z
-908d8689f3ff469978b8af8bb55084b4
+2010-09-23T14:37:45.287807Z
+c01820cc719616bb5a0895cfddb40798
2010-01-27T18:29:03.119133Z
3340
edavis10
@@ -976,7 +1010,7 @@
-235
+377
role_exemplar.rb
file
@@ -1012,40 +1046,6 @@
157
-changeset_exemplar.rb
-file
-
-
-
-
-2010-09-23T14:37:45.287807Z
-c01820cc719616bb5a0895cfddb40798
-2010-01-27T18:29:03.119133Z
-3340
-edavis10
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-377
-
comment_exemplar.rb
file
@@ -1188,10 +1188,10 @@
-2010-09-23T14:37:45.291809Z
-c4ea7f6c706d04e3ef3f809e37867766
-2009-11-05T21:32:26.784578Z
-3010
+2010-11-19T13:04:41.365641Z
+44278bb3b28eed2566aab063777becf7
+2010-09-28T18:22:10.512346Z
+4218
edavis10
@@ -1214,7 +1214,7 @@
-648
+650
time_entry_exemplar.rb
file
diff -r 09b1d4349da3 -r 371eac10df0b test/exemplars/.svn/text-base/project_exemplar.rb.svn-base
--- a/test/exemplars/.svn/text-base/project_exemplar.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/exemplars/.svn/text-base/project_exemplar.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -18,7 +18,7 @@
end
def self.all_modules
- returning [] do |modules|
+ [].tap do |modules|
Redmine::AccessControl.available_project_modules.each do |name|
modules << EnabledModule.new(:name => name.to_s)
end
diff -r 09b1d4349da3 -r 371eac10df0b test/exemplars/.svn/text-base/user_exemplar.rb.svn-base
--- a/test/exemplars/.svn/text-base/user_exemplar.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/exemplars/.svn/text-base/user_exemplar.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -3,7 +3,7 @@
generator_for :mail, :method => :next_email
generator_for :firstname, :method => :next_firstname
generator_for :lastname, :method => :next_lastname
-
+
def self.next_login
@gen_login ||= 'user1'
@gen_login.succ!
diff -r 09b1d4349da3 -r 371eac10df0b test/exemplars/project_exemplar.rb
--- a/test/exemplars/project_exemplar.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/exemplars/project_exemplar.rb Wed Nov 24 12:20:08 2010 +0000
@@ -18,7 +18,7 @@
end
def self.all_modules
- returning [] do |modules|
+ [].tap do |modules|
Redmine::AccessControl.available_project_modules.each do |name|
modules << EnabledModule.new(:name => name.to_s)
end
diff -r 09b1d4349da3 -r 371eac10df0b test/exemplars/user_exemplar.rb
--- a/test/exemplars/user_exemplar.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/exemplars/user_exemplar.rb Wed Nov 24 12:20:08 2010 +0000
@@ -3,7 +3,7 @@
generator_for :mail, :method => :next_email
generator_for :firstname, :method => :next_firstname
generator_for :lastname, :method => :next_lastname
-
+
def self.next_login
@gen_login ||= 'user1'
@gen_login.succ!
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/.svn/all-wcprops
--- a/test/fixtures/.svn/all-wcprops Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/.svn/all-wcprops Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
K 25
svn:wc:ra_dav:version-url
V 38
-/svn/!svn/ver/4013/trunk/test/fixtures
+/svn/!svn/ver/4404/trunk/test/fixtures
END
journal_details.yml
K 25
@@ -61,7 +61,7 @@
K 25
svn:wc:ra_dav:version-url
V 56
-/svn/!svn/ver/3112/trunk/test/fixtures/custom_values.yml
+/svn/!svn/ver/4382/trunk/test/fixtures/custom_values.yml
END
issue_categories.yml
K 25
@@ -105,23 +105,17 @@
V 50
/svn/!svn/ver/2895/trunk/test/fixtures/changes.yml
END
-enumerations.yml
-K 25
-svn:wc:ra_dav:version-url
-V 55
-/svn/!svn/ver/3573/trunk/test/fixtures/enumerations.yml
-END
custom_fields_projects.yml
K 25
svn:wc:ra_dav:version-url
V 65
/svn/!svn/ver/3278/trunk/test/fixtures/custom_fields_projects.yml
END
-issues.yml
+enumerations.yml
K 25
svn:wc:ra_dav:version-url
-V 49
-/svn/!svn/ver/3663/trunk/test/fixtures/issues.yml
+V 55
+/svn/!svn/ver/3573/trunk/test/fixtures/enumerations.yml
END
member_roles.yml
K 25
@@ -129,23 +123,35 @@
V 55
/svn/!svn/ver/3250/trunk/test/fixtures/member_roles.yml
END
+issues.yml
+K 25
+svn:wc:ra_dav:version-url
+V 49
+/svn/!svn/ver/4186/trunk/test/fixtures/issues.yml
+END
queries.yml
K 25
svn:wc:ra_dav:version-url
V 50
/svn/!svn/ver/3071/trunk/test/fixtures/queries.yml
END
+watchers.yml
+K 25
+svn:wc:ra_dav:version-url
+V 51
+/svn/!svn/ver/2456/trunk/test/fixtures/watchers.yml
+END
wiki_contents.yml
K 25
svn:wc:ra_dav:version-url
V 56
/svn/!svn/ver/3412/trunk/test/fixtures/wiki_contents.yml
END
-watchers.yml
+enabled_modules.yml
K 25
svn:wc:ra_dav:version-url
-V 51
-/svn/!svn/ver/2456/trunk/test/fixtures/watchers.yml
+V 58
+/svn/!svn/ver/4013/trunk/test/fixtures/enabled_modules.yml
END
wiki_pages.yml
K 25
@@ -153,11 +159,11 @@
V 53
/svn/!svn/ver/3412/trunk/test/fixtures/wiki_pages.yml
END
-enabled_modules.yml
+wiki_content_versions.yml
K 25
svn:wc:ra_dav:version-url
-V 58
-/svn/!svn/ver/4013/trunk/test/fixtures/enabled_modules.yml
+V 64
+/svn/!svn/ver/2895/trunk/test/fixtures/wiki_content_versions.yml
END
comments.yml
K 25
@@ -165,30 +171,24 @@
V 51
/svn/!svn/ver/2895/trunk/test/fixtures/comments.yml
END
-wiki_content_versions.yml
-K 25
-svn:wc:ra_dav:version-url
-V 64
-/svn/!svn/ver/2895/trunk/test/fixtures/wiki_content_versions.yml
-END
members.yml
K 25
svn:wc:ra_dav:version-url
V 50
/svn/!svn/ver/3250/trunk/test/fixtures/members.yml
END
+workflows.yml
+K 25
+svn:wc:ra_dav:version-url
+V 52
+/svn/!svn/ver/2895/trunk/test/fixtures/workflows.yml
+END
journals.yml
K 25
svn:wc:ra_dav:version-url
V 51
/svn/!svn/ver/3123/trunk/test/fixtures/journals.yml
END
-workflows.yml
-K 25
-svn:wc:ra_dav:version-url
-V 52
-/svn/!svn/ver/2895/trunk/test/fixtures/workflows.yml
-END
custom_fields.yml
K 25
svn:wc:ra_dav:version-url
@@ -199,7 +199,7 @@
K 25
svn:wc:ra_dav:version-url
V 48
-/svn/!svn/ver/3024/trunk/test/fixtures/users.yml
+/svn/!svn/ver/4216/trunk/test/fixtures/users.yml
END
auth_sources.yml
K 25
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/.svn/entries
--- a/test/fixtures/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,15 +1,15 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test/fixtures
http://redmine.rubyforge.org/svn
-2010-08-22T18:42:00.112555Z
-4013
-edavis10
+2010-11-14T13:48:01.671461Z
+4404
+jplang
@@ -313,10 +313,10 @@
-2010-09-23T14:37:45.319762Z
-7c37bf142019bf7e3d15cb2f10c6c5ba
-2009-12-02T18:57:17.339733Z
-3112
+2010-11-19T13:04:46.864726Z
+4d480d87e42663a5e874353649c86039
+2010-11-07T14:15:01.891476Z
+4382
jplang
has-props
@@ -339,7 +339,7 @@
-1919
+1933
projects.yml
file
@@ -616,6 +616,43 @@
377
+mailer
+dir
+
+enumerations.yml
+file
+
+
+
+
+2010-09-23T14:37:45.323763Z
+bafbddc194242dbdcac1f2bfc550c27b
+2010-03-13T14:56:49.379682Z
+3573
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1391
+
custom_fields_projects.yml
file
@@ -650,17 +687,17 @@
71
-enumerations.yml
+issues.yml
file
-2010-09-23T14:37:45.323763Z
-bafbddc194242dbdcac1f2bfc550c27b
-2010-03-13T14:56:49.379682Z
-3573
-jplang
+2010-11-19T13:04:46.864726Z
+6d21fa7811e1d7b4a1db0f4062fcba45
+2010-09-26T18:13:31.522853Z
+4186
+edavis10
has-props
@@ -682,10 +719,7 @@
-1391
-
-mailer
-dir
+5661
member_roles.yml
file
@@ -721,40 +755,6 @@
692
-issues.yml
-file
-
-
-
-
-2010-09-23T14:37:45.327799Z
-5c4431f5ee0ecd68c45712b87da9ca3e
-2010-04-11T16:27:37.584909Z
-3663
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-5644
-
queries.yml
file
@@ -789,6 +789,40 @@
2345
+wiki_contents.yml
+file
+
+
+
+
+2010-09-23T14:37:45.355763Z
+8e7549cddb3ed2eb4c5778e3506e3e0c
+2010-02-11T19:30:53.136370Z
+3412
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1795
+
watchers.yml
file
@@ -823,17 +857,17 @@
219
-wiki_contents.yml
+enabled_modules.yml
file
-2010-09-23T14:37:45.355763Z
-8e7549cddb3ed2eb4c5778e3506e3e0c
-2010-02-11T19:30:53.136370Z
-3412
-jplang
+2010-09-23T14:37:45.319762Z
+8a815e166641ad170ffddcf33646ca04
+2010-08-22T18:42:00.112555Z
+4013
+edavis10
has-props
@@ -855,7 +889,7 @@
-1795
+1539
wiki_pages.yml
file
@@ -891,40 +925,6 @@
1227
-enabled_modules.yml
-file
-
-
-
-
-2010-09-23T14:37:45.319762Z
-8a815e166641ad170ffddcf33646ca04
-2010-08-22T18:42:00.112555Z
-4013
-edavis10
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1539
-
comments.yml
file
@@ -1141,11 +1141,11 @@
-2010-09-23T14:37:45.351765Z
-ac7c965e48b0bb9568999ecaa86a627e
-2009-11-11T10:48:54.418561Z
-3024
-jplang
+2010-11-19T13:04:46.864726Z
+f590d477ec468a76d8d31d5ed99de0e6
+2010-09-28T18:22:00.231301Z
+4216
+edavis10
has-props
@@ -1167,7 +1167,7 @@
-3262
+3294
auth_sources.yml
file
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/.svn/text-base/custom_values.yml.svn-base
--- a/test/fixtures/.svn/text-base/custom_values.yml.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/.svn/text-base/custom_values.yml.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -28,7 +28,7 @@
custom_field_id: 4
customized_id: 2
id: 3
- value: ""
+ value: "01 42 50 00 00"
custom_values_004:
customized_type: Issue
custom_field_id: 2
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/.svn/text-base/issues.yml.svn-base
--- a/test/fixtures/.svn/text-base/issues.yml.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/.svn/text-base/issues.yml.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -38,6 +38,7 @@
lft: 1
rgt: 2
lock_version: 3
+ done_ratio: 30
issues_003:
created_on: 2006-07-19 21:07:27 +02:00
project_id: 1
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/.svn/text-base/users.yml.svn-base
--- a/test/fixtures/.svn/text-base/users.yml.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/.svn/text-base/users.yml.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -12,7 +12,7 @@
firstname: Robert
id: 4
auth_source_id:
- mail_notification: true
+ mail_notification: all
login: rhill
type: User
users_001:
@@ -28,7 +28,7 @@
firstname: redMine
id: 1
auth_source_id:
- mail_notification: true
+ mail_notification: all
login: admin
type: User
users_002:
@@ -44,7 +44,7 @@
firstname: John
id: 2
auth_source_id:
- mail_notification: true
+ mail_notification: all
login: jsmith
type: User
users_003:
@@ -60,7 +60,7 @@
firstname: Dave
id: 3
auth_source_id:
- mail_notification: true
+ mail_notification: all
login: dlopper
type: User
users_005:
@@ -77,7 +77,7 @@
lastname: Lopper2
firstname: Dave2
auth_source_id:
- mail_notification: true
+ mail_notification: all
login: dlopper2
type: User
users_006:
@@ -93,7 +93,7 @@
lastname: Anonymous
firstname: ''
auth_source_id:
- mail_notification: false
+ mail_notification: only_my_events
login: ''
type: AnonymousUser
users_007:
@@ -109,7 +109,7 @@
lastname: One
firstname: Some
auth_source_id:
- mail_notification: false
+ mail_notification: only_my_events
login: someone
type: User
users_008:
@@ -125,7 +125,7 @@
lastname: Misc
firstname: User
auth_source_id:
- mail_notification: false
+ mail_notification: only_my_events
login: miscuser8
type: User
users_009:
@@ -141,7 +141,7 @@
lastname: Misc
firstname: User
auth_source_id:
- mail_notification: false
+ mail_notification: only_my_events
login: miscuser9
type: User
groups_010:
@@ -153,4 +153,4 @@
lastname: B Team
type: Group
-
\ No newline at end of file
+
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/custom_values.yml
--- a/test/fixtures/custom_values.yml Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/custom_values.yml Wed Nov 24 12:20:08 2010 +0000
@@ -28,7 +28,7 @@
custom_field_id: 4
customized_id: 2
id: 3
- value: ""
+ value: "01 42 50 00 00"
custom_values_004:
customized_type: Issue
custom_field_id: 2
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/diffs/.svn/entries
--- a/test/fixtures/diffs/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/diffs/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test/fixtures/diffs
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/encoding/.svn/entries
--- a/test/fixtures/encoding/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/encoding/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test/fixtures/encoding
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/files/.svn/entries
--- a/test/fixtures/files/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/files/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test/fixtures/files
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/issues.yml
--- a/test/fixtures/issues.yml Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/issues.yml Wed Nov 24 12:20:08 2010 +0000
@@ -38,6 +38,7 @@
lft: 1
rgt: 2
lock_version: 3
+ done_ratio: 30
issues_003:
created_on: 2006-07-19 21:07:27 +02:00
project_id: 1
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/ldap/.svn/entries
--- a/test/fixtures/ldap/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/ldap/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test/fixtures/ldap
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/mail_handler/.svn/all-wcprops
--- a/test/fixtures/mail_handler/.svn/all-wcprops Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/mail_handler/.svn/all-wcprops Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,13 @@
K 25
svn:wc:ra_dav:version-url
V 51
-/svn/!svn/ver/3801/trunk/test/fixtures/mail_handler
+/svn/!svn/ver/4404/trunk/test/fixtures/mail_handler
+END
+message_reply_by_subject.eml
+K 25
+svn:wc:ra_dav:version-url
+V 80
+/svn/!svn/ver/2294/trunk/test/fixtures/mail_handler/message_reply_by_subject.eml
END
ticket_html_only.eml
K 25
@@ -9,11 +15,11 @@
V 72
/svn/!svn/ver/2136/trunk/test/fixtures/mail_handler/ticket_html_only.eml
END
-message_reply_by_subject.eml
+issue_update_with_multiple_quoted_reply_above.eml
K 25
svn:wc:ra_dav:version-url
-V 80
-/svn/!svn/ver/2294/trunk/test/fixtures/mail_handler/message_reply_by_subject.eml
+V 101
+/svn/!svn/ver/4361/trunk/test/fixtures/mail_handler/issue_update_with_multiple_quoted_reply_above.eml
END
ticket_with_spaces_between_attribute_and_separator.eml
K 25
@@ -21,6 +27,12 @@
V 106
/svn/!svn/ver/2838/trunk/test/fixtures/mail_handler/ticket_with_spaces_between_attribute_and_separator.eml
END
+ticket_with_localized_attributes.eml
+K 25
+svn:wc:ra_dav:version-url
+V 88
+/svn/!svn/ver/4395/trunk/test/fixtures/mail_handler/ticket_with_localized_attributes.eml
+END
ticket_with_long_subject.eml
K 25
svn:wc:ra_dav:version-url
@@ -69,17 +81,35 @@
V 78
/svn/!svn/ver/2789/trunk/test/fixtures/mail_handler/ticket_by_unknown_user.eml
END
+ticket_with_invalid_attributes.eml
+K 25
+svn:wc:ra_dav:version-url
+V 86
+/svn/!svn/ver/4404/trunk/test/fixtures/mail_handler/ticket_with_invalid_attributes.eml
+END
ticket_reply_with_status.eml
K 25
svn:wc:ra_dav:version-url
V 80
-/svn/!svn/ver/3764/trunk/test/fixtures/mail_handler/ticket_reply_with_status.eml
+/svn/!svn/ver/4394/trunk/test/fixtures/mail_handler/ticket_reply_with_status.eml
END
ticket_on_given_project.eml
K 25
svn:wc:ra_dav:version-url
V 79
-/svn/!svn/ver/3764/trunk/test/fixtures/mail_handler/ticket_on_given_project.eml
+/svn/!svn/ver/4394/trunk/test/fixtures/mail_handler/ticket_on_given_project.eml
+END
+issue_update_with_quoted_reply_above.eml
+K 25
+svn:wc:ra_dav:version-url
+V 92
+/svn/!svn/ver/4361/trunk/test/fixtures/mail_handler/issue_update_with_quoted_reply_above.eml
+END
+ticket_reply.eml
+K 25
+svn:wc:ra_dav:version-url
+V 68
+/svn/!svn/ver/2288/trunk/test/fixtures/mail_handler/ticket_reply.eml
END
ticket_with_custom_fields.eml
K 25
@@ -87,12 +117,6 @@
V 81
/svn/!svn/ver/2211/trunk/test/fixtures/mail_handler/ticket_with_custom_fields.eml
END
-ticket_reply.eml
-K 25
-svn:wc:ra_dav:version-url
-V 68
-/svn/!svn/ver/2288/trunk/test/fixtures/mail_handler/ticket_reply.eml
-END
message_reply.eml
K 25
svn:wc:ra_dav:version-url
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/mail_handler/.svn/entries
--- a/test/fixtures/mail_handler/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/mail_handler/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,15 +1,15 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test/fixtures/mail_handler
http://redmine.rubyforge.org/svn
-2010-06-20T16:22:36.211973Z
-3801
-edavis10
+2010-11-14T13:48:01.671461Z
+4404
+jplang
@@ -26,6 +26,40 @@
e93f8b46-1217-0410-a6f0-8f06a7374b81
+message_reply_by_subject.eml
+file
+
+
+
+
+2010-09-23T14:37:45.339796Z
+09130a1100cb410ed07fdff5564b2993
+2009-01-21T18:22:30.765588Z
+2294
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+410
+
ticket_html_only.eml
file
@@ -60,18 +94,17 @@
691
-message_reply_by_subject.eml
+issue_update_with_multiple_quoted_reply_above.eml
file
-2010-09-23T14:37:45.339796Z
-09130a1100cb410ed07fdff5564b2993
-2009-01-21T18:22:30.765588Z
-2294
-jplang
-has-props
+2010-11-19T13:04:46.204713Z
+ef4c0db9f76d81792292785d2ae9cb6a
+2010-11-02T19:00:31.177706Z
+4361
+edavis10
@@ -92,7 +125,8 @@
-410
+
+2018
ticket_with_spaces_between_attribute_and_separator.eml
file
@@ -128,6 +162,40 @@
1903
+ticket_with_localized_attributes.eml
+file
+
+
+
+
+2010-11-19T13:04:46.204713Z
+8ac895d880e6f19fc21333c4003babaf
+2010-11-12T12:29:35.878777Z
+4395
+jplang
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1944
+
ticket_with_long_subject.eml
file
@@ -400,17 +468,51 @@
526
+ticket_with_invalid_attributes.eml
+file
+
+
+
+
+2010-11-19T13:04:46.204713Z
+605f28e31469b6897f33cf34bbc1ad0a
+2010-11-14T13:48:01.671461Z
+4404
+jplang
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2028
+
ticket_reply_with_status.eml
file
-2010-09-23T14:37:45.339796Z
-2a98751dfc76fcc9eefa7eaf2a8098e4
-2010-05-29T00:05:24.040852Z
-3764
-edavis10
+2010-11-19T13:04:46.204713Z
+88a90b088de41d263e9135d1810cf58c
+2010-11-12T11:34:53.754717Z
+4394
+jplang
@@ -432,7 +534,7 @@
-2026
+2065
ticket_on_given_project.eml
file
@@ -440,10 +542,44 @@
-2010-09-23T14:37:45.339796Z
-6cd634ffcd88be96cbe8789ae9545c5f
-2010-05-29T00:05:24.040852Z
-3764
+2010-11-19T13:04:46.204713Z
+af7f3e5f9caddc2cad5fba0ba9d73882
+2010-11-12T11:34:53.754717Z
+4394
+jplang
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2255
+
+issue_update_with_quoted_reply_above.eml
+file
+
+
+
+
+2010-11-19T13:04:46.204713Z
+977375e727ce2d63ce878f877d692c62
+2010-11-02T19:00:31.177706Z
+4361
edavis10
@@ -466,7 +602,41 @@
-2195
+1979
+
+ticket_reply.eml
+file
+
+
+
+
+2010-09-23T14:37:45.339796Z
+4bd4decc00f83404fdd1a835809e4552
+2009-01-19T18:29:07.726757Z
+2288
+jplang
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2012
ticket_with_custom_fields.eml
file
@@ -502,40 +672,6 @@
1887
-ticket_reply.eml
-file
-
-
-
-
-2010-09-23T14:37:45.339796Z
-4bd4decc00f83404fdd1a835809e4552
-2009-01-19T18:29:07.726757Z
-2288
-jplang
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2012
-
message_reply.eml
file
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/mail_handler/.svn/text-base/issue_update_with_multiple_quoted_reply_above.eml.svn-base
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/fixtures/mail_handler/.svn/text-base/issue_update_with_multiple_quoted_reply_above.eml.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,48 @@
+Return-Path:
+Received: from osiris ([127.0.0.1])
+ by OSIRIS
+ with hMailServer ; Sun, 22 Jun 2008 12:28:07 +0200
+Message-ID: <000501c8d452$a95cd7e0$0a00a8c0@osiris>
+In-Reply-To:
+From: "John Smith"
+To:
+Subject: Re: update to issue 2
+Date: Sun, 22 Jun 2008 12:28:07 +0200
+MIME-Version: 1.0
+Content-Type: text/plain;
+ format=flowed;
+ charset="iso-8859-1";
+ reply-type=original
+Content-Transfer-Encoding: 7bit
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 6.00.2900.2869
+X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
+
+An update to the issue by the sender.
+
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas imperdiet
+turpis et odio. Integer eget pede vel dolor euismod varius. Phasellus
+blandit eleifend augue. Nulla facilisi. Duis id diam. Class aptent taciti
+sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In
+in urna sed tellus aliquet lobortis. Morbi scelerisque tortor in dolor. Cras
+sagittis odio eu lacus. Aliquam sem tortor, consequat sit amet, vestibulum
+id, iaculis at, lectus. Fusce tortor libero, congue ut, euismod nec, luctus
+eget, eros. Pellentesque tortor enim, feugiat in, dignissim eget, tristique
+sed, mauris --- Pellentesque habitant morbi tristique senectus et netus et
+malesuada fames ac turpis egestas. Quisque sit amet libero. In hac habitasse
+platea dictumst.
+
+>> > --- Reply above. Do not remove this line. ---
+>> >
+>> > Issue #6779 has been updated by Eric Davis.
+>> >
+>> > Subject changed from Projects with JSON to Project JSON API
+>> > Status changed from New to Assigned
+>> > Assignee set to Eric Davis
+>> > Priority changed from Low to Normal
+>> > Estimated time deleted (1.00)
+>> >
+>> > Looks like the JSON api for projects was missed. I'm going to be
+>> > reviewing the existing APIs and trying to clean them up over the next
+>> > few weeks.
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/mail_handler/.svn/text-base/issue_update_with_quoted_reply_above.eml.svn-base
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/fixtures/mail_handler/.svn/text-base/issue_update_with_quoted_reply_above.eml.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,48 @@
+Return-Path:
+Received: from osiris ([127.0.0.1])
+ by OSIRIS
+ with hMailServer ; Sun, 22 Jun 2008 12:28:07 +0200
+Message-ID: <000501c8d452$a95cd7e0$0a00a8c0@osiris>
+In-Reply-To:
+From: "John Smith"
+To:
+Subject: Re: update to issue 2
+Date: Sun, 22 Jun 2008 12:28:07 +0200
+MIME-Version: 1.0
+Content-Type: text/plain;
+ format=flowed;
+ charset="iso-8859-1";
+ reply-type=original
+Content-Transfer-Encoding: 7bit
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 6.00.2900.2869
+X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
+
+An update to the issue by the sender.
+
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas imperdiet
+turpis et odio. Integer eget pede vel dolor euismod varius. Phasellus
+blandit eleifend augue. Nulla facilisi. Duis id diam. Class aptent taciti
+sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In
+in urna sed tellus aliquet lobortis. Morbi scelerisque tortor in dolor. Cras
+sagittis odio eu lacus. Aliquam sem tortor, consequat sit amet, vestibulum
+id, iaculis at, lectus. Fusce tortor libero, congue ut, euismod nec, luctus
+eget, eros. Pellentesque tortor enim, feugiat in, dignissim eget, tristique
+sed, mauris --- Pellentesque habitant morbi tristique senectus et netus et
+malesuada fames ac turpis egestas. Quisque sit amet libero. In hac habitasse
+platea dictumst.
+
+> --- Reply above. Do not remove this line. ---
+>
+> Issue #6779 has been updated by Eric Davis.
+>
+> Subject changed from Projects with JSON to Project JSON API
+> Status changed from New to Assigned
+> Assignee set to Eric Davis
+> Priority changed from Low to Normal
+> Estimated time deleted (1.00)
+>
+> Looks like the JSON api for projects was missed. I'm going to be
+> reviewing the existing APIs and trying to clean them up over the next
+> few weeks.
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/mail_handler/.svn/text-base/ticket_on_given_project.eml.svn-base
--- a/test/fixtures/mail_handler/.svn/text-base/ticket_on_given_project.eml.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/mail_handler/.svn/text-base/ticket_on_given_project.eml.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -54,4 +54,7 @@
due date: 2010-12-31
Start Date:2010-01-01
Assigned to: John Smith
+fixed version: alpha
+estimated hours: 2.5
+done ratio: 30
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/mail_handler/.svn/text-base/ticket_reply_with_status.eml.svn-base
--- a/test/fixtures/mail_handler/.svn/text-base/ticket_reply_with_status.eml.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/mail_handler/.svn/text-base/ticket_reply_with_status.eml.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -29,6 +29,7 @@
due date: 2010-12-31
Start Date:2010-01-01
Assigned to: jsmith@somenet.foo
+searchable field: Updated custom value
------=_NextPart_000_0067_01C8D3CE.711F9CC0
Content-Type: text/html;
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/mail_handler/.svn/text-base/ticket_with_invalid_attributes.eml.svn-base
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/fixtures/mail_handler/.svn/text-base/ticket_with_invalid_attributes.eml.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,47 @@
+Return-Path:
+Received: from osiris ([127.0.0.1])
+ by OSIRIS
+ with hMailServer ; Sun, 22 Jun 2008 12:28:07 +0200
+Message-ID: <000501c8d452$a95cd7e0$0a00a8c0@osiris>
+From: "John Smith"
+To:
+Subject: New ticket on a given project
+Date: Sun, 22 Jun 2008 12:28:07 +0200
+MIME-Version: 1.0
+Content-Type: text/plain;
+ format=flowed;
+ charset="iso-8859-1";
+ reply-type=original
+Content-Transfer-Encoding: 7bit
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 6.00.2900.2869
+X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
+
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas imperdiet
+turpis et odio. Integer eget pede vel dolor euismod varius. Phasellus
+blandit eleifend augue. Nulla facilisi. Duis id diam. Class aptent taciti
+sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In
+in urna sed tellus aliquet lobortis. Morbi scelerisque tortor in dolor. Cras
+sagittis odio eu lacus. Aliquam sem tortor, consequat sit amet, vestibulum
+id, iaculis at, lectus. Fusce tortor libero, congue ut, euismod nec, luctus
+eget, eros. Pellentesque tortor enim, feugiat in, dignissim eget, tristique
+sed, mauris. Pellentesque habitant morbi tristique senectus et netus et
+malesuada fames ac turpis egestas. Quisque sit amet libero. In hac habitasse
+platea dictumst.
+
+Nulla et nunc. Duis pede. Donec et ipsum. Nam ut dui tincidunt neque
+sollicitudin iaculis. Duis vitae dolor. Vestibulum eget massa. Sed lorem.
+Nullam volutpat cursus erat. Cras felis dolor, lacinia quis, rutrum et,
+dictum et, ligula. Sed erat nibh, gravida in, accumsan non, placerat sed,
+massa. Sed sodales, ante fermentum ultricies sollicitudin, massa leo
+pulvinar dui, a gravida orci mi eget odio. Nunc a lacus.
+
+Project: onlinestore
+Tracker: Feature request
+category: Stock management
+assigned to: miscuser9@foo.bar
+priority: foo
+done ratio: x
+start date: some day
+due date: never
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/mail_handler/.svn/text-base/ticket_with_localized_attributes.eml.svn-base
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/fixtures/mail_handler/.svn/text-base/ticket_with_localized_attributes.eml.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,43 @@
+Return-Path:
+Received: from osiris ([127.0.0.1])
+ by OSIRIS
+ with hMailServer ; Sun, 22 Jun 2008 12:28:07 +0200
+Message-ID: <000501c8d452$a95cd7e0$0a00a8c0@osiris>
+From: "John Smith"
+To:
+Subject: New ticket on a given project
+Date: Sun, 22 Jun 2008 12:28:07 +0200
+MIME-Version: 1.0
+Content-Type: text/plain;
+ format=flowed;
+ charset="iso-8859-1";
+ reply-type=original
+Content-Transfer-Encoding: 7bit
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 6.00.2900.2869
+X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
+
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas imperdiet
+turpis et odio. Integer eget pede vel dolor euismod varius. Phasellus
+blandit eleifend augue. Nulla facilisi. Duis id diam. Class aptent taciti
+sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In
+in urna sed tellus aliquet lobortis. Morbi scelerisque tortor in dolor. Cras
+sagittis odio eu lacus. Aliquam sem tortor, consequat sit amet, vestibulum
+id, iaculis at, lectus. Fusce tortor libero, congue ut, euismod nec, luctus
+eget, eros. Pellentesque tortor enim, feugiat in, dignissim eget, tristique
+sed, mauris. Pellentesque habitant morbi tristique senectus et netus et
+malesuada fames ac turpis egestas. Quisque sit amet libero. In hac habitasse
+platea dictumst.
+
+Nulla et nunc. Duis pede. Donec et ipsum. Nam ut dui tincidunt neque
+sollicitudin iaculis. Duis vitae dolor. Vestibulum eget massa. Sed lorem.
+Nullam volutpat cursus erat. Cras felis dolor, lacinia quis, rutrum et,
+dictum et, ligula. Sed erat nibh, gravida in, accumsan non, placerat sed,
+massa. Sed sodales, ante fermentum ultricies sollicitudin, massa leo
+pulvinar dui, a gravida orci mi eget odio. Nunc a lacus.
+
+Projet: onlinestore
+Tracker: Feature request
+catégorie: Stock management
+priorité: Urgent
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/mail_handler/issue_update_with_multiple_quoted_reply_above.eml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/fixtures/mail_handler/issue_update_with_multiple_quoted_reply_above.eml Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,48 @@
+Return-Path:
+Received: from osiris ([127.0.0.1])
+ by OSIRIS
+ with hMailServer ; Sun, 22 Jun 2008 12:28:07 +0200
+Message-ID: <000501c8d452$a95cd7e0$0a00a8c0@osiris>
+In-Reply-To:
+From: "John Smith"
+To:
+Subject: Re: update to issue 2
+Date: Sun, 22 Jun 2008 12:28:07 +0200
+MIME-Version: 1.0
+Content-Type: text/plain;
+ format=flowed;
+ charset="iso-8859-1";
+ reply-type=original
+Content-Transfer-Encoding: 7bit
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 6.00.2900.2869
+X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
+
+An update to the issue by the sender.
+
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas imperdiet
+turpis et odio. Integer eget pede vel dolor euismod varius. Phasellus
+blandit eleifend augue. Nulla facilisi. Duis id diam. Class aptent taciti
+sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In
+in urna sed tellus aliquet lobortis. Morbi scelerisque tortor in dolor. Cras
+sagittis odio eu lacus. Aliquam sem tortor, consequat sit amet, vestibulum
+id, iaculis at, lectus. Fusce tortor libero, congue ut, euismod nec, luctus
+eget, eros. Pellentesque tortor enim, feugiat in, dignissim eget, tristique
+sed, mauris --- Pellentesque habitant morbi tristique senectus et netus et
+malesuada fames ac turpis egestas. Quisque sit amet libero. In hac habitasse
+platea dictumst.
+
+>> > --- Reply above. Do not remove this line. ---
+>> >
+>> > Issue #6779 has been updated by Eric Davis.
+>> >
+>> > Subject changed from Projects with JSON to Project JSON API
+>> > Status changed from New to Assigned
+>> > Assignee set to Eric Davis
+>> > Priority changed from Low to Normal
+>> > Estimated time deleted (1.00)
+>> >
+>> > Looks like the JSON api for projects was missed. I'm going to be
+>> > reviewing the existing APIs and trying to clean them up over the next
+>> > few weeks.
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/mail_handler/issue_update_with_quoted_reply_above.eml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/fixtures/mail_handler/issue_update_with_quoted_reply_above.eml Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,48 @@
+Return-Path:
+Received: from osiris ([127.0.0.1])
+ by OSIRIS
+ with hMailServer ; Sun, 22 Jun 2008 12:28:07 +0200
+Message-ID: <000501c8d452$a95cd7e0$0a00a8c0@osiris>
+In-Reply-To:
+From: "John Smith"
+To:
+Subject: Re: update to issue 2
+Date: Sun, 22 Jun 2008 12:28:07 +0200
+MIME-Version: 1.0
+Content-Type: text/plain;
+ format=flowed;
+ charset="iso-8859-1";
+ reply-type=original
+Content-Transfer-Encoding: 7bit
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 6.00.2900.2869
+X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
+
+An update to the issue by the sender.
+
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas imperdiet
+turpis et odio. Integer eget pede vel dolor euismod varius. Phasellus
+blandit eleifend augue. Nulla facilisi. Duis id diam. Class aptent taciti
+sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In
+in urna sed tellus aliquet lobortis. Morbi scelerisque tortor in dolor. Cras
+sagittis odio eu lacus. Aliquam sem tortor, consequat sit amet, vestibulum
+id, iaculis at, lectus. Fusce tortor libero, congue ut, euismod nec, luctus
+eget, eros. Pellentesque tortor enim, feugiat in, dignissim eget, tristique
+sed, mauris --- Pellentesque habitant morbi tristique senectus et netus et
+malesuada fames ac turpis egestas. Quisque sit amet libero. In hac habitasse
+platea dictumst.
+
+> --- Reply above. Do not remove this line. ---
+>
+> Issue #6779 has been updated by Eric Davis.
+>
+> Subject changed from Projects with JSON to Project JSON API
+> Status changed from New to Assigned
+> Assignee set to Eric Davis
+> Priority changed from Low to Normal
+> Estimated time deleted (1.00)
+>
+> Looks like the JSON api for projects was missed. I'm going to be
+> reviewing the existing APIs and trying to clean them up over the next
+> few weeks.
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/mail_handler/ticket_on_given_project.eml
--- a/test/fixtures/mail_handler/ticket_on_given_project.eml Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/mail_handler/ticket_on_given_project.eml Wed Nov 24 12:20:08 2010 +0000
@@ -54,4 +54,7 @@
due date: 2010-12-31
Start Date:2010-01-01
Assigned to: John Smith
+fixed version: alpha
+estimated hours: 2.5
+done ratio: 30
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/mail_handler/ticket_reply_with_status.eml
--- a/test/fixtures/mail_handler/ticket_reply_with_status.eml Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/mail_handler/ticket_reply_with_status.eml Wed Nov 24 12:20:08 2010 +0000
@@ -29,6 +29,7 @@
due date: 2010-12-31
Start Date:2010-01-01
Assigned to: jsmith@somenet.foo
+searchable field: Updated custom value
------=_NextPart_000_0067_01C8D3CE.711F9CC0
Content-Type: text/html;
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/mail_handler/ticket_with_invalid_attributes.eml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/fixtures/mail_handler/ticket_with_invalid_attributes.eml Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,47 @@
+Return-Path:
+Received: from osiris ([127.0.0.1])
+ by OSIRIS
+ with hMailServer ; Sun, 22 Jun 2008 12:28:07 +0200
+Message-ID: <000501c8d452$a95cd7e0$0a00a8c0@osiris>
+From: "John Smith"
+To:
+Subject: New ticket on a given project
+Date: Sun, 22 Jun 2008 12:28:07 +0200
+MIME-Version: 1.0
+Content-Type: text/plain;
+ format=flowed;
+ charset="iso-8859-1";
+ reply-type=original
+Content-Transfer-Encoding: 7bit
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 6.00.2900.2869
+X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
+
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas imperdiet
+turpis et odio. Integer eget pede vel dolor euismod varius. Phasellus
+blandit eleifend augue. Nulla facilisi. Duis id diam. Class aptent taciti
+sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In
+in urna sed tellus aliquet lobortis. Morbi scelerisque tortor in dolor. Cras
+sagittis odio eu lacus. Aliquam sem tortor, consequat sit amet, vestibulum
+id, iaculis at, lectus. Fusce tortor libero, congue ut, euismod nec, luctus
+eget, eros. Pellentesque tortor enim, feugiat in, dignissim eget, tristique
+sed, mauris. Pellentesque habitant morbi tristique senectus et netus et
+malesuada fames ac turpis egestas. Quisque sit amet libero. In hac habitasse
+platea dictumst.
+
+Nulla et nunc. Duis pede. Donec et ipsum. Nam ut dui tincidunt neque
+sollicitudin iaculis. Duis vitae dolor. Vestibulum eget massa. Sed lorem.
+Nullam volutpat cursus erat. Cras felis dolor, lacinia quis, rutrum et,
+dictum et, ligula. Sed erat nibh, gravida in, accumsan non, placerat sed,
+massa. Sed sodales, ante fermentum ultricies sollicitudin, massa leo
+pulvinar dui, a gravida orci mi eget odio. Nunc a lacus.
+
+Project: onlinestore
+Tracker: Feature request
+category: Stock management
+assigned to: miscuser9@foo.bar
+priority: foo
+done ratio: x
+start date: some day
+due date: never
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/mail_handler/ticket_with_localized_attributes.eml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/fixtures/mail_handler/ticket_with_localized_attributes.eml Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,43 @@
+Return-Path:
+Received: from osiris ([127.0.0.1])
+ by OSIRIS
+ with hMailServer ; Sun, 22 Jun 2008 12:28:07 +0200
+Message-ID: <000501c8d452$a95cd7e0$0a00a8c0@osiris>
+From: "John Smith"
+To:
+Subject: New ticket on a given project
+Date: Sun, 22 Jun 2008 12:28:07 +0200
+MIME-Version: 1.0
+Content-Type: text/plain;
+ format=flowed;
+ charset="iso-8859-1";
+ reply-type=original
+Content-Transfer-Encoding: 7bit
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 6.00.2900.2869
+X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
+
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas imperdiet
+turpis et odio. Integer eget pede vel dolor euismod varius. Phasellus
+blandit eleifend augue. Nulla facilisi. Duis id diam. Class aptent taciti
+sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In
+in urna sed tellus aliquet lobortis. Morbi scelerisque tortor in dolor. Cras
+sagittis odio eu lacus. Aliquam sem tortor, consequat sit amet, vestibulum
+id, iaculis at, lectus. Fusce tortor libero, congue ut, euismod nec, luctus
+eget, eros. Pellentesque tortor enim, feugiat in, dignissim eget, tristique
+sed, mauris. Pellentesque habitant morbi tristique senectus et netus et
+malesuada fames ac turpis egestas. Quisque sit amet libero. In hac habitasse
+platea dictumst.
+
+Nulla et nunc. Duis pede. Donec et ipsum. Nam ut dui tincidunt neque
+sollicitudin iaculis. Duis vitae dolor. Vestibulum eget massa. Sed lorem.
+Nullam volutpat cursus erat. Cras felis dolor, lacinia quis, rutrum et,
+dictum et, ligula. Sed erat nibh, gravida in, accumsan non, placerat sed,
+massa. Sed sodales, ante fermentum ultricies sollicitudin, massa leo
+pulvinar dui, a gravida orci mi eget odio. Nunc a lacus.
+
+Projet: onlinestore
+Tracker: Feature request
+catégorie: Stock management
+priorité: Urgent
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/mailer/.svn/entries
--- a/test/fixtures/mailer/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/mailer/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test/fixtures/mailer
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/repositories/.svn/all-wcprops
--- a/test/fixtures/repositories/.svn/all-wcprops Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/repositories/.svn/all-wcprops Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
K 25
svn:wc:ra_dav:version-url
V 51
-/svn/!svn/ver/3828/trunk/test/fixtures/repositories
+/svn/!svn/ver/4310/trunk/test/fixtures/repositories
END
darcs_repository.tar.gz
K 25
@@ -25,7 +25,7 @@
K 25
svn:wc:ra_dav:version-url
V 73
-/svn/!svn/ver/3828/trunk/test/fixtures/repositories/git_repository.tar.gz
+/svn/!svn/ver/4310/trunk/test/fixtures/repositories/git_repository.tar.gz
END
mercurial_repository.tar.gz
K 25
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/repositories/.svn/entries
--- a/test/fixtures/repositories/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/repositories/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,15 +1,15 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test/fixtures/repositories
http://redmine.rubyforge.org/svn
-2010-07-06T02:07:46.557097Z
-3828
-edavis10
+2010-10-29T23:21:57.240368Z
+4310
+jbbarth
@@ -134,11 +134,11 @@
-2010-09-23T14:37:45.351765Z
-4717d4ab5ae991a07ac8256d6cc83c36
-2010-07-06T02:07:46.557097Z
-3828
-edavis10
+2010-11-19T13:04:46.860726Z
+300e21b10239e2fa28df3111924b8328
+2010-10-29T23:21:57.240368Z
+4310
+jbbarth
has-props
@@ -160,7 +160,7 @@
-19452
+20730
mercurial_repository.tar.gz
file
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/repositories/.svn/text-base/git_repository.tar.gz.svn-base
Binary file test/fixtures/repositories/.svn/text-base/git_repository.tar.gz.svn-base has changed
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/repositories/git_repository.tar.gz
Binary file test/fixtures/repositories/git_repository.tar.gz has changed
diff -r 09b1d4349da3 -r 371eac10df0b test/fixtures/users.yml
--- a/test/fixtures/users.yml Thu Oct 21 11:19:14 2010 +0100
+++ b/test/fixtures/users.yml Wed Nov 24 12:20:08 2010 +0000
@@ -12,7 +12,7 @@
firstname: Robert
id: 4
auth_source_id:
- mail_notification: true
+ mail_notification: all
login: rhill
type: User
users_001:
@@ -28,7 +28,7 @@
firstname: redMine
id: 1
auth_source_id:
- mail_notification: true
+ mail_notification: all
login: admin
type: User
users_002:
@@ -44,7 +44,7 @@
firstname: John
id: 2
auth_source_id:
- mail_notification: true
+ mail_notification: all
login: jsmith
type: User
users_003:
@@ -60,7 +60,7 @@
firstname: Dave
id: 3
auth_source_id:
- mail_notification: true
+ mail_notification: all
login: dlopper
type: User
users_005:
@@ -77,7 +77,7 @@
lastname: Lopper2
firstname: Dave2
auth_source_id:
- mail_notification: true
+ mail_notification: all
login: dlopper2
type: User
users_006:
@@ -93,7 +93,7 @@
lastname: Anonymous
firstname: ''
auth_source_id:
- mail_notification: false
+ mail_notification: only_my_events
login: ''
type: AnonymousUser
users_007:
@@ -109,7 +109,7 @@
lastname: One
firstname: Some
auth_source_id:
- mail_notification: false
+ mail_notification: only_my_events
login: someone
type: User
users_008:
@@ -125,7 +125,7 @@
lastname: Misc
firstname: User
auth_source_id:
- mail_notification: false
+ mail_notification: only_my_events
login: miscuser8
type: User
users_009:
@@ -141,7 +141,7 @@
lastname: Misc
firstname: User
auth_source_id:
- mail_notification: false
+ mail_notification: only_my_events
login: miscuser9
type: User
groups_010:
@@ -153,4 +153,4 @@
lastname: B Team
type: Group
-
\ No newline at end of file
+
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/all-wcprops
--- a/test/functional/.svn/all-wcprops Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/all-wcprops Wed Nov 24 12:20:08 2010 +0000
@@ -1,19 +1,19 @@
K 25
svn:wc:ra_dav:version-url
V 40
-/svn/!svn/ver/4172/trunk/test/functional
+/svn/!svn/ver/4411/trunk/test/functional
END
issues_controller_test.rb
K 25
svn:wc:ra_dav:version-url
V 66
-/svn/!svn/ver/4083/trunk/test/functional/issues_controller_test.rb
+/svn/!svn/ver/4411/trunk/test/functional/issues_controller_test.rb
END
news_controller_test.rb
K 25
svn:wc:ra_dav:version-url
V 64
-/svn/!svn/ver/4172/trunk/test/functional/news_controller_test.rb
+/svn/!svn/ver/4407/trunk/test/functional/news_controller_test.rb
END
queries_controller_test.rb
K 25
@@ -43,19 +43,19 @@
K 25
svn:wc:ra_dav:version-url
V 65
-/svn/!svn/ver/3435/trunk/test/functional/roles_controller_test.rb
+/svn/!svn/ver/4407/trunk/test/functional/roles_controller_test.rb
END
my_controller_test.rb
K 25
svn:wc:ra_dav:version-url
V 62
-/svn/!svn/ver/3217/trunk/test/functional/my_controller_test.rb
+/svn/!svn/ver/4407/trunk/test/functional/my_controller_test.rb
END
comments_controller_test.rb
K 25
svn:wc:ra_dav:version-url
V 68
-/svn/!svn/ver/4172/trunk/test/functional/comments_controller_test.rb
+/svn/!svn/ver/4407/trunk/test/functional/comments_controller_test.rb
END
wikis_controller_test.rb
K 25
@@ -79,19 +79,25 @@
K 25
svn:wc:ra_dav:version-url
V 73
-/svn/!svn/ver/4055/trunk/test/functional/context_menus_controller_test.rb
+/svn/!svn/ver/4242/trunk/test/functional/context_menus_controller_test.rb
END
account_controller_test.rb
K 25
svn:wc:ra_dav:version-url
V 67
-/svn/!svn/ver/3933/trunk/test/functional/account_controller_test.rb
+/svn/!svn/ver/4407/trunk/test/functional/account_controller_test.rb
END
calendars_controller_test.rb
K 25
svn:wc:ra_dav:version-url
V 69
-/svn/!svn/ver/3913/trunk/test/functional/calendars_controller_test.rb
+/svn/!svn/ver/4245/trunk/test/functional/calendars_controller_test.rb
+END
+journals_controller_test.rb
+K 25
+svn:wc:ra_dav:version-url
+V 68
+/svn/!svn/ver/4034/trunk/test/functional/journals_controller_test.rb
END
workflows_controller_test.rb
K 25
@@ -99,41 +105,41 @@
V 69
/svn/!svn/ver/3188/trunk/test/functional/workflows_controller_test.rb
END
-journals_controller_test.rb
+time_entry_reports_controller_test.rb
K 25
svn:wc:ra_dav:version-url
-V 68
-/svn/!svn/ver/4034/trunk/test/functional/journals_controller_test.rb
+V 78
+/svn/!svn/ver/4232/trunk/test/functional/time_entry_reports_controller_test.rb
END
project_enumerations_controller_test.rb
K 25
svn:wc:ra_dav:version-url
V 80
-/svn/!svn/ver/4075/trunk/test/functional/project_enumerations_controller_test.rb
+/svn/!svn/ver/4407/trunk/test/functional/project_enumerations_controller_test.rb
END
gantts_controller_test.rb
K 25
svn:wc:ra_dav:version-url
V 66
-/svn/!svn/ver/4072/trunk/test/functional/gantts_controller_test.rb
+/svn/!svn/ver/4280/trunk/test/functional/gantts_controller_test.rb
+END
+users_controller_test.rb
+K 25
+svn:wc:ra_dav:version-url
+V 65
+/svn/!svn/ver/4382/trunk/test/functional/users_controller_test.rb
END
issue_moves_controller_test.rb
K 25
svn:wc:ra_dav:version-url
V 71
-/svn/!svn/ver/3937/trunk/test/functional/issue_moves_controller_test.rb
-END
-users_controller_test.rb
-K 25
-svn:wc:ra_dav:version-url
-V 65
-/svn/!svn/ver/4066/trunk/test/functional/users_controller_test.rb
+/svn/!svn/ver/4407/trunk/test/functional/issue_moves_controller_test.rb
END
repositories_cvs_controller_test.rb
K 25
svn:wc:ra_dav:version-url
V 76
-/svn/!svn/ver/2887/trunk/test/functional/repositories_cvs_controller_test.rb
+/svn/!svn/ver/4289/trunk/test/functional/repositories_cvs_controller_test.rb
END
application_controller_test.rb
K 25
@@ -147,17 +153,23 @@
V 70
/svn/!svn/ver/4047/trunk/test/functional/activities_controller_test.rb
END
+search_controller_test.rb
+K 25
+svn:wc:ra_dav:version-url
+V 66
+/svn/!svn/ver/4407/trunk/test/functional/search_controller_test.rb
+END
ldap_auth_sources_controller.rb
K 25
svn:wc:ra_dav:version-url
V 72
/svn/!svn/ver/3744/trunk/test/functional/ldap_auth_sources_controller.rb
END
-search_controller_test.rb
+messages_controller_test.rb
K 25
svn:wc:ra_dav:version-url
-V 66
-/svn/!svn/ver/3806/trunk/test/functional/search_controller_test.rb
+V 68
+/svn/!svn/ver/4407/trunk/test/functional/messages_controller_test.rb
END
repositories_bazaar_controller_test.rb
K 25
@@ -165,17 +177,11 @@
V 79
/svn/!svn/ver/2887/trunk/test/functional/repositories_bazaar_controller_test.rb
END
-messages_controller_test.rb
-K 25
-svn:wc:ra_dav:version-url
-V 68
-/svn/!svn/ver/3687/trunk/test/functional/messages_controller_test.rb
-END
attachments_controller_test.rb
K 25
svn:wc:ra_dav:version-url
V 71
-/svn/!svn/ver/3687/trunk/test/functional/attachments_controller_test.rb
+/svn/!svn/ver/4407/trunk/test/functional/attachments_controller_test.rb
END
sys_controller_test.rb
K 25
@@ -187,7 +193,7 @@
K 25
svn:wc:ra_dav:version-url
V 66
-/svn/!svn/ver/2989/trunk/test/functional/groups_controller_test.rb
+/svn/!svn/ver/4407/trunk/test/functional/groups_controller_test.rb
END
issues_controller_transaction_test.rb
K 25
@@ -211,19 +217,19 @@
K 25
svn:wc:ra_dav:version-url
V 72
-/svn/!svn/ver/3687/trunk/test/functional/repositories_controller_test.rb
+/svn/!svn/ver/4407/trunk/test/functional/repositories_controller_test.rb
END
projects_controller_test.rb
K 25
svn:wc:ra_dav:version-url
V 68
-/svn/!svn/ver/4070/trunk/test/functional/projects_controller_test.rb
+/svn/!svn/ver/4407/trunk/test/functional/projects_controller_test.rb
END
repositories_git_controller_test.rb
K 25
svn:wc:ra_dav:version-url
V 76
-/svn/!svn/ver/3828/trunk/test/functional/repositories_git_controller_test.rb
+/svn/!svn/ver/4289/trunk/test/functional/repositories_git_controller_test.rb
END
members_controller_test.rb
K 25
@@ -259,25 +265,25 @@
K 25
svn:wc:ra_dav:version-url
V 68
-/svn/!svn/ver/3013/trunk/test/functional/settings_controller_test.rb
+/svn/!svn/ver/4407/trunk/test/functional/settings_controller_test.rb
END
timelog_controller_test.rb
K 25
svn:wc:ra_dav:version-url
V 67
-/svn/!svn/ver/4087/trunk/test/functional/timelog_controller_test.rb
+/svn/!svn/ver/4250/trunk/test/functional/timelog_controller_test.rb
END
documents_controller_test.rb
K 25
svn:wc:ra_dav:version-url
V 69
-/svn/!svn/ver/3788/trunk/test/functional/documents_controller_test.rb
+/svn/!svn/ver/4407/trunk/test/functional/documents_controller_test.rb
END
files_controller_test.rb
K 25
svn:wc:ra_dav:version-url
V 65
-/svn/!svn/ver/4085/trunk/test/functional/files_controller_test.rb
+/svn/!svn/ver/4407/trunk/test/functional/files_controller_test.rb
END
repositories_darcs_controller_test.rb
K 25
@@ -289,7 +295,7 @@
K 25
svn:wc:ra_dav:version-url
V 64
-/svn/!svn/ver/3686/trunk/test/functional/wiki_controller_test.rb
+/svn/!svn/ver/4375/trunk/test/functional/wiki_controller_test.rb
END
auth_sources_controller_test.rb
K 25
@@ -301,13 +307,13 @@
K 25
svn:wc:ra_dav:version-url
V 68
-/svn/!svn/ver/3946/trunk/test/functional/previews_controller_test.rb
+/svn/!svn/ver/4174/trunk/test/functional/previews_controller_test.rb
END
repositories_subversion_controller_test.rb
K 25
svn:wc:ra_dav:version-url
V 83
-/svn/!svn/ver/3800/trunk/test/functional/repositories_subversion_controller_test.rb
+/svn/!svn/ver/4289/trunk/test/functional/repositories_subversion_controller_test.rb
END
issue_relations_controller_test.rb
K 25
@@ -319,7 +325,7 @@
K 25
svn:wc:ra_dav:version-url
V 68
-/svn/!svn/ver/4097/trunk/test/functional/versions_controller_test.rb
+/svn/!svn/ver/4354/trunk/test/functional/versions_controller_test.rb
END
enumerations_controller_test.rb
K 25
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/entries
--- a/test/functional/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,15 +1,15 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test/functional
http://redmine.rubyforge.org/svn
-2010-09-23T15:20:19.085385Z
-4172
-edavis10
+2010-11-17T18:27:38.712585Z
+4411
+jplang
@@ -32,11 +32,11 @@
-2010-09-24T12:48:25.875739Z
-07a21279794955753d580c1ae2e523fb
-2010-09-11T20:21:27.018967Z
-4083
-jbbarth
+2010-11-19T13:04:41.460658Z
+63b42848e4b9c141f6081fb9b5187e91
+2010-11-17T18:27:38.712585Z
+4411
+jplang
has-props
@@ -58,7 +58,7 @@
-38747
+46917
news_controller_test.rb
file
@@ -66,11 +66,11 @@
-2010-09-24T12:48:25.875739Z
-1c72a2e1843e72e60be2f30f97197b91
-2010-09-23T15:20:19.085385Z
-4172
-edavis10
+2010-11-19T13:04:41.460658Z
+0673b926675d6ac108f0af70a8f609f4
+2010-11-14T16:45:32.457767Z
+4407
+jplang
has-props
@@ -92,7 +92,7 @@
-4365
+3948
queries_controller_test.rb
file
@@ -236,11 +236,11 @@
-2010-09-23T14:37:45.423771Z
-e2ab383bae04b68e626c1f5f9a196bfb
-2010-02-15T16:41:16.346582Z
-3435
-edavis10
+2010-11-19T13:04:41.460658Z
+7258b2945e07b02349515daea0f85ce7
+2010-11-14T16:45:32.457767Z
+4407
+jplang
has-props
@@ -262,7 +262,7 @@
-6078
+6089
my_controller_test.rb
file
@@ -270,11 +270,11 @@
-2010-09-23T14:37:45.387766Z
-23fcfd5e58263663f9a6507566e6fe2d
-2009-12-23T06:27:28.577661Z
-3217
-edavis10
+2010-11-19T13:04:41.464645Z
+cbb9551bd925ce88a319d20ca2b127ab
+2010-11-14T16:45:32.457767Z
+4407
+jplang
has-props
@@ -296,7 +296,7 @@
-6205
+6207
comments_controller_test.rb
file
@@ -304,33 +304,33 @@
-2010-09-24T12:48:25.875739Z
-70dea926748aacbab944bce556c551c6
-2010-09-23T15:20:19.085385Z
-4172
-edavis10
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2027
+2010-11-19T13:04:41.464645Z
+8a36a09743e192b6be46bb008ac7297e
+2010-11-14T16:45:32.457767Z
+4407
+jplang
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2030
wikis_controller_test.rb
file
@@ -440,10 +440,10 @@
-2010-09-24T12:48:25.875739Z
-c73a61b28b04990574ae25575051aa52
-2010-09-03T19:54:24.083210Z
-4055
+2010-11-19T13:04:41.464645Z
+96877cbbea85ba3fd99502907477340f
+2010-10-08T03:09:51.863032Z
+4242
jbbarth
@@ -466,7 +466,7 @@
-5093
+6032
account_controller_test.rb
file
@@ -474,11 +474,11 @@
-2010-09-23T14:37:45.383766Z
-01299f951a82e5acf560044b7e89b5ab
-2010-08-10T21:12:32.103531Z
-3933
-jbbarth
+2010-11-19T13:04:41.464645Z
+a907569b5ac8764a0d6db597aa736851
+2010-11-14T16:45:32.457767Z
+4407
+jplang
has-props
@@ -500,7 +500,7 @@
-7329
+7335
calendars_controller_test.rb
file
@@ -508,10 +508,10 @@
-2010-09-23T14:37:45.383766Z
-998bc7746491ec2c407187c5c7646990
-2010-08-04T15:04:30.993800Z
-3913
+2010-11-19T13:04:41.464645Z
+ff8293f6d80647d3d03c66072bde5c98
+2010-10-10T21:17:10.784165Z
+4245
edavis10
@@ -534,7 +534,41 @@
-2188
+2385
+
+workflows_controller_test.rb
+file
+
+
+
+
+2010-09-23T14:37:45.427769Z
+be835c79372fac52c849870791d982ff
+2009-12-18T15:41:32.828284Z
+3188
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6668
journals_controller_test.rb
file
@@ -570,39 +604,39 @@
2642
-workflows_controller_test.rb
+time_entry_reports_controller_test.rb
file
-2010-09-23T14:37:45.427769Z
-be835c79372fac52c849870791d982ff
-2009-12-18T15:41:32.828284Z
-3188
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-6668
+2010-11-19T13:04:41.464645Z
+89c906bd5446b26ea9463b90cebaa807
+2010-10-05T16:07:17.015270Z
+4232
+edavis10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5419
project_enumerations_controller_test.rb
file
@@ -610,33 +644,33 @@
-2010-09-24T12:48:25.875739Z
-abb9be62ab6ed5867d6070fd14ffd31d
-2010-09-10T16:00:49.687515Z
-4075
-edavis10
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-9530
+2010-11-19T13:04:41.464645Z
+37775addcfb51a3ce3d8cddc3b1e907a
+2010-11-14T16:45:32.457767Z
+4407
+jplang
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+9534
gantts_controller_test.rb
file
@@ -644,33 +678,67 @@
-2010-09-24T12:48:25.875739Z
-fb255e043b31b095c741248bc5a9a287
-2010-09-10T03:09:02.311267Z
-4072
-edavis10
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1716
+2010-11-19T13:04:41.464645Z
+3037031df4af4a9e2e77bd75083a4bcc
+2010-10-22T22:13:39.617506Z
+4280
+jplang
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2272
+
+issue_moves_controller_test.rb
+file
+
+
+
+
+2010-11-19T13:04:41.464645Z
+79f29b51a76072a1272e3ec50bec0e0f
+2010-11-14T16:45:32.457767Z
+4407
+jplang
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5098
users_controller_test.rb
file
@@ -678,11 +746,11 @@
-2010-09-24T12:48:25.875739Z
-bc114889d45857af9ea3a87862f6f0e5
-2010-09-06T01:02:52.851079Z
-4066
-edavis10
+2010-11-19T13:04:41.464645Z
+79742c00eadbe609d9abb6317856022f
+2010-11-07T14:15:01.891476Z
+4382
+jplang
has-props
@@ -704,41 +772,7 @@
-5574
-
-issue_moves_controller_test.rb
-file
-
-
-
-
-2010-09-23T14:37:45.387766Z
-54756d7f1e65c8d37dca5b41aac6e3ae
-2010-08-12T13:57:46.562058Z
-3937
-edavis10
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-4304
+7363
repositories_cvs_controller_test.rb
file
@@ -746,10 +780,10 @@
-2010-09-23T14:37:45.419982Z
-e8d80bc0ee812d5226adf9c1d952ece8
-2009-09-13T17:14:35.707881Z
-2887
+2010-11-19T13:04:41.468647Z
+e01a04614a9b23c31bb216e61c81759d
+2010-10-25T15:42:41.795656Z
+4289
edavis10
has-props
@@ -772,7 +806,7 @@
-6556
+6562
application_controller_test.rb
file
@@ -842,6 +876,40 @@
2695
+search_controller_test.rb
+file
+
+
+
+
+2010-11-19T13:04:41.468647Z
+2e14f0628773a6ad6b3b59b3429d187d
+2010-11-14T16:45:32.457767Z
+4407
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4675
+
ldap_auth_sources_controller.rb
file
@@ -876,17 +944,17 @@
491
-search_controller_test.rb
+messages_controller_test.rb
file
-2010-09-23T14:37:45.423771Z
-9dc6da996eea99b8108da65990ef6be3
-2010-06-20T20:01:32.722003Z
-3806
-edavis10
+2010-11-19T13:04:41.468647Z
+4514c9f19bf7270410fbf05098128346
+2010-11-14T16:45:32.457767Z
+4407
+jplang
has-props
@@ -908,7 +976,7 @@
-4674
+5042
repositories_bazaar_controller_test.rb
file
@@ -944,51 +1012,17 @@
5054
-messages_controller_test.rb
-file
-
-
-
-
-2010-09-23T14:37:45.387766Z
-e70455a2b4bd135f10862b69df7a70bf
-2010-04-21T16:02:55.125733Z
-3687
-edavis10
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-5038
-
attachments_controller_test.rb
file
-2010-09-23T14:37:45.383766Z
-25de9e7d8cc73997221a567f9ae1c363
-2010-04-21T16:02:55.125733Z
-3687
-edavis10
+2010-11-19T13:04:41.468647Z
+06a5a66df669f08e5f357931edb12db1
+2010-11-14T16:45:32.457767Z
+4407
+jplang
has-props
@@ -1010,7 +1044,7 @@
-4244
+4245
sys_controller_test.rb
file
@@ -1052,10 +1086,10 @@
-2010-09-23T14:37:45.383766Z
-440543b92d6281235fa9a3ec7b569514
-2009-10-29T18:40:00.797736Z
-2989
+2010-11-19T13:04:41.468647Z
+708f3fdb0cee16797fdd197cc5de756e
+2010-11-14T16:45:32.457767Z
+4407
jplang
has-props
@@ -1078,7 +1112,7 @@
-3014
+3017
issues_controller_transaction_test.rb
file
@@ -1188,11 +1222,11 @@
-2010-09-23T14:37:45.419982Z
-d89f24390b27494109c2e4b393fbce7c
-2010-04-21T16:02:55.125733Z
-3687
-edavis10
+2010-11-19T13:04:41.468647Z
+8e3650db9518fe44471fc80fbb6dbd21
+2010-11-14T16:45:32.457767Z
+4407
+jplang
has-props
@@ -1214,7 +1248,7 @@
-4569
+4570
projects_controller_test.rb
file
@@ -1222,11 +1256,11 @@
-2010-09-24T12:48:25.875739Z
-8a06ffc175377efeb3bac6e70067fa45
-2010-09-08T16:01:51.939478Z
-4070
-edavis10
+2010-11-19T13:04:41.468647Z
+c4b243a5a18c509cc65794be84ffd752
+2010-11-14T16:45:32.457767Z
+4407
+jplang
has-props
@@ -1248,7 +1282,7 @@
-14899
+15977
members_controller_test.rb
file
@@ -1290,10 +1324,10 @@
-2010-09-23T14:37:45.423771Z
-c2447def1a06fe360c98745749ef2066
-2010-07-06T02:07:46.557097Z
-3828
+2010-11-19T13:04:41.472627Z
+f64a33705a8376f5a398502f116c0db4
+2010-10-25T15:42:41.795656Z
+4289
edavis10
has-props
@@ -1316,7 +1350,7 @@
-6470
+6689
repositories_mercurial_controller_test.rb
file
@@ -1460,10 +1494,10 @@
-2010-09-23T14:37:45.423771Z
-580f9a678b8f7f505a52b444d5f70dba
-2009-11-07T08:44:56.035544Z
-3013
+2010-11-19T13:04:41.472627Z
+cc2bc5f554f121c21ba82c60216f01d5
+2010-11-14T16:45:32.457767Z
+4407
jplang
has-props
@@ -1486,7 +1520,7 @@
-2121
+2122
timelog_controller_test.rb
file
@@ -1494,10 +1528,10 @@
-2010-09-24T12:48:25.879729Z
-478bfd41fe3ea1d3f9d2c91b26ee7a62
-2010-09-14T19:02:25.847894Z
-4087
+2010-11-19T13:04:41.472627Z
+be5f7d864581bed744c8991964a97ae6
+2010-10-12T15:55:21.984670Z
+4250
edavis10
has-props
@@ -1520,7 +1554,7 @@
-13631
+8487
documents_controller_test.rb
file
@@ -1528,11 +1562,11 @@
-2010-09-23T14:37:45.383766Z
-6d6a011a4f7f17ccff7b514eac561ce8
-2010-06-19T22:17:34.496523Z
-3788
-edavis10
+2010-11-19T13:04:41.472627Z
+e92d7b72633aaca649a4df81ea39305a
+2010-11-14T16:45:32.457767Z
+4407
+jplang
has-props
@@ -1554,7 +1588,7 @@
-4670
+4672
files_controller_test.rb
file
@@ -1562,33 +1596,33 @@
-2010-09-24T12:48:25.879729Z
-5d12ff23b3756ee66c539417f2d5dedc
-2010-09-14T16:24:07.840869Z
-4085
-edavis10
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2306
+2010-11-19T13:04:41.472627Z
+1682b4116f36633c8816d1dff0d49cb5
+2010-11-14T16:45:32.457767Z
+4407
+jplang
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2308
repositories_darcs_controller_test.rb
file
@@ -1630,11 +1664,11 @@
-2010-09-23T14:37:45.427769Z
-5e11aaeb4ee3d552c2668034c201d6e2
-2010-04-20T15:42:57.800422Z
-3686
-edavis10
+2010-11-19T13:04:41.472627Z
+35fe09d5b7c9ad179df6c1aa5d09e25d
+2010-11-06T14:30:32.528294Z
+4375
+jplang
has-props
@@ -1656,7 +1690,7 @@
-13195
+16321
auth_sources_controller_test.rb
file
@@ -1698,10 +1732,10 @@
-2010-09-23T14:37:45.387766Z
-7bac137a145f14ca591811bb76d56bee
-2010-08-18T15:01:35.032314Z
-3946
+2010-11-19T13:04:41.472627Z
+055c4c3716d7eb1d123482c20d453a67
+2010-09-24T16:26:46.819682Z
+4174
edavis10
@@ -1724,7 +1758,7 @@
-688
+1101
repositories_subversion_controller_test.rb
file
@@ -1732,10 +1766,10 @@
-2010-09-23T14:37:45.423771Z
-3a3e1acd6e8097c938879aca2284280b
-2010-06-20T16:08:26.745839Z
-3800
+2010-11-19T13:04:41.472627Z
+78fad597ea49ad0dfc7d71f2d33c381f
+2010-10-25T15:42:41.795656Z
+4289
edavis10
has-props
@@ -1758,7 +1792,7 @@
-8790
+8796
issue_relations_controller_test.rb
file
@@ -1800,11 +1834,11 @@
-2010-09-24T12:48:25.879729Z
-0ec41a16228288272bc26862cb87c358
-2010-09-17T15:55:08.377083Z
-4097
-edavis10
+2010-11-19T13:04:41.476627Z
+dcafef0668ab2fa1356e11ec2651965e
+2010-11-01T13:13:32.982466Z
+4354
+jplang
has-props
@@ -1826,7 +1860,7 @@
-5035
+5338
enumerations_controller_test.rb
file
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/account_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/account_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/account_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -64,7 +64,7 @@
assert existing_user.save!
post :login, :openid_url => existing_user.identity_url
- assert_redirected_to 'my/page'
+ assert_redirected_to '/my/page'
end
def test_login_with_invalid_openid_provider
@@ -86,14 +86,14 @@
assert existing_user.save!
post :login, :openid_url => existing_user.identity_url
- assert_redirected_to 'login'
+ assert_redirected_to '/login'
end
def test_login_with_openid_with_new_user_created
Setting.self_registration = '3'
Setting.openid = '1'
post :login, :openid_url => 'http://openid.example.com/good_user'
- assert_redirected_to 'my/account'
+ assert_redirected_to '/my/account'
user = User.find_by_login('cool_user')
assert user
assert_equal 'Cool', user.firstname
@@ -113,7 +113,7 @@
Setting.self_registration = '1'
Setting.openid = '1'
post :login, :openid_url => 'http://openid.example.com/good_user'
- assert_redirected_to 'login'
+ assert_redirected_to '/login'
user = User.find_by_login('cool_user')
assert user
@@ -125,7 +125,7 @@
Setting.self_registration = '2'
Setting.openid = '1'
post :login, :openid_url => 'http://openid.example.com/good_user'
- assert_redirected_to 'login'
+ assert_redirected_to '/login'
user = User.find_by_login('cool_user')
assert user
assert_equal User::STATUS_REGISTERED, user.status
@@ -157,7 +157,7 @@
def test_logout
@request.session[:user_id] = 2
get :logout
- assert_redirected_to ''
+ assert_redirected_to '/'
assert_nil @request.session[:user_id]
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/attachments_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/attachments_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/attachments_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -95,7 +95,7 @@
post :destroy, :id => 1
end
# no referrer
- assert_redirected_to 'projects/ecookbook'
+ assert_redirected_to '/projects/ecookbook'
assert_nil Attachment.find_by_id(1)
j = issue.journals.find(:first, :order => 'created_on DESC')
assert_equal 'attachment', j.details.first.property
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/calendars_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/calendars_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/calendars_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -16,6 +16,16 @@
assert_template 'calendar'
assert_not_nil assigns(:calendar)
end
+
+ context "GET :show" do
+ should "run custom queries" do
+ @query = Query.generate_default!
+
+ get :show, :query_id => @query.id
+ assert_response :success
+ end
+
+ end
def test_week_number_calculation
Setting.start_of_week = 7
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/comments_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/comments_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/comments_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -27,7 +27,7 @@
def test_add_comment
@request.session[:user_id] = 2
post :create, :id => 1, :comment => { :comments => 'This is a test comment' }
- assert_redirected_to 'news/1'
+ assert_redirected_to '/news/1'
comment = News.find(1).comments.find(:first, :order => 'created_on DESC')
assert_not_nil comment
@@ -40,7 +40,7 @@
assert_no_difference 'Comment.count' do
post :create, :id => 1, :comment => { :comments => '' }
assert_response :redirect
- assert_redirected_to 'news/1'
+ assert_redirected_to '/news/1'
end
end
@@ -48,7 +48,7 @@
comments_count = News.find(1).comments.size
@request.session[:user_id] = 2
delete :destroy, :id => 1, :comment_id => 2
- assert_redirected_to 'news/1'
+ assert_redirected_to '/news/1'
assert_nil Comment.find_by_id(2)
assert_equal comments_count - 1, News.find(1).comments.size
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/context_menus_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/context_menus_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/context_menus_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -79,14 +79,27 @@
:class => 'icon-del' }
end
- def test_context_menu_multiple_issues_of_different_project
+ def test_context_menu_multiple_issues_of_different_projects
@request.session[:user_id] = 2
- get :issues, :ids => [1, 2, 4]
+ get :issues, :ids => [1, 2, 6]
assert_response :success
assert_template 'context_menu'
+ ids = "ids%5B%5D=1&ids%5B%5D=2&ids%5B%5D=6"
+ assert_tag :tag => 'a', :content => 'Edit',
+ :attributes => { :href => "/issues/bulk_edit?#{ids}",
+ :class => 'icon-edit' }
+ assert_tag :tag => 'a', :content => 'Closed',
+ :attributes => { :href => "/issues/bulk_edit?#{ids}&issue%5Bstatus_id%5D=5",
+ :class => '' }
+ assert_tag :tag => 'a', :content => 'Immediate',
+ :attributes => { :href => "/issues/bulk_edit?#{ids}&issue%5Bpriority_id%5D=8",
+ :class => '' }
+ assert_tag :tag => 'a', :content => 'John Smith',
+ :attributes => { :href => "/issues/bulk_edit?#{ids}&issue%5Bassigned_to_id%5D=2",
+ :class => '' }
assert_tag :tag => 'a', :content => 'Delete',
- :attributes => { :href => '#',
- :class => 'icon-del disabled' }
+ :attributes => { :href => "/issues/destroy?#{ids}",
+ :class => 'icon-del' }
end
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/documents_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/documents_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/documents_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -77,7 +77,7 @@
:category_id => 2},
:attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}}
- assert_redirected_to 'projects/ecookbook/documents'
+ assert_redirected_to '/projects/ecookbook/documents'
document = Document.find_by_title('DocumentsControllerTest#test_post_new')
assert_not_nil document
@@ -90,7 +90,7 @@
def test_destroy
@request.session[:user_id] = 2
post :destroy, :id => 1
- assert_redirected_to 'projects/ecookbook/documents'
+ assert_redirected_to '/projects/ecookbook/documents'
assert_nil Document.find_by_id(1)
end
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/files_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/files_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/files_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -37,7 +37,7 @@
:attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}}
assert_response :redirect
end
- assert_redirected_to 'projects/ecookbook/files'
+ assert_redirected_to '/projects/ecookbook/files'
a = Attachment.find(:first, :order => 'created_on DESC')
assert_equal 'testfile.txt', a.filename
assert_equal Project.find(1), a.container
@@ -58,7 +58,7 @@
:attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}}
assert_response :redirect
end
- assert_redirected_to 'projects/ecookbook/files'
+ assert_redirected_to '/projects/ecookbook/files'
a = Attachment.find(:first, :order => 'created_on DESC')
assert_equal 'testfile.txt', a.filename
assert_equal Version.find(2), a.container
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/gantts_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/gantts_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/gantts_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -20,6 +20,25 @@
i = Issue.find(2)
assert_select "div a.issue", /##{i.id}/
end
+
+ should "work without issue due dates" do
+ Issue.update_all("due_date = NULL")
+
+ get :show, :project_id => 1
+ assert_response :success
+ assert_template 'show.html.erb'
+ assert_not_nil assigns(:gantt)
+ end
+
+ should "work without issue and version due dates" do
+ Issue.update_all("due_date = NULL")
+ Version.update_all("effective_date = NULL")
+
+ get :show, :project_id => 1
+ assert_response :success
+ assert_template 'show.html.erb'
+ assert_not_nil assigns(:gantt)
+ end
should "work cross project" do
get :show
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/groups_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/groups_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/groups_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -54,7 +54,7 @@
assert_difference 'Group.count' do
post :create, :group => {:lastname => 'New group'}
end
- assert_redirected_to 'groups'
+ assert_redirected_to '/groups'
end
def test_edit
@@ -65,14 +65,14 @@
def test_update
post :update, :id => 10
- assert_redirected_to 'groups'
+ assert_redirected_to '/groups'
end
def test_destroy
assert_difference 'Group.count', -1 do
post :destroy, :id => 10
end
- assert_redirected_to 'groups'
+ assert_redirected_to '/groups'
end
def test_add_users
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/issue_moves_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/issue_moves_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/issue_moves_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -40,6 +40,31 @@
assert_equal 2, Issue.find(2).tracker_id
end
+ context "#create via bulk move" do
+ setup do
+ @request.session[:user_id] = 2
+ end
+
+ should "allow changing the issue priority" do
+ post :create, :ids => [1, 2], :priority_id => 6
+
+ assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook'
+ assert_equal 6, Issue.find(1).priority_id
+ assert_equal 6, Issue.find(2).priority_id
+
+ end
+
+ should "allow adding a note when moving" do
+ post :create, :ids => [1, 2], :notes => 'Moving two issues'
+
+ assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook'
+ assert_equal 'Moving two issues', Issue.find(1).journals.last.notes
+ assert_equal 'Moving two issues', Issue.find(2).journals.last.notes
+
+ end
+
+ end
+
def test_bulk_copy_to_another_project
@request.session[:user_id] = 2
assert_difference 'Issue.count', 2 do
@@ -47,7 +72,7 @@
post :create, :ids => [1, 2], :new_project_id => 2, :copy_options => {:copy => '1'}
end
end
- assert_redirected_to 'projects/ecookbook/issues'
+ assert_redirected_to '/projects/ecookbook/issues'
end
context "#create via bulk copy" do
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/issues_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/issues_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/issues_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -125,11 +125,42 @@
assert_tag :tag => 'a', :content => /Issue of a private subproject/
end
- def test_index_with_project_and_filter
+ def test_index_with_project_and_default_filter
get :index, :project_id => 1, :set_filter => 1
assert_response :success
assert_template 'index.rhtml'
assert_not_nil assigns(:issues)
+
+ query = assigns(:query)
+ assert_not_nil query
+ # default filter
+ assert_equal({'status_id' => {:operator => 'o', :values => ['']}}, query.filters)
+ end
+
+ def test_index_with_project_and_filter
+ get :index, :project_id => 1, :set_filter => 1,
+ :fields => ['tracker_id'],
+ :operators => {'tracker_id' => '='},
+ :values => {'tracker_id' => ['1']}
+ assert_response :success
+ assert_template 'index.rhtml'
+ assert_not_nil assigns(:issues)
+
+ query = assigns(:query)
+ assert_not_nil query
+ assert_equal({'tracker_id' => {:operator => '=', :values => ['1']}}, query.filters)
+ end
+
+ def test_index_with_project_and_empty_filters
+ get :index, :project_id => 1, :set_filter => 1, :fields => ['']
+ assert_response :success
+ assert_template 'index.rhtml'
+ assert_not_nil assigns(:issues)
+
+ query = assigns(:query)
+ assert_not_nil query
+ # no filter
+ assert_equal({}, query.filters)
end
def test_index_with_query
@@ -340,9 +371,7 @@
get :new, :project_id => 1
assert_response 500
- assert_not_nil flash[:error]
- assert_tag :tag => 'div', :attributes => { :class => /error/ },
- :content => /No default issue/
+ assert_error_tag :content => /No default issue/
end
def test_get_new_with_no_tracker_should_display_an_error
@@ -351,9 +380,7 @@
get :new, :project_id => 1
assert_response 500
- assert_not_nil flash[:error]
- assert_tag :tag => 'div', :attributes => { :class => /error/ },
- :content => /No tracker/
+ assert_error_tag :content => /No tracker/
end
def test_update_new_form
@@ -382,6 +409,7 @@
:subject => 'This is the test_new issue',
:description => 'This is the description',
:priority_id => 5,
+ :start_date => '2010-11-07',
:estimated_hours => '',
:custom_field_values => {'2' => 'Value for field 2'}}
end
@@ -392,12 +420,33 @@
assert_equal 2, issue.author_id
assert_equal 3, issue.tracker_id
assert_equal 2, issue.status_id
+ assert_equal Date.parse('2010-11-07'), issue.start_date
assert_nil issue.estimated_hours
v = issue.custom_values.find(:first, :conditions => {:custom_field_id => 2})
assert_not_nil v
assert_equal 'Value for field 2', v.value
end
+ def test_post_create_without_start_date
+ @request.session[:user_id] = 2
+ assert_difference 'Issue.count' do
+ post :create, :project_id => 1,
+ :issue => {:tracker_id => 3,
+ :status_id => 2,
+ :subject => 'This is the test_new issue',
+ :description => 'This is the description',
+ :priority_id => 5,
+ :start_date => '',
+ :estimated_hours => '',
+ :custom_field_values => {'2' => 'Value for field 2'}}
+ end
+ assert_redirected_to :controller => 'issues', :action => 'show', :id => Issue.last.id
+
+ issue = Issue.find_by_subject('This is the test_new issue')
+ assert_not_nil issue
+ assert_nil issue.start_date
+ end
+
def test_post_create_and_continue
@request.session[:user_id] = 2
post :create, :project_id => 1,
@@ -531,7 +580,7 @@
context "without workflow privilege" do
setup do
Workflow.delete_all(["role_id = ?", Role.anonymous.id])
- Role.anonymous.add_permission! :add_issues
+ Role.anonymous.add_permission! :add_issues, :add_issue_notes
end
context "#new" do
@@ -556,6 +605,17 @@
assert_equal IssueStatus.default, issue.status
end
+ should "accept default status" do
+ assert_difference 'Issue.count' do
+ post :create, :project_id => 1,
+ :issue => {:tracker_id => 1,
+ :subject => 'This is an issue',
+ :status_id => 1}
+ end
+ issue = Issue.last(:order => 'id')
+ assert_equal IssueStatus.default, issue.status
+ end
+
should "ignore unauthorized status" do
assert_difference 'Issue.count' do
post :create, :project_id => 1,
@@ -567,6 +627,94 @@
assert_equal IssueStatus.default, issue.status
end
end
+
+ context "#update" do
+ should "ignore status change" do
+ assert_difference 'Journal.count' do
+ put :update, :id => 1, :notes => 'just trying', :issue => {:status_id => 3}
+ end
+ assert_equal 1, Issue.find(1).status_id
+ end
+
+ should "ignore attributes changes" do
+ assert_difference 'Journal.count' do
+ put :update, :id => 1, :notes => 'just trying', :issue => {:subject => 'changed', :assigned_to_id => 2}
+ end
+ issue = Issue.find(1)
+ assert_equal "Can't print recipes", issue.subject
+ assert_nil issue.assigned_to
+ end
+ end
+ end
+
+ context "with workflow privilege" do
+ setup do
+ Workflow.delete_all(["role_id = ?", Role.anonymous.id])
+ Workflow.create!(:role => Role.anonymous, :tracker_id => 1, :old_status_id => 1, :new_status_id => 3)
+ Workflow.create!(:role => Role.anonymous, :tracker_id => 1, :old_status_id => 1, :new_status_id => 4)
+ Role.anonymous.add_permission! :add_issues, :add_issue_notes
+ end
+
+ context "#update" do
+ should "accept authorized status" do
+ assert_difference 'Journal.count' do
+ put :update, :id => 1, :notes => 'just trying', :issue => {:status_id => 3}
+ end
+ assert_equal 3, Issue.find(1).status_id
+ end
+
+ should "ignore unauthorized status" do
+ assert_difference 'Journal.count' do
+ put :update, :id => 1, :notes => 'just trying', :issue => {:status_id => 2}
+ end
+ assert_equal 1, Issue.find(1).status_id
+ end
+
+ should "accept authorized attributes changes" do
+ assert_difference 'Journal.count' do
+ put :update, :id => 1, :notes => 'just trying', :issue => {:assigned_to_id => 2}
+ end
+ issue = Issue.find(1)
+ assert_equal 2, issue.assigned_to_id
+ end
+
+ should "ignore unauthorized attributes changes" do
+ assert_difference 'Journal.count' do
+ put :update, :id => 1, :notes => 'just trying', :issue => {:subject => 'changed'}
+ end
+ issue = Issue.find(1)
+ assert_equal "Can't print recipes", issue.subject
+ end
+ end
+
+ context "and :edit_issues permission" do
+ setup do
+ Role.anonymous.add_permission! :add_issues, :edit_issues
+ end
+
+ should "accept authorized status" do
+ assert_difference 'Journal.count' do
+ put :update, :id => 1, :notes => 'just trying', :issue => {:status_id => 3}
+ end
+ assert_equal 3, Issue.find(1).status_id
+ end
+
+ should "ignore unauthorized status" do
+ assert_difference 'Journal.count' do
+ put :update, :id => 1, :notes => 'just trying', :issue => {:status_id => 2}
+ end
+ assert_equal 1, Issue.find(1).status_id
+ end
+
+ should "accept authorized attributes changes" do
+ assert_difference 'Journal.count' do
+ put :update, :id => 1, :notes => 'just trying', :issue => {:subject => 'changed', :assigned_to_id => 2}
+ end
+ issue = Issue.find(1)
+ assert_equal "changed", issue.subject
+ assert_equal 2, issue.assigned_to_id
+ end
+ end
end
def test_copy_issue
@@ -589,7 +737,8 @@
def test_get_edit_with_params
@request.session[:user_id] = 2
- get :edit, :id => 1, :issue => { :status_id => 5, :priority_id => 7 }
+ get :edit, :id => 1, :issue => { :status_id => 5, :priority_id => 7 },
+ :time_entry => { :hours => '2.5', :comments => 'test_get_edit_with_params', :activity_id => TimeEntryActivity.first.id }
assert_response :success
assert_template 'edit'
@@ -607,6 +756,12 @@
:child => { :tag => 'option',
:content => 'Urgent',
:attributes => { :selected => 'selected' } }
+
+ assert_tag :input, :attributes => { :name => 'time_entry[hours]', :value => '2.5' }
+ assert_tag :select, :attributes => { :name => 'time_entry[activity_id]' },
+ :child => { :tag => 'option',
+ :attributes => { :selected => 'selected', :value => TimeEntryActivity.first.id } }
+ assert_tag :input, :attributes => { :name => 'time_entry[comments]', :value => 'test_get_edit_with_params' }
end
def test_update_edit_form
@@ -911,6 +1066,19 @@
assert_tag :select, :attributes => {:name => 'issue[custom_field_values][1]'}
end
+ def test_get_bulk_edit_on_different_projects
+ @request.session[:user_id] = 2
+ get :bulk_edit, :ids => [1, 2, 6]
+ assert_response :success
+ assert_template 'bulk_edit'
+
+ # Project specific custom field, date type
+ field = CustomField.find(9)
+ assert !field.is_for_all?
+ assert !field.project_ids.include?(Issue.find(6).project_id)
+ assert_no_tag :input, :attributes => {:name => 'issue[custom_field_values][9]'}
+ end
+
def test_bulk_update
@request.session[:user_id] = 2
# update issues priority
@@ -930,6 +1098,39 @@
assert_equal 1, journal.details.size
end
+ def test_bulk_update_on_different_projects
+ @request.session[:user_id] = 2
+ # update issues priority
+ post :bulk_update, :ids => [1, 2, 6], :notes => 'Bulk editing',
+ :issue => {:priority_id => 7,
+ :assigned_to_id => '',
+ :custom_field_values => {'2' => ''}}
+
+ assert_response 302
+ # check that the issues were updated
+ assert_equal [7, 7, 7], Issue.find([1,2,6]).map(&:priority_id)
+
+ issue = Issue.find(1)
+ journal = issue.journals.find(:first, :order => 'created_on DESC')
+ assert_equal '125', issue.custom_value_for(2).value
+ assert_equal 'Bulk editing', journal.notes
+ assert_equal 1, journal.details.size
+ end
+
+ def test_bulk_update_on_different_projects_without_rights
+ @request.session[:user_id] = 3
+ user = User.find(3)
+ action = { :controller => "issues", :action => "bulk_update" }
+ assert user.allowed_to?(action, Issue.find(1).project)
+ assert ! user.allowed_to?(action, Issue.find(6).project)
+ post :bulk_update, :ids => [1, 6], :notes => 'Bulk should fail',
+ :issue => {:priority_id => 7,
+ :assigned_to_id => '',
+ :custom_field_values => {'2' => ''}}
+ assert_response 403
+ assert_not_equal "Bulk should fail", Journal.last.notes
+ end
+
def test_bullk_update_should_send_a_notification
@request.session[:user_id] = 2
ActionMailer::Base.deliveries.clear
@@ -1061,6 +1262,13 @@
assert_equal 2, TimeEntry.find(2).issue_id
end
+ def test_destroy_issues_from_different_projects
+ @request.session[:user_id] = 2
+ post :destroy, :ids => [1, 2, 6], :todo => 'destroy'
+ assert_redirected_to :controller => 'issues', :action => 'index'
+ assert !(Issue.find_by_id(1) || Issue.find_by_id(2) || Issue.find_by_id(6))
+ end
+
def test_default_search_scope
get :index
assert_tag :div, :attributes => {:id => 'quick-search'},
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/messages_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/messages_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/messages_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -87,7 +87,7 @@
:content => 'Message body'}
message = Message.find_by_subject('Test created message')
assert_not_nil message
- assert_redirected_to "boards/1/topics/#{message.to_param}"
+ assert_redirected_to "/boards/1/topics/#{message.to_param}"
assert_equal 'Message body', message.content
assert_equal 2, message.author_id
assert_equal 1, message.board_id
@@ -114,7 +114,7 @@
post :edit, :board_id => 1, :id => 1,
:message => { :subject => 'New subject',
:content => 'New body'}
- assert_redirected_to 'boards/1/topics/1'
+ assert_redirected_to '/boards/1/topics/1'
message = Message.find(1)
assert_equal 'New subject', message.subject
assert_equal 'New body', message.content
@@ -124,14 +124,14 @@
@request.session[:user_id] = 2
post :reply, :board_id => 1, :id => 1, :reply => { :content => 'This is a test reply', :subject => 'Test reply' }
reply = Message.find(:first, :order => 'id DESC')
- assert_redirected_to "boards/1/topics/1?r=#{reply.id}"
+ assert_redirected_to "/boards/1/topics/1?r=#{reply.id}"
assert Message.find_by_subject('Test reply')
end
def test_destroy_topic
@request.session[:user_id] = 2
post :destroy, :board_id => 1, :id => 1
- assert_redirected_to 'projects/ecookbook/boards/1'
+ assert_redirected_to '/projects/ecookbook/boards/1'
assert_nil Message.find_by_id(1)
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/my_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/my_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/my_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -68,7 +68,7 @@
:login => "root",
:admin => 1,
:custom_field_values => {"4" => "0100562500"}}
- assert_redirected_to 'my/account'
+ assert_redirected_to '/my/account'
user = User.find(2)
assert_equal user, assigns(:user)
assert_equal "Joe", user.firstname
@@ -102,7 +102,7 @@
post :password, :password => 'jsmith',
:new_password => 'hello',
:new_password_confirmation => 'hello'
- assert_redirected_to 'my/account'
+ assert_redirected_to '/my/account'
assert User.try_to_login('jsmith', 'hello')
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/news_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/news_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/news_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -73,7 +73,7 @@
post :create, :project_id => 1, :news => { :title => 'NewsControllerTest',
:description => 'This is the description',
:summary => '' }
- assert_redirected_to 'projects/ecookbook/news'
+ assert_redirected_to '/projects/ecookbook/news'
news = News.find_by_title('NewsControllerTest')
assert_not_nil news
@@ -93,7 +93,7 @@
def test_put_update
@request.session[:user_id] = 2
put :update, :id => 1, :news => { :description => 'Description changed by test_post_edit' }
- assert_redirected_to 'news/1'
+ assert_redirected_to '/news/1'
news = News.find(1)
assert_equal 'Description changed by test_post_edit', news.description
end
@@ -113,19 +113,8 @@
def test_destroy
@request.session[:user_id] = 2
- post :destroy, :id => 1
- assert_redirected_to 'projects/ecookbook/news'
+ delete :destroy, :id => 1
+ assert_redirected_to '/projects/ecookbook/news'
assert_nil News.find_by_id(1)
end
-
- def test_preview
- get :preview, :project_id => 1,
- :news => {:title => '',
- :description => 'News description',
- :summary => ''}
- assert_response :success
- assert_template 'common/_preview'
- assert_tag :tag => 'fieldset', :attributes => { :class => 'preview' },
- :content => /News description/
- end
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/previews_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/previews_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/previews_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -19,4 +19,14 @@
assert_not_nil assigns(:notes)
end
+ def test_news
+ get :news, :project_id => 1,
+ :news => {:title => '',
+ :description => 'News description',
+ :summary => ''}
+ assert_response :success
+ assert_template 'common/_preview'
+ assert_tag :tag => 'fieldset', :attributes => { :class => 'preview' },
+ :content => /News description/
+ end
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/project_enumerations_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/project_enumerations_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/project_enumerations_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -20,7 +20,7 @@
}
assert_response :redirect
- assert_redirected_to 'projects/ecookbook/settings/activities'
+ assert_redirected_to '/projects/ecookbook/settings/activities'
# Created project specific activities...
project = Project.find('ecookbook')
@@ -83,7 +83,7 @@
}
assert_response :redirect
- assert_redirected_to 'projects/ecookbook/settings/activities'
+ assert_redirected_to '/projects/ecookbook/settings/activities'
# Created project specific activities...
project = Project.find('ecookbook')
@@ -159,7 +159,7 @@
delete :destroy, :project_id => 1
assert_response :redirect
- assert_redirected_to 'projects/ecookbook/settings/activities'
+ assert_redirected_to '/projects/ecookbook/settings/activities'
assert_nil TimeEntryActivity.find_by_id(project_activity.id)
assert_nil TimeEntryActivity.find_by_id(project_activity_two.id)
@@ -179,7 +179,7 @@
delete :destroy, :project_id => 1
assert_response :redirect
- assert_redirected_to 'projects/ecookbook/settings/activities'
+ assert_redirected_to '/projects/ecookbook/settings/activities'
assert_nil TimeEntryActivity.find_by_id(project_activity.id)
assert_equal 0, TimeEntry.find_all_by_activity_id_and_project_id(project_activity.id, 1).size, "TimeEntries still assigned to project specific activity"
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/projects_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/projects_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/projects_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -284,6 +284,18 @@
assert_template 'show'
assert_not_nil assigns(:project)
assert_equal Project.find_by_identifier('ecookbook'), assigns(:project)
+
+ assert_tag 'li', :content => /Development status/
+ end
+
+ def test_show_should_not_display_hidden_custom_fields
+ ProjectCustomField.find_by_name('Development status').update_attribute :visible, false
+ get :show, :id => 'ecookbook'
+ assert_response :success
+ assert_template 'show'
+ assert_not_nil assigns(:project)
+
+ assert_no_tag 'li', :content => /Development status/
end
def test_show_should_not_fail_when_custom_values_are_nil
@@ -296,6 +308,16 @@
assert_equal Project.find_by_identifier('ecookbook'), assigns(:project)
end
+ def show_archived_project_should_be_denied
+ project = Project.find_by_identifier('ecookbook')
+ project.archive!
+
+ get :show, :id => 'ecookbook'
+ assert_response 403
+ assert_nil assigns(:project)
+ assert_tag :tag => 'p', :content => /archived/
+ end
+
def test_private_subprojects_hidden
get :show, :id => 'ecookbook'
assert_response :success
@@ -322,7 +344,7 @@
@request.session[:user_id] = 2 # manager
post :update, :id => 1, :project => {:name => 'Test changed name',
:issue_custom_field_ids => ['']}
- assert_redirected_to 'projects/ecookbook/settings'
+ assert_redirected_to '/projects/ecookbook/settings'
project = Project.find(1)
assert_equal 'Test changed name', project.name
end
@@ -338,14 +360,14 @@
def test_post_destroy
@request.session[:user_id] = 1 # admin
post :destroy, :id => 1, :confirm => 1
- assert_redirected_to 'admin/projects'
+ assert_redirected_to '/admin/projects'
assert_nil Project.find_by_id(1)
end
def test_archive
@request.session[:user_id] = 1 # admin
post :archive, :id => 1
- assert_redirected_to 'admin/projects'
+ assert_redirected_to '/admin/projects'
assert !Project.find(1).active?
end
@@ -353,7 +375,7 @@
@request.session[:user_id] = 1 # admin
Project.find(1).archive
post :unarchive, :id => 1
- assert_redirected_to 'admin/projects'
+ assert_redirected_to '/admin/projects'
assert Project.find(1).active?
end
@@ -389,9 +411,20 @@
assert_redirected_to :controller => 'admin', :action => 'projects'
end
+ context "POST :copy" do
+ should "TODO: test the rest of the method"
+
+ should "redirect to the project settings when successful" do
+ @request.session[:user_id] = 1 # admin
+ post :copy, :id => 1, :project => {:name => 'Copy', :identifier => 'unique-copy'}
+ assert_response :redirect
+ assert_redirected_to :controller => 'projects', :action => 'settings'
+ end
+ end
+
def test_jump_should_redirect_to_active_tab
get :show, :id => 1, :jump => 'issues'
- assert_redirected_to 'projects/ecookbook/issues'
+ assert_redirected_to '/projects/ecookbook/issues'
end
def test_jump_should_not_redirect_to_inactive_tab
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/repositories_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/repositories_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/repositories_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -98,7 +98,7 @@
assert_no_difference "Changeset.count(:conditions => 'user_id = 3')" do
post :committers, :id => 1, :committers => { '0' => ['foo', '2'], '1' => ['dlopper', '3']}
- assert_redirected_to 'projects/ecookbook/repository/committers'
+ assert_redirected_to '/projects/ecookbook/repository/committers'
assert_equal User.find(2), c.reload.user
end
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/repositories_cvs_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/repositories_cvs_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/repositories_cvs_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -106,7 +106,7 @@
def test_entry_not_found
get :entry, :id => 1, :path => ['sources', 'zzz.c']
- assert_tag :tag => 'div', :attributes => { :class => /error/ },
+ assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
:content => /The entry or revision was not found in the repository/
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/repositories_git_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/repositories_git_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/repositories_git_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -50,7 +50,7 @@
assert_response :success
assert_template 'show'
assert_not_nil assigns(:entries)
- assert_equal 7, assigns(:entries).size
+ assert_equal 9, assigns(:entries).size
assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'}
assert assigns(:entries).detect {|e| e.name == 'this_is_a_really_long_and_verbose_directory_name' && e.kind == 'dir'}
assert assigns(:entries).detect {|e| e.name == 'sources' && e.kind == 'dir'}
@@ -58,6 +58,8 @@
assert assigns(:entries).detect {|e| e.name == 'copied_README' && e.kind == 'file'}
assert assigns(:entries).detect {|e| e.name == 'new_file.txt' && e.kind == 'file'}
assert assigns(:entries).detect {|e| e.name == 'renamed_test.txt' && e.kind == 'file'}
+ assert assigns(:entries).detect {|e| e.name == 'filemane with spaces.txt' && e.kind == 'file'}
+ assert assigns(:entries).detect {|e| e.name == ' filename with a leading space.txt ' && e.kind == 'file'}
end
def test_browse_branch
@@ -152,7 +154,7 @@
def test_annotate_binary_file
get :annotate, :id => 3, :path => ['images', 'edit.png']
assert_response 500
- assert_tag :tag => 'div', :attributes => { :class => /error/ },
+ assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
:content => /can not be annotated/
end
else
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/repositories_subversion_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/repositories_subversion_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/repositories_subversion_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -129,7 +129,7 @@
def test_entry_not_found
get :entry, :id => 1, :path => ['subversion_test', 'zzz.c']
- assert_tag :tag => 'div', :attributes => { :class => /error/ },
+ assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
:content => /The entry or revision was not found in the repository/
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/roles_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/roles_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/roles_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -65,7 +65,7 @@
:permissions => ['add_issues', 'edit_issues', 'log_time', ''],
:assignable => '0'}
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
role = Role.find_by_name('RoleWithoutWorkflowCopy')
assert_not_nil role
assert_equal [:add_issues, :edit_issues, :log_time], role.permissions
@@ -78,7 +78,7 @@
:assignable => '0'},
:copy_workflow_from => '1'
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
role = Role.find_by_name('RoleWithWorkflowCopy')
assert_not_nil role
assert_equal Role.find(1).workflows.size, role.workflows.size
@@ -97,7 +97,7 @@
:permissions => ['edit_project', ''],
:assignable => '0'}
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
role = Role.find(1)
assert_equal [:edit_project], role.permissions
end
@@ -107,13 +107,13 @@
assert r.save
post :destroy, :id => r
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
assert_nil Role.find_by_id(r.id)
end
def test_destroy_role_in_use
post :destroy, :id => 1
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
assert flash[:error] == 'This role is in use and can not be deleted.'
assert_not_nil Role.find_by_id(1)
end
@@ -139,7 +139,7 @@
def test_post_report
post :report, :permissions => { '0' => '', '1' => ['edit_issues'], '3' => ['add_issues', 'delete_issues']}
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
assert_equal [:edit_issues], Role.find(1).permissions
assert_equal [:add_issues, :delete_issues], Role.find(3).permissions
@@ -148,33 +148,33 @@
def test_clear_all_permissions
post :report, :permissions => { '0' => '' }
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
assert Role.find(1).permissions.empty?
end
def test_move_highest
post :edit, :id => 3, :role => {:move_to => 'highest'}
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
assert_equal 1, Role.find(3).position
end
def test_move_higher
position = Role.find(3).position
post :edit, :id => 3, :role => {:move_to => 'higher'}
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
assert_equal position - 1, Role.find(3).position
end
def test_move_lower
position = Role.find(2).position
post :edit, :id => 2, :role => {:move_to => 'lower'}
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
assert_equal position + 1, Role.find(2).position
end
def test_move_lowest
post :edit, :id => 2, :role => {:move_to => 'lowest'}
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
assert_equal Role.count, Role.find(2).position
end
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/search_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/search_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/search_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -126,7 +126,7 @@
def test_quick_jump_to_issue
# issue of a public project
get :index, :q => "3"
- assert_redirected_to 'issues/3'
+ assert_redirected_to '/issues/3'
# issue of a private project
get :index, :q => "4"
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/settings_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/settings_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/settings_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -50,7 +50,7 @@
:notified_events => %w(issue_added issue_updated news_added),
:emails_footer => 'Test footer'
}
- assert_redirected_to 'settings/edit'
+ assert_redirected_to '/settings/edit'
assert_equal 'functional@test.foo', Setting.mail_from
assert !Setting.bcc_recipients?
assert_equal %w(issue_added issue_updated news_added), Setting.notified_events
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/time_entry_reports_controller_test.rb.svn-base
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/functional/.svn/text-base/time_entry_reports_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,134 @@
+# -*- coding: utf-8 -*-
+require File.dirname(__FILE__) + '/../test_helper'
+
+class TimeEntryReportsControllerTest < ActionController::TestCase
+ fixtures :projects, :enabled_modules, :roles, :members, :member_roles, :issues, :time_entries, :users, :trackers, :enumerations, :issue_statuses, :custom_fields, :custom_values
+
+ def test_report_no_criteria
+ get :report, :project_id => 1
+ assert_response :success
+ assert_template 'report'
+ end
+
+ def test_report_all_projects
+ get :report
+ assert_response :success
+ assert_template 'report'
+ end
+
+ def test_report_all_projects_denied
+ r = Role.anonymous
+ r.permissions.delete(:view_time_entries)
+ r.permissions_will_change!
+ r.save
+ get :report
+ assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Ftime_entries%2Freport'
+ end
+
+ def test_report_all_projects_one_criteria
+ get :report, :columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criterias => ['project']
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_equal "8.65", "%.2f" % assigns(:total_hours)
+ end
+
+ def test_report_all_time
+ get :report, :project_id => 1, :criterias => ['project', 'issue']
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_equal "162.90", "%.2f" % assigns(:total_hours)
+ end
+
+ def test_report_all_time_by_day
+ get :report, :project_id => 1, :criterias => ['project', 'issue'], :columns => 'day'
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_equal "162.90", "%.2f" % assigns(:total_hours)
+ assert_tag :tag => 'th', :content => '2007-03-12'
+ end
+
+ def test_report_one_criteria
+ get :report, :project_id => 1, :columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criterias => ['project']
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_equal "8.65", "%.2f" % assigns(:total_hours)
+ end
+
+ def test_report_two_criterias
+ get :report, :project_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criterias => ["member", "activity"]
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_equal "162.90", "%.2f" % assigns(:total_hours)
+ end
+
+ def test_report_one_day
+ get :report, :project_id => 1, :columns => 'day', :from => "2007-03-23", :to => "2007-03-23", :criterias => ["member", "activity"]
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_equal "4.25", "%.2f" % assigns(:total_hours)
+ end
+
+ def test_report_at_issue_level
+ get :report, :project_id => 1, :issue_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criterias => ["member", "activity"]
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_equal "154.25", "%.2f" % assigns(:total_hours)
+ end
+
+ def test_report_custom_field_criteria
+ get :report, :project_id => 1, :criterias => ['project', 'cf_1', 'cf_7']
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_not_nil assigns(:criterias)
+ assert_equal 3, assigns(:criterias).size
+ assert_equal "162.90", "%.2f" % assigns(:total_hours)
+ # Custom field column
+ assert_tag :tag => 'th', :content => 'Database'
+ # Custom field row
+ assert_tag :tag => 'td', :content => 'MySQL',
+ :sibling => { :tag => 'td', :attributes => { :class => 'hours' },
+ :child => { :tag => 'span', :attributes => { :class => 'hours hours-int' },
+ :content => '1' }}
+ # Second custom field column
+ assert_tag :tag => 'th', :content => 'Billable'
+ end
+
+ def test_report_one_criteria_no_result
+ get :report, :project_id => 1, :columns => 'week', :from => "1998-04-01", :to => "1998-04-30", :criterias => ['project']
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_equal "0.00", "%.2f" % assigns(:total_hours)
+ end
+
+ def test_report_all_projects_csv_export
+ get :report, :columns => 'month', :from => "2007-01-01", :to => "2007-06-30", :criterias => ["project", "member", "activity"], :format => "csv"
+ assert_response :success
+ assert_equal 'text/csv', @response.content_type
+ lines = @response.body.chomp.split("\n")
+ # Headers
+ assert_equal 'Project,Member,Activity,2007-1,2007-2,2007-3,2007-4,2007-5,2007-6,Total', lines.first
+ # Total row
+ assert_equal 'Total,"","","","",154.25,8.65,"","",162.90', lines.last
+ end
+
+ def test_report_csv_export
+ get :report, :project_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-06-30", :criterias => ["project", "member", "activity"], :format => "csv"
+ assert_response :success
+ assert_equal 'text/csv', @response.content_type
+ lines = @response.body.chomp.split("\n")
+ # Headers
+ assert_equal 'Project,Member,Activity,2007-1,2007-2,2007-3,2007-4,2007-5,2007-6,Total', lines.first
+ # Total row
+ assert_equal 'Total,"","","","",154.25,8.65,"","",162.90', lines.last
+ end
+
+end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/timelog_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/timelog_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/timelog_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -31,9 +31,9 @@
@response = ActionController::TestResponse.new
end
- def test_get_edit
+ def test_get_new
@request.session[:user_id] = 3
- get :edit, :project_id => 1
+ get :new, :project_id => 1
assert_response :success
assert_template 'edit'
# Default activity selected
@@ -41,24 +41,24 @@
:content => 'Development'
end
+ def test_get_new_should_only_show_active_time_entry_activities
+ @request.session[:user_id] = 3
+ get :new, :project_id => 1
+ assert_response :success
+ assert_template 'edit'
+ assert_no_tag :tag => 'option', :content => 'Inactive Activity'
+
+ end
+
def test_get_edit_existing_time
@request.session[:user_id] = 2
get :edit, :id => 2, :project_id => nil
assert_response :success
assert_template 'edit'
# Default activity selected
- assert_tag :tag => 'form', :attributes => { :action => '/projects/ecookbook/timelog/edit/2' }
+ assert_tag :tag => 'form', :attributes => { :action => '/projects/ecookbook/time_entries/2' }
end
- def test_get_edit_should_only_show_active_time_entry_activities
- @request.session[:user_id] = 3
- get :edit, :project_id => 1
- assert_response :success
- assert_template 'edit'
- assert_no_tag :tag => 'option', :content => 'Inactive Activity'
-
- end
-
def test_get_edit_with_an_existing_time_entry_with_inactive_activity
te = TimeEntry.find(1)
te.activity = TimeEntryActivity.find_by_name("Inactive Activity")
@@ -72,18 +72,18 @@
assert_tag :tag => 'option', :content => '--- Please select ---'
end
- def test_post_edit
+ def test_post_create
# TODO: should POST to issues’ time log instead of project. change form
# and routing
@request.session[:user_id] = 3
- post :edit, :project_id => 1,
+ post :create, :project_id => 1,
:time_entry => {:comments => 'Some work on TimelogControllerTest',
# Not the default activity
:activity_id => '11',
:spent_on => '2008-03-14',
:issue_id => '1',
:hours => '7.3'}
- assert_redirected_to :action => 'details', :project_id => 'ecookbook'
+ assert_redirected_to :action => 'index', :project_id => 'ecookbook'
i = Issue.find(1)
t = TimeEntry.find_by_comments('Some work on TimelogControllerTest')
@@ -101,10 +101,10 @@
assert_equal 2, entry.user_id
@request.session[:user_id] = 1
- post :edit, :id => 1,
+ put :update, :id => 1,
:time_entry => {:issue_id => '2',
:hours => '8'}
- assert_redirected_to :action => 'details', :project_id => 'ecookbook'
+ assert_redirected_to :action => 'index', :project_id => 'ecookbook'
entry.reload
assert_equal 8, entry.hours
@@ -114,8 +114,8 @@
def test_destroy
@request.session[:user_id] = 2
- post :destroy, :id => 1
- assert_redirected_to :action => 'details', :project_id => 'ecookbook'
+ delete :destroy, :id => 1
+ assert_redirected_to :action => 'index', :project_id => 'ecookbook'
assert_equal I18n.t(:notice_successful_delete), flash[:notice]
assert_nil TimeEntry.find_by_id(1)
end
@@ -128,8 +128,8 @@
end
@request.session[:user_id] = 2
- post :destroy, :id => 1
- assert_redirected_to :action => 'details', :project_id => 'ecookbook'
+ delete :destroy, :id => 1
+ assert_redirected_to :action => 'index', :project_id => 'ecookbook'
assert_equal I18n.t(:notice_unable_delete_time_entry), flash[:error]
assert_not_nil TimeEntry.find_by_id(1)
@@ -137,145 +137,18 @@
TimeEntry.before_destroy.reject! {|callback| callback.method == :stop_callback_chain }
end
- def test_report_no_criteria
- get :report, :project_id => 1
+ def test_index_all_projects
+ get :index
assert_response :success
- assert_template 'report'
- end
-
- def test_report_all_projects
- get :report
- assert_response :success
- assert_template 'report'
- end
-
- def test_report_all_projects_denied
- r = Role.anonymous
- r.permissions.delete(:view_time_entries)
- r.permissions_will_change!
- r.save
- get :report
- assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Ftime_entries%2Freport'
- end
-
- def test_report_all_projects_one_criteria
- get :report, :columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criterias => ['project']
- assert_response :success
- assert_template 'report'
- assert_not_nil assigns(:total_hours)
- assert_equal "8.65", "%.2f" % assigns(:total_hours)
- end
-
- def test_report_all_time
- get :report, :project_id => 1, :criterias => ['project', 'issue']
- assert_response :success
- assert_template 'report'
- assert_not_nil assigns(:total_hours)
- assert_equal "162.90", "%.2f" % assigns(:total_hours)
- end
-
- def test_report_all_time_by_day
- get :report, :project_id => 1, :criterias => ['project', 'issue'], :columns => 'day'
- assert_response :success
- assert_template 'report'
- assert_not_nil assigns(:total_hours)
- assert_equal "162.90", "%.2f" % assigns(:total_hours)
- assert_tag :tag => 'th', :content => '2007-03-12'
- end
-
- def test_report_one_criteria
- get :report, :project_id => 1, :columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criterias => ['project']
- assert_response :success
- assert_template 'report'
- assert_not_nil assigns(:total_hours)
- assert_equal "8.65", "%.2f" % assigns(:total_hours)
- end
-
- def test_report_two_criterias
- get :report, :project_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criterias => ["member", "activity"]
- assert_response :success
- assert_template 'report'
+ assert_template 'index'
assert_not_nil assigns(:total_hours)
assert_equal "162.90", "%.2f" % assigns(:total_hours)
end
- def test_report_one_day
- get :report, :project_id => 1, :columns => 'day', :from => "2007-03-23", :to => "2007-03-23", :criterias => ["member", "activity"]
+ def test_index_at_project_level
+ get :index, :project_id => 1
assert_response :success
- assert_template 'report'
- assert_not_nil assigns(:total_hours)
- assert_equal "4.25", "%.2f" % assigns(:total_hours)
- end
-
- def test_report_at_issue_level
- get :report, :project_id => 1, :issue_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criterias => ["member", "activity"]
- assert_response :success
- assert_template 'report'
- assert_not_nil assigns(:total_hours)
- assert_equal "154.25", "%.2f" % assigns(:total_hours)
- end
-
- def test_report_custom_field_criteria
- get :report, :project_id => 1, :criterias => ['project', 'cf_1', 'cf_7']
- assert_response :success
- assert_template 'report'
- assert_not_nil assigns(:total_hours)
- assert_not_nil assigns(:criterias)
- assert_equal 3, assigns(:criterias).size
- assert_equal "162.90", "%.2f" % assigns(:total_hours)
- # Custom field column
- assert_tag :tag => 'th', :content => 'Database'
- # Custom field row
- assert_tag :tag => 'td', :content => 'MySQL',
- :sibling => { :tag => 'td', :attributes => { :class => 'hours' },
- :child => { :tag => 'span', :attributes => { :class => 'hours hours-int' },
- :content => '1' }}
- # Second custom field column
- assert_tag :tag => 'th', :content => 'Billable'
- end
-
- def test_report_one_criteria_no_result
- get :report, :project_id => 1, :columns => 'week', :from => "1998-04-01", :to => "1998-04-30", :criterias => ['project']
- assert_response :success
- assert_template 'report'
- assert_not_nil assigns(:total_hours)
- assert_equal "0.00", "%.2f" % assigns(:total_hours)
- end
-
- def test_report_all_projects_csv_export
- get :report, :columns => 'month', :from => "2007-01-01", :to => "2007-06-30", :criterias => ["project", "member", "activity"], :format => "csv"
- assert_response :success
- assert_equal 'text/csv', @response.content_type
- lines = @response.body.chomp.split("\n")
- # Headers
- assert_equal 'Project,Member,Activity,2007-1,2007-2,2007-3,2007-4,2007-5,2007-6,Total', lines.first
- # Total row
- assert_equal 'Total,"","","","",154.25,8.65,"","",162.90', lines.last
- end
-
- def test_report_csv_export
- get :report, :project_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-06-30", :criterias => ["project", "member", "activity"], :format => "csv"
- assert_response :success
- assert_equal 'text/csv', @response.content_type
- lines = @response.body.chomp.split("\n")
- # Headers
- assert_equal 'Project,Member,Activity,2007-1,2007-2,2007-3,2007-4,2007-5,2007-6,Total', lines.first
- # Total row
- assert_equal 'Total,"","","","",154.25,8.65,"","",162.90', lines.last
- end
-
- def test_details_all_projects
- get :details
- assert_response :success
- assert_template 'details'
- assert_not_nil assigns(:total_hours)
- assert_equal "162.90", "%.2f" % assigns(:total_hours)
- end
-
- def test_details_at_project_level
- get :details, :project_id => 1
- assert_response :success
- assert_template 'details'
+ assert_template 'index'
assert_not_nil assigns(:entries)
assert_equal 4, assigns(:entries).size
# project and subproject
@@ -287,10 +160,10 @@
assert_equal '2007-04-22'.to_date, assigns(:to)
end
- def test_details_at_project_level_with_date_range
- get :details, :project_id => 1, :from => '2007-03-20', :to => '2007-04-30'
+ def test_index_at_project_level_with_date_range
+ get :index, :project_id => 1, :from => '2007-03-20', :to => '2007-04-30'
assert_response :success
- assert_template 'details'
+ assert_template 'index'
assert_not_nil assigns(:entries)
assert_equal 3, assigns(:entries).size
assert_not_nil assigns(:total_hours)
@@ -299,28 +172,28 @@
assert_equal '2007-04-30'.to_date, assigns(:to)
end
- def test_details_at_project_level_with_period
- get :details, :project_id => 1, :period => '7_days'
+ def test_index_at_project_level_with_period
+ get :index, :project_id => 1, :period => '7_days'
assert_response :success
- assert_template 'details'
+ assert_template 'index'
assert_not_nil assigns(:entries)
assert_not_nil assigns(:total_hours)
assert_equal Date.today - 7, assigns(:from)
assert_equal Date.today, assigns(:to)
end
- def test_details_one_day
- get :details, :project_id => 1, :from => "2007-03-23", :to => "2007-03-23"
+ def test_index_one_day
+ get :index, :project_id => 1, :from => "2007-03-23", :to => "2007-03-23"
assert_response :success
- assert_template 'details'
+ assert_template 'index'
assert_not_nil assigns(:total_hours)
assert_equal "4.25", "%.2f" % assigns(:total_hours)
end
- def test_details_at_issue_level
- get :details, :issue_id => 1
+ def test_index_at_issue_level
+ get :index, :issue_id => 1
assert_response :success
- assert_template 'details'
+ assert_template 'index'
assert_not_nil assigns(:entries)
assert_equal 2, assigns(:entries).size
assert_not_nil assigns(:total_hours)
@@ -330,26 +203,26 @@
assert_equal '2007-04-22'.to_date, assigns(:to)
end
- def test_details_atom_feed
- get :details, :project_id => 1, :format => 'atom'
+ def test_index_atom_feed
+ get :index, :project_id => 1, :format => 'atom'
assert_response :success
assert_equal 'application/atom+xml', @response.content_type
assert_not_nil assigns(:items)
assert assigns(:items).first.is_a?(TimeEntry)
end
- def test_details_all_projects_csv_export
+ def test_index_all_projects_csv_export
Setting.date_format = '%m/%d/%Y'
- get :details, :format => 'csv'
+ get :index, :format => 'csv'
assert_response :success
assert_equal 'text/csv', @response.content_type
assert @response.body.include?("Date,User,Activity,Project,Issue,Tracker,Subject,Hours,Comment\n")
assert @response.body.include?("\n04/21/2007,redMine Admin,Design,eCookbook,3,Bug,Error 281 when updating a recipe,1.0,\"\"\n")
end
- def test_details_csv_export
+ def test_index_csv_export
Setting.date_format = '%m/%d/%Y'
- get :details, :project_id => 1, :format => 'csv'
+ get :index, :project_id => 1, :format => 'csv'
assert_response :success
assert_equal 'text/csv', @response.content_type
assert @response.body.include?("Date,User,Activity,Project,Issue,Tracker,Subject,Hours,Comment\n")
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/users_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/users_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/users_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -24,7 +24,7 @@
class UsersControllerTest < ActionController::TestCase
include Redmine::I18n
- fixtures :users, :projects, :members, :member_roles, :roles
+ fixtures :users, :projects, :members, :member_roles, :roles, :auth_sources, :custom_fields, :custom_values
def setup
@controller = UsersController.new
@@ -65,6 +65,19 @@
assert_response :success
assert_template 'show'
assert_not_nil assigns(:user)
+
+ assert_tag 'li', :content => /Phone number/
+ end
+
+ def test_show_should_not_display_hidden_custom_fields
+ @request.session[:user_id] = nil
+ UserCustomField.find_by_name('Phone number').update_attribute :visible, false
+ get :show, :id => 2
+ assert_response :success
+ assert_template 'show'
+ assert_not_nil assigns(:user)
+
+ assert_no_tag 'li', :content => /Phone number/
end
def test_show_should_not_fail_when_custom_values_are_nil
@@ -107,14 +120,65 @@
assert project_ids.include?(2) #private project admin can see
end
- def test_edit
+ context "GET :new" do
+ setup do
+ get :new
+ end
+
+ should_assign_to :user
+ should_respond_with :success
+ should_render_template :new
+ end
+
+ context "POST :create" do
+ context "when successful" do
+ setup do
+ post :create, :user => {
+ :firstname => 'John',
+ :lastname => 'Doe',
+ :login => 'jdoe',
+ :password => 'test',
+ :password_confirmation => 'test',
+ :mail => 'jdoe@gmail.com'
+ },
+ :notification_option => 'none'
+ end
+
+ should_assign_to :user
+ should_respond_with :redirect
+ should_redirect_to('user edit') { {:controller => 'users', :action => 'edit', :id => User.find_by_login('jdoe')}}
+
+ should 'set the users mail notification' do
+ user = User.last
+ assert_equal 'none', user.mail_notification
+ end
+ end
+
+ context "when unsuccessful" do
+ setup do
+ post :create, :user => {}
+ end
+
+ should_assign_to :user
+ should_respond_with :success
+ should_render_template :new
+ end
+
+ end
+
+ def test_update
ActionMailer::Base.deliveries.clear
- post :edit, :id => 2, :user => {:firstname => 'Changed'}
- assert_equal 'Changed', User.find(2).firstname
+ put :update, :id => 2, :user => {:firstname => 'Changed'}, :notification_option => 'all', :pref => {:hide_mail => '1', :comments_sorting => 'desc'}
+
+ user = User.find(2)
+ assert_equal 'Changed', user.firstname
+ assert_equal 'all', user.mail_notification
+ assert_equal true, user.pref[:hide_mail]
+ assert_equal 'desc', user.pref[:comments_sorting]
assert ActionMailer::Base.deliveries.empty?
end
- def test_edit_with_activation_should_send_a_notification
+ def test_update_with_activation_should_send_a_notification
u = User.new(:firstname => 'Foo', :lastname => 'Bar', :mail => 'foo.bar@somenet.foo', :language => 'fr')
u.login = 'foo'
u.status = User::STATUS_REGISTERED
@@ -122,7 +186,7 @@
ActionMailer::Base.deliveries.clear
Setting.bcc_recipients = '1'
- post :edit, :id => u.id, :user => {:status => User::STATUS_ACTIVE}
+ put :update, :id => u.id, :user => {:status => User::STATUS_ACTIVE}
assert u.reload.active?
mail = ActionMailer::Base.deliveries.last
assert_not_nil mail
@@ -130,12 +194,12 @@
assert mail.body.include?(ll('fr', :notice_account_activated))
end
- def test_edit_with_password_change_should_send_a_notification
+ def test_updat_with_password_change_should_send_a_notification
ActionMailer::Base.deliveries.clear
Setting.bcc_recipients = '1'
u = User.find(2)
- post :edit, :id => u.id, :user => {}, :password => 'newpass', :password_confirmation => 'newpass', :send_information => '1'
+ put :update, :id => u.id, :user => {}, :password => 'newpass', :password_confirmation => 'newpass', :send_information => '1'
assert_equal User.hash_password('newpass'), u.reload.hashed_password
mail = ActionMailer::Base.deliveries.last
@@ -144,13 +208,13 @@
assert mail.body.include?('newpass')
end
- test "POST :edit with a password change to an AuthSource user switching to Internal authentication" do
+ test "put :update with a password change to an AuthSource user switching to Internal authentication" do
# Configure as auth source
u = User.find(2)
u.auth_source = AuthSource.find(1)
u.save!
- post :edit, :id => u.id, :user => {:auth_source_id => ''}, :password => 'newpass', :password_confirmation => 'newpass'
+ put :update, :id => u.id, :user => {:auth_source_id => ''}, :password => 'newpass', :password_confirmation => 'newpass'
assert_equal nil, u.reload.auth_source
assert_equal User.hash_password('newpass'), u.reload.hashed_password
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/versions_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/versions_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/versions_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -123,6 +123,15 @@
assert_equal 'New version name', version.name
assert_equal Date.today, version.effective_date
end
+
+ def test_post_update_with_validation_failure
+ @request.session[:user_id] = 2
+ put :update, :id => 2,
+ :version => { :name => '',
+ :effective_date => Date.today.strftime("%Y-%m-%d")}
+ assert_response :success
+ assert_template 'edit'
+ end
def test_destroy
@request.session[:user_id] = 2
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/.svn/text-base/wiki_controller_test.rb.svn-base
--- a/test/functional/.svn/text-base/wiki_controller_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/.svn/text-base/wiki_controller_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -32,7 +32,7 @@
end
def test_show_start_page
- get :index, :id => 'ecookbook'
+ get :show, :project_id => 'ecookbook'
assert_response :success
assert_template 'show'
assert_tag :tag => 'h1', :content => /CookBook documentation/
@@ -45,7 +45,7 @@
end
def test_show_page_with_name
- get :index, :id => 1, :page => 'Another_page'
+ get :show, :project_id => 1, :id => 'Another_page'
assert_response :success
assert_template 'show'
assert_tag :tag => 'h1', :content => /Another page/
@@ -60,32 +60,32 @@
page.content = WikiContent.new(:text => 'Side bar content for test_show_with_sidebar')
page.save!
- get :index, :id => 1, :page => 'Another_page'
+ get :show, :project_id => 1, :id => 'Another_page'
assert_response :success
assert_tag :tag => 'div', :attributes => {:id => 'sidebar'},
:content => /Side bar content for test_show_with_sidebar/
end
def test_show_unexistent_page_without_edit_right
- get :index, :id => 1, :page => 'Unexistent page'
+ get :show, :project_id => 1, :id => 'Unexistent page'
assert_response 404
end
def test_show_unexistent_page_with_edit_right
@request.session[:user_id] = 2
- get :index, :id => 1, :page => 'Unexistent page'
+ get :show, :project_id => 1, :id => 'Unexistent page'
assert_response :success
assert_template 'edit'
end
def test_create_page
@request.session[:user_id] = 2
- post :edit, :id => 1,
- :page => 'New page',
+ put :update, :project_id => 1,
+ :id => 'New page',
:content => {:comments => 'Created the page',
:text => "h1. New page\n\nThis is a new page",
:version => 0}
- assert_redirected_to :action => 'index', :id => 'ecookbook', :page => 'New_page'
+ assert_redirected_to :action => 'show', :project_id => 'ecookbook', :id => 'New_page'
page = Project.find(1).wiki.find_page('New page')
assert !page.new_record?
assert_not_nil page.content
@@ -96,8 +96,8 @@
@request.session[:user_id] = 2
assert_difference 'WikiPage.count' do
assert_difference 'Attachment.count' do
- post :edit, :id => 1,
- :page => 'New page',
+ put :update, :project_id => 1,
+ :id => 'New page',
:content => {:comments => 'Created the page',
:text => "h1. New page\n\nThis is a new page",
:version => 0},
@@ -111,7 +111,7 @@
def test_preview
@request.session[:user_id] = 2
- xhr :post, :preview, :id => 1, :page => 'CookBook_documentation',
+ xhr :post, :preview, :project_id => 1, :id => 'CookBook_documentation',
:content => { :comments => '',
:text => 'this is a *previewed text*',
:version => 3 }
@@ -122,7 +122,7 @@
def test_preview_new_page
@request.session[:user_id] = 2
- xhr :post, :preview, :id => 1, :page => 'New page',
+ xhr :post, :preview, :project_id => 1, :id => 'New page',
:content => { :text => 'h1. New page',
:comments => '',
:version => 0 }
@@ -132,7 +132,7 @@
end
def test_history
- get :history, :id => 1, :page => 'CookBook_documentation'
+ get :history, :project_id => 1, :id => 'CookBook_documentation'
assert_response :success
assert_template 'history'
assert_not_nil assigns(:versions)
@@ -141,7 +141,7 @@
end
def test_history_with_one_version
- get :history, :id => 1, :page => 'Another_page'
+ get :history, :project_id => 1, :id => 'Another_page'
assert_response :success
assert_template 'history'
assert_not_nil assigns(:versions)
@@ -150,7 +150,7 @@
end
def test_diff
- get :diff, :id => 1, :page => 'CookBook_documentation', :version => 2, :version_from => 1
+ get :diff, :project_id => 1, :id => 'CookBook_documentation', :version => 2, :version_from => 1
assert_response :success
assert_template 'diff'
assert_tag :tag => 'span', :attributes => { :class => 'diff_in'},
@@ -158,7 +158,7 @@
end
def test_annotate
- get :annotate, :id => 1, :page => 'CookBook_documentation', :version => 2
+ get :annotate, :project_id => 1, :id => 'CookBook_documentation', :version => 2
assert_response :success
assert_template 'annotate'
# Line 1
@@ -170,13 +170,45 @@
:child => { :tag => 'td', :attributes => {:class => 'author'}, :content => /redMine Admin/ },
:child => { :tag => 'td', :content => /Some updated \[\[documentation\]\] here/ }
end
+
+ def test_get_rename
+ @request.session[:user_id] = 2
+ get :rename, :project_id => 1, :id => 'Another_page'
+ assert_response :success
+ assert_template 'rename'
+ assert_tag 'option',
+ :attributes => {:value => ''},
+ :content => '',
+ :parent => {:tag => 'select', :attributes => {:name => 'wiki_page[parent_id]'}}
+ assert_no_tag 'option',
+ :attributes => {:selected => 'selected'},
+ :parent => {:tag => 'select', :attributes => {:name => 'wiki_page[parent_id]'}}
+ end
+
+ def test_get_rename_child_page
+ @request.session[:user_id] = 2
+ get :rename, :project_id => 1, :id => 'Child_1'
+ assert_response :success
+ assert_template 'rename'
+ assert_tag 'option',
+ :attributes => {:value => ''},
+ :content => '',
+ :parent => {:tag => 'select', :attributes => {:name => 'wiki_page[parent_id]'}}
+ assert_tag 'option',
+ :attributes => {:value => '2', :selected => 'selected'},
+ :content => /Another page/,
+ :parent => {
+ :tag => 'select',
+ :attributes => {:name => 'wiki_page[parent_id]'}
+ }
+ end
def test_rename_with_redirect
@request.session[:user_id] = 2
- post :rename, :id => 1, :page => 'Another_page',
+ post :rename, :project_id => 1, :id => 'Another_page',
:wiki_page => { :title => 'Another renamed page',
:redirect_existing_links => 1 }
- assert_redirected_to :action => 'index', :id => 'ecookbook', :page => 'Another_renamed_page'
+ assert_redirected_to :action => 'show', :project_id => 'ecookbook', :id => 'Another_renamed_page'
wiki = Project.find(1).wiki
# Check redirects
assert_not_nil wiki.find_page('Another page')
@@ -185,25 +217,41 @@
def test_rename_without_redirect
@request.session[:user_id] = 2
- post :rename, :id => 1, :page => 'Another_page',
+ post :rename, :project_id => 1, :id => 'Another_page',
:wiki_page => { :title => 'Another renamed page',
:redirect_existing_links => "0" }
- assert_redirected_to :action => 'index', :id => 'ecookbook', :page => 'Another_renamed_page'
+ assert_redirected_to :action => 'show', :project_id => 'ecookbook', :id => 'Another_renamed_page'
wiki = Project.find(1).wiki
# Check that there's no redirects
assert_nil wiki.find_page('Another page')
end
+ def test_rename_with_parent_assignment
+ @request.session[:user_id] = 2
+ post :rename, :project_id => 1, :id => 'Another_page',
+ :wiki_page => { :title => 'Another page', :redirect_existing_links => "0", :parent_id => '4' }
+ assert_redirected_to :action => 'show', :project_id => 'ecookbook', :id => 'Another_page'
+ assert_equal WikiPage.find(4), WikiPage.find_by_title('Another_page').parent
+ end
+
+ def test_rename_with_parent_unassignment
+ @request.session[:user_id] = 2
+ post :rename, :project_id => 1, :id => 'Child_1',
+ :wiki_page => { :title => 'Child 1', :redirect_existing_links => "0", :parent_id => '' }
+ assert_redirected_to :action => 'show', :project_id => 'ecookbook', :id => 'Child_1'
+ assert_nil WikiPage.find_by_title('Child_1').parent
+ end
+
def test_destroy_child
@request.session[:user_id] = 2
- post :destroy, :id => 1, :page => 'Child_1'
- assert_redirected_to :action => 'special', :id => 'ecookbook', :page => 'Page_index'
+ delete :destroy, :project_id => 1, :id => 'Child_1'
+ assert_redirected_to :action => 'index', :project_id => 'ecookbook'
end
def test_destroy_parent
@request.session[:user_id] = 2
assert_no_difference('WikiPage.count') do
- post :destroy, :id => 1, :page => 'Another_page'
+ delete :destroy, :project_id => 1, :id => 'Another_page'
end
assert_response :success
assert_template 'destroy'
@@ -212,18 +260,18 @@
def test_destroy_parent_with_nullify
@request.session[:user_id] = 2
assert_difference('WikiPage.count', -1) do
- post :destroy, :id => 1, :page => 'Another_page', :todo => 'nullify'
+ delete :destroy, :project_id => 1, :id => 'Another_page', :todo => 'nullify'
end
- assert_redirected_to :action => 'special', :id => 'ecookbook', :page => 'Page_index'
+ assert_redirected_to :action => 'index', :project_id => 'ecookbook'
assert_nil WikiPage.find_by_id(2)
end
def test_destroy_parent_with_cascade
@request.session[:user_id] = 2
assert_difference('WikiPage.count', -3) do
- post :destroy, :id => 1, :page => 'Another_page', :todo => 'destroy'
+ delete :destroy, :project_id => 1, :id => 'Another_page', :todo => 'destroy'
end
- assert_redirected_to :action => 'special', :id => 'ecookbook', :page => 'Page_index'
+ assert_redirected_to :action => 'index', :project_id => 'ecookbook'
assert_nil WikiPage.find_by_id(2)
assert_nil WikiPage.find_by_id(5)
end
@@ -231,17 +279,17 @@
def test_destroy_parent_with_reassign
@request.session[:user_id] = 2
assert_difference('WikiPage.count', -1) do
- post :destroy, :id => 1, :page => 'Another_page', :todo => 'reassign', :reassign_to_id => 1
+ delete :destroy, :project_id => 1, :id => 'Another_page', :todo => 'reassign', :reassign_to_id => 1
end
- assert_redirected_to :action => 'special', :id => 'ecookbook', :page => 'Page_index'
+ assert_redirected_to :action => 'index', :project_id => 'ecookbook'
assert_nil WikiPage.find_by_id(2)
assert_equal WikiPage.find(1), WikiPage.find_by_id(5).parent
end
- def test_page_index
- get :special, :id => 'ecookbook', :page => 'Page_index'
+ def test_index
+ get :index, :project_id => 'ecookbook'
assert_response :success
- assert_template 'special_page_index'
+ assert_template 'index'
pages = assigns(:pages)
assert_not_nil pages
assert_equal Project.find(1).wiki.pages.size, pages.size
@@ -256,9 +304,49 @@
:child => { :tag => 'li', :child => { :tag => 'a', :attributes => { :href => '/projects/ecookbook/wiki/Another_page' },
:content => 'Another page' } }
end
+
+ context "GET :export" do
+ context "with an authorized user to export the wiki" do
+ setup do
+ @request.session[:user_id] = 2
+ get :export, :project_id => 'ecookbook'
+ end
+
+ should_respond_with :success
+ should_assign_to :pages
+ should_respond_with_content_type "text/html"
+ should "export all of the wiki pages to a single html file" do
+ assert_select "a[name=?]", "CookBook_documentation"
+ assert_select "a[name=?]", "Another_page"
+ assert_select "a[name=?]", "Page_with_an_inline_image"
+ end
+
+ end
+
+ context "with an unauthorized user" do
+ setup do
+ get :export, :project_id => 'ecookbook'
+
+ should_respond_with :redirect
+ should_redirect_to('wiki index') { {:action => 'show', :project_id => @project, :id => nil} }
+ end
+ end
+ end
+
+ context "GET :date_index" do
+ setup do
+ get :date_index, :project_id => 'ecookbook'
+ end
+
+ should_respond_with :success
+ should_assign_to :pages
+ should_assign_to :pages_by_date
+ should_render_template 'wiki/date_index'
+
+ end
def test_not_found
- get :index, :id => 999
+ get :show, :project_id => 999
assert_response 404
end
@@ -266,8 +354,8 @@
page = WikiPage.find_by_wiki_id_and_title(1, 'Another_page')
assert !page.protected?
@request.session[:user_id] = 2
- post :protect, :id => 1, :page => page.title, :protected => '1'
- assert_redirected_to :action => 'index', :id => 'ecookbook', :page => 'Another_page'
+ post :protect, :project_id => 1, :id => page.title, :protected => '1'
+ assert_redirected_to :action => 'show', :project_id => 'ecookbook', :id => 'Another_page'
assert page.reload.protected?
end
@@ -275,14 +363,14 @@
page = WikiPage.find_by_wiki_id_and_title(1, 'CookBook_documentation')
assert page.protected?
@request.session[:user_id] = 2
- post :protect, :id => 1, :page => page.title, :protected => '0'
- assert_redirected_to :action => 'index', :id => 'ecookbook', :page => 'CookBook_documentation'
+ post :protect, :project_id => 1, :id => page.title, :protected => '0'
+ assert_redirected_to :action => 'show', :project_id => 'ecookbook', :id => 'CookBook_documentation'
assert !page.reload.protected?
end
def test_show_page_with_edit_link
@request.session[:user_id] = 2
- get :index, :id => 1
+ get :show, :project_id => 1
assert_response :success
assert_template 'show'
assert_tag :tag => 'a', :attributes => { :href => '/projects/1/wiki/CookBook_documentation/edit' }
@@ -290,7 +378,7 @@
def test_show_page_without_edit_link
@request.session[:user_id] = 4
- get :index, :id => 1
+ get :show, :project_id => 1
assert_response :success
assert_template 'show'
assert_no_tag :tag => 'a', :attributes => { :href => '/projects/1/wiki/CookBook_documentation/edit' }
@@ -299,7 +387,7 @@
def test_edit_unprotected_page
# Non members can edit unprotected wiki pages
@request.session[:user_id] = 4
- get :edit, :id => 1, :page => 'Another_page'
+ get :edit, :project_id => 1, :id => 'Another_page'
assert_response :success
assert_template 'edit'
end
@@ -307,19 +395,19 @@
def test_edit_protected_page_by_nonmember
# Non members can't edit protected wiki pages
@request.session[:user_id] = 4
- get :edit, :id => 1, :page => 'CookBook_documentation'
+ get :edit, :project_id => 1, :id => 'CookBook_documentation'
assert_response 403
end
def test_edit_protected_page_by_member
@request.session[:user_id] = 2
- get :edit, :id => 1, :page => 'CookBook_documentation'
+ get :edit, :project_id => 1, :id => 'CookBook_documentation'
assert_response :success
assert_template 'edit'
end
def test_history_of_non_existing_page_should_return_404
- get :history, :id => 1, :page => 'Unknown_page'
+ get :history, :project_id => 1, :id => 'Unknown_page'
assert_response 404
end
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/account_controller_test.rb
--- a/test/functional/account_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/account_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -64,7 +64,7 @@
assert existing_user.save!
post :login, :openid_url => existing_user.identity_url
- assert_redirected_to 'my/page'
+ assert_redirected_to '/my/page'
end
def test_login_with_invalid_openid_provider
@@ -86,14 +86,14 @@
assert existing_user.save!
post :login, :openid_url => existing_user.identity_url
- assert_redirected_to 'login'
+ assert_redirected_to '/login'
end
def test_login_with_openid_with_new_user_created
Setting.self_registration = '3'
Setting.openid = '1'
post :login, :openid_url => 'http://openid.example.com/good_user'
- assert_redirected_to 'my/account'
+ assert_redirected_to '/my/account'
user = User.find_by_login('cool_user')
assert user
assert_equal 'Cool', user.firstname
@@ -113,7 +113,7 @@
Setting.self_registration = '1'
Setting.openid = '1'
post :login, :openid_url => 'http://openid.example.com/good_user'
- assert_redirected_to 'login'
+ assert_redirected_to '/login'
user = User.find_by_login('cool_user')
assert user
@@ -125,7 +125,7 @@
Setting.self_registration = '2'
Setting.openid = '1'
post :login, :openid_url => 'http://openid.example.com/good_user'
- assert_redirected_to 'login'
+ assert_redirected_to '/login'
user = User.find_by_login('cool_user')
assert user
assert_equal User::STATUS_REGISTERED, user.status
@@ -157,7 +157,7 @@
def test_logout
@request.session[:user_id] = 2
get :logout
- assert_redirected_to ''
+ assert_redirected_to '/'
assert_nil @request.session[:user_id]
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/attachments_controller_test.rb
--- a/test/functional/attachments_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/attachments_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -95,7 +95,7 @@
post :destroy, :id => 1
end
# no referrer
- assert_redirected_to 'projects/ecookbook'
+ assert_redirected_to '/projects/ecookbook'
assert_nil Attachment.find_by_id(1)
j = issue.journals.find(:first, :order => 'created_on DESC')
assert_equal 'attachment', j.details.first.property
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/calendars_controller_test.rb
--- a/test/functional/calendars_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/calendars_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -16,6 +16,16 @@
assert_template 'calendar'
assert_not_nil assigns(:calendar)
end
+
+ context "GET :show" do
+ should "run custom queries" do
+ @query = Query.generate_default!
+
+ get :show, :query_id => @query.id
+ assert_response :success
+ end
+
+ end
def test_week_number_calculation
Setting.start_of_week = 7
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/comments_controller_test.rb
--- a/test/functional/comments_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/comments_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -27,7 +27,7 @@
def test_add_comment
@request.session[:user_id] = 2
post :create, :id => 1, :comment => { :comments => 'This is a test comment' }
- assert_redirected_to 'news/1'
+ assert_redirected_to '/news/1'
comment = News.find(1).comments.find(:first, :order => 'created_on DESC')
assert_not_nil comment
@@ -40,7 +40,7 @@
assert_no_difference 'Comment.count' do
post :create, :id => 1, :comment => { :comments => '' }
assert_response :redirect
- assert_redirected_to 'news/1'
+ assert_redirected_to '/news/1'
end
end
@@ -48,7 +48,7 @@
comments_count = News.find(1).comments.size
@request.session[:user_id] = 2
delete :destroy, :id => 1, :comment_id => 2
- assert_redirected_to 'news/1'
+ assert_redirected_to '/news/1'
assert_nil Comment.find_by_id(2)
assert_equal comments_count - 1, News.find(1).comments.size
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/context_menus_controller_test.rb
--- a/test/functional/context_menus_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/context_menus_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -79,14 +79,27 @@
:class => 'icon-del' }
end
- def test_context_menu_multiple_issues_of_different_project
+ def test_context_menu_multiple_issues_of_different_projects
@request.session[:user_id] = 2
- get :issues, :ids => [1, 2, 4]
+ get :issues, :ids => [1, 2, 6]
assert_response :success
assert_template 'context_menu'
+ ids = "ids%5B%5D=1&ids%5B%5D=2&ids%5B%5D=6"
+ assert_tag :tag => 'a', :content => 'Edit',
+ :attributes => { :href => "/issues/bulk_edit?#{ids}",
+ :class => 'icon-edit' }
+ assert_tag :tag => 'a', :content => 'Closed',
+ :attributes => { :href => "/issues/bulk_edit?#{ids}&issue%5Bstatus_id%5D=5",
+ :class => '' }
+ assert_tag :tag => 'a', :content => 'Immediate',
+ :attributes => { :href => "/issues/bulk_edit?#{ids}&issue%5Bpriority_id%5D=8",
+ :class => '' }
+ assert_tag :tag => 'a', :content => 'John Smith',
+ :attributes => { :href => "/issues/bulk_edit?#{ids}&issue%5Bassigned_to_id%5D=2",
+ :class => '' }
assert_tag :tag => 'a', :content => 'Delete',
- :attributes => { :href => '#',
- :class => 'icon-del disabled' }
+ :attributes => { :href => "/issues/destroy?#{ids}",
+ :class => 'icon-del' }
end
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/documents_controller_test.rb
--- a/test/functional/documents_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/documents_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -77,7 +77,7 @@
:category_id => 2},
:attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}}
- assert_redirected_to 'projects/ecookbook/documents'
+ assert_redirected_to '/projects/ecookbook/documents'
document = Document.find_by_title('DocumentsControllerTest#test_post_new')
assert_not_nil document
@@ -90,7 +90,7 @@
def test_destroy
@request.session[:user_id] = 2
post :destroy, :id => 1
- assert_redirected_to 'projects/ecookbook/documents'
+ assert_redirected_to '/projects/ecookbook/documents'
assert_nil Document.find_by_id(1)
end
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/files_controller_test.rb
--- a/test/functional/files_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/files_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -37,7 +37,7 @@
:attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}}
assert_response :redirect
end
- assert_redirected_to 'projects/ecookbook/files'
+ assert_redirected_to '/projects/ecookbook/files'
a = Attachment.find(:first, :order => 'created_on DESC')
assert_equal 'testfile.txt', a.filename
assert_equal Project.find(1), a.container
@@ -58,7 +58,7 @@
:attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain')}}
assert_response :redirect
end
- assert_redirected_to 'projects/ecookbook/files'
+ assert_redirected_to '/projects/ecookbook/files'
a = Attachment.find(:first, :order => 'created_on DESC')
assert_equal 'testfile.txt', a.filename
assert_equal Version.find(2), a.container
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/gantts_controller_test.rb
--- a/test/functional/gantts_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/gantts_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -20,6 +20,25 @@
i = Issue.find(2)
assert_select "div a.issue", /##{i.id}/
end
+
+ should "work without issue due dates" do
+ Issue.update_all("due_date = NULL")
+
+ get :show, :project_id => 1
+ assert_response :success
+ assert_template 'show.html.erb'
+ assert_not_nil assigns(:gantt)
+ end
+
+ should "work without issue and version due dates" do
+ Issue.update_all("due_date = NULL")
+ Version.update_all("effective_date = NULL")
+
+ get :show, :project_id => 1
+ assert_response :success
+ assert_template 'show.html.erb'
+ assert_not_nil assigns(:gantt)
+ end
should "work cross project" do
get :show
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/groups_controller_test.rb
--- a/test/functional/groups_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/groups_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -54,7 +54,7 @@
assert_difference 'Group.count' do
post :create, :group => {:lastname => 'New group'}
end
- assert_redirected_to 'groups'
+ assert_redirected_to '/groups'
end
def test_edit
@@ -65,14 +65,14 @@
def test_update
post :update, :id => 10
- assert_redirected_to 'groups'
+ assert_redirected_to '/groups'
end
def test_destroy
assert_difference 'Group.count', -1 do
post :destroy, :id => 10
end
- assert_redirected_to 'groups'
+ assert_redirected_to '/groups'
end
def test_add_users
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/issue_moves_controller_test.rb
--- a/test/functional/issue_moves_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/issue_moves_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -40,6 +40,31 @@
assert_equal 2, Issue.find(2).tracker_id
end
+ context "#create via bulk move" do
+ setup do
+ @request.session[:user_id] = 2
+ end
+
+ should "allow changing the issue priority" do
+ post :create, :ids => [1, 2], :priority_id => 6
+
+ assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook'
+ assert_equal 6, Issue.find(1).priority_id
+ assert_equal 6, Issue.find(2).priority_id
+
+ end
+
+ should "allow adding a note when moving" do
+ post :create, :ids => [1, 2], :notes => 'Moving two issues'
+
+ assert_redirected_to :controller => 'issues', :action => 'index', :project_id => 'ecookbook'
+ assert_equal 'Moving two issues', Issue.find(1).journals.last.notes
+ assert_equal 'Moving two issues', Issue.find(2).journals.last.notes
+
+ end
+
+ end
+
def test_bulk_copy_to_another_project
@request.session[:user_id] = 2
assert_difference 'Issue.count', 2 do
@@ -47,7 +72,7 @@
post :create, :ids => [1, 2], :new_project_id => 2, :copy_options => {:copy => '1'}
end
end
- assert_redirected_to 'projects/ecookbook/issues'
+ assert_redirected_to '/projects/ecookbook/issues'
end
context "#create via bulk copy" do
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/issues_controller_test.rb
--- a/test/functional/issues_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/issues_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -125,11 +125,42 @@
assert_tag :tag => 'a', :content => /Issue of a private subproject/
end
- def test_index_with_project_and_filter
+ def test_index_with_project_and_default_filter
get :index, :project_id => 1, :set_filter => 1
assert_response :success
assert_template 'index.rhtml'
assert_not_nil assigns(:issues)
+
+ query = assigns(:query)
+ assert_not_nil query
+ # default filter
+ assert_equal({'status_id' => {:operator => 'o', :values => ['']}}, query.filters)
+ end
+
+ def test_index_with_project_and_filter
+ get :index, :project_id => 1, :set_filter => 1,
+ :fields => ['tracker_id'],
+ :operators => {'tracker_id' => '='},
+ :values => {'tracker_id' => ['1']}
+ assert_response :success
+ assert_template 'index.rhtml'
+ assert_not_nil assigns(:issues)
+
+ query = assigns(:query)
+ assert_not_nil query
+ assert_equal({'tracker_id' => {:operator => '=', :values => ['1']}}, query.filters)
+ end
+
+ def test_index_with_project_and_empty_filters
+ get :index, :project_id => 1, :set_filter => 1, :fields => ['']
+ assert_response :success
+ assert_template 'index.rhtml'
+ assert_not_nil assigns(:issues)
+
+ query = assigns(:query)
+ assert_not_nil query
+ # no filter
+ assert_equal({}, query.filters)
end
def test_index_with_query
@@ -340,9 +371,7 @@
get :new, :project_id => 1
assert_response 500
- assert_not_nil flash[:error]
- assert_tag :tag => 'div', :attributes => { :class => /error/ },
- :content => /No default issue/
+ assert_error_tag :content => /No default issue/
end
def test_get_new_with_no_tracker_should_display_an_error
@@ -351,9 +380,7 @@
get :new, :project_id => 1
assert_response 500
- assert_not_nil flash[:error]
- assert_tag :tag => 'div', :attributes => { :class => /error/ },
- :content => /No tracker/
+ assert_error_tag :content => /No tracker/
end
def test_update_new_form
@@ -382,6 +409,7 @@
:subject => 'This is the test_new issue',
:description => 'This is the description',
:priority_id => 5,
+ :start_date => '2010-11-07',
:estimated_hours => '',
:custom_field_values => {'2' => 'Value for field 2'}}
end
@@ -392,12 +420,33 @@
assert_equal 2, issue.author_id
assert_equal 3, issue.tracker_id
assert_equal 2, issue.status_id
+ assert_equal Date.parse('2010-11-07'), issue.start_date
assert_nil issue.estimated_hours
v = issue.custom_values.find(:first, :conditions => {:custom_field_id => 2})
assert_not_nil v
assert_equal 'Value for field 2', v.value
end
+ def test_post_create_without_start_date
+ @request.session[:user_id] = 2
+ assert_difference 'Issue.count' do
+ post :create, :project_id => 1,
+ :issue => {:tracker_id => 3,
+ :status_id => 2,
+ :subject => 'This is the test_new issue',
+ :description => 'This is the description',
+ :priority_id => 5,
+ :start_date => '',
+ :estimated_hours => '',
+ :custom_field_values => {'2' => 'Value for field 2'}}
+ end
+ assert_redirected_to :controller => 'issues', :action => 'show', :id => Issue.last.id
+
+ issue = Issue.find_by_subject('This is the test_new issue')
+ assert_not_nil issue
+ assert_nil issue.start_date
+ end
+
def test_post_create_and_continue
@request.session[:user_id] = 2
post :create, :project_id => 1,
@@ -531,7 +580,7 @@
context "without workflow privilege" do
setup do
Workflow.delete_all(["role_id = ?", Role.anonymous.id])
- Role.anonymous.add_permission! :add_issues
+ Role.anonymous.add_permission! :add_issues, :add_issue_notes
end
context "#new" do
@@ -556,6 +605,17 @@
assert_equal IssueStatus.default, issue.status
end
+ should "accept default status" do
+ assert_difference 'Issue.count' do
+ post :create, :project_id => 1,
+ :issue => {:tracker_id => 1,
+ :subject => 'This is an issue',
+ :status_id => 1}
+ end
+ issue = Issue.last(:order => 'id')
+ assert_equal IssueStatus.default, issue.status
+ end
+
should "ignore unauthorized status" do
assert_difference 'Issue.count' do
post :create, :project_id => 1,
@@ -567,6 +627,94 @@
assert_equal IssueStatus.default, issue.status
end
end
+
+ context "#update" do
+ should "ignore status change" do
+ assert_difference 'Journal.count' do
+ put :update, :id => 1, :notes => 'just trying', :issue => {:status_id => 3}
+ end
+ assert_equal 1, Issue.find(1).status_id
+ end
+
+ should "ignore attributes changes" do
+ assert_difference 'Journal.count' do
+ put :update, :id => 1, :notes => 'just trying', :issue => {:subject => 'changed', :assigned_to_id => 2}
+ end
+ issue = Issue.find(1)
+ assert_equal "Can't print recipes", issue.subject
+ assert_nil issue.assigned_to
+ end
+ end
+ end
+
+ context "with workflow privilege" do
+ setup do
+ Workflow.delete_all(["role_id = ?", Role.anonymous.id])
+ Workflow.create!(:role => Role.anonymous, :tracker_id => 1, :old_status_id => 1, :new_status_id => 3)
+ Workflow.create!(:role => Role.anonymous, :tracker_id => 1, :old_status_id => 1, :new_status_id => 4)
+ Role.anonymous.add_permission! :add_issues, :add_issue_notes
+ end
+
+ context "#update" do
+ should "accept authorized status" do
+ assert_difference 'Journal.count' do
+ put :update, :id => 1, :notes => 'just trying', :issue => {:status_id => 3}
+ end
+ assert_equal 3, Issue.find(1).status_id
+ end
+
+ should "ignore unauthorized status" do
+ assert_difference 'Journal.count' do
+ put :update, :id => 1, :notes => 'just trying', :issue => {:status_id => 2}
+ end
+ assert_equal 1, Issue.find(1).status_id
+ end
+
+ should "accept authorized attributes changes" do
+ assert_difference 'Journal.count' do
+ put :update, :id => 1, :notes => 'just trying', :issue => {:assigned_to_id => 2}
+ end
+ issue = Issue.find(1)
+ assert_equal 2, issue.assigned_to_id
+ end
+
+ should "ignore unauthorized attributes changes" do
+ assert_difference 'Journal.count' do
+ put :update, :id => 1, :notes => 'just trying', :issue => {:subject => 'changed'}
+ end
+ issue = Issue.find(1)
+ assert_equal "Can't print recipes", issue.subject
+ end
+ end
+
+ context "and :edit_issues permission" do
+ setup do
+ Role.anonymous.add_permission! :add_issues, :edit_issues
+ end
+
+ should "accept authorized status" do
+ assert_difference 'Journal.count' do
+ put :update, :id => 1, :notes => 'just trying', :issue => {:status_id => 3}
+ end
+ assert_equal 3, Issue.find(1).status_id
+ end
+
+ should "ignore unauthorized status" do
+ assert_difference 'Journal.count' do
+ put :update, :id => 1, :notes => 'just trying', :issue => {:status_id => 2}
+ end
+ assert_equal 1, Issue.find(1).status_id
+ end
+
+ should "accept authorized attributes changes" do
+ assert_difference 'Journal.count' do
+ put :update, :id => 1, :notes => 'just trying', :issue => {:subject => 'changed', :assigned_to_id => 2}
+ end
+ issue = Issue.find(1)
+ assert_equal "changed", issue.subject
+ assert_equal 2, issue.assigned_to_id
+ end
+ end
end
def test_copy_issue
@@ -589,7 +737,8 @@
def test_get_edit_with_params
@request.session[:user_id] = 2
- get :edit, :id => 1, :issue => { :status_id => 5, :priority_id => 7 }
+ get :edit, :id => 1, :issue => { :status_id => 5, :priority_id => 7 },
+ :time_entry => { :hours => '2.5', :comments => 'test_get_edit_with_params', :activity_id => TimeEntryActivity.first.id }
assert_response :success
assert_template 'edit'
@@ -607,6 +756,12 @@
:child => { :tag => 'option',
:content => 'Urgent',
:attributes => { :selected => 'selected' } }
+
+ assert_tag :input, :attributes => { :name => 'time_entry[hours]', :value => '2.5' }
+ assert_tag :select, :attributes => { :name => 'time_entry[activity_id]' },
+ :child => { :tag => 'option',
+ :attributes => { :selected => 'selected', :value => TimeEntryActivity.first.id } }
+ assert_tag :input, :attributes => { :name => 'time_entry[comments]', :value => 'test_get_edit_with_params' }
end
def test_update_edit_form
@@ -911,6 +1066,19 @@
assert_tag :select, :attributes => {:name => 'issue[custom_field_values][1]'}
end
+ def test_get_bulk_edit_on_different_projects
+ @request.session[:user_id] = 2
+ get :bulk_edit, :ids => [1, 2, 6]
+ assert_response :success
+ assert_template 'bulk_edit'
+
+ # Project specific custom field, date type
+ field = CustomField.find(9)
+ assert !field.is_for_all?
+ assert !field.project_ids.include?(Issue.find(6).project_id)
+ assert_no_tag :input, :attributes => {:name => 'issue[custom_field_values][9]'}
+ end
+
def test_bulk_update
@request.session[:user_id] = 2
# update issues priority
@@ -930,6 +1098,39 @@
assert_equal 1, journal.details.size
end
+ def test_bulk_update_on_different_projects
+ @request.session[:user_id] = 2
+ # update issues priority
+ post :bulk_update, :ids => [1, 2, 6], :notes => 'Bulk editing',
+ :issue => {:priority_id => 7,
+ :assigned_to_id => '',
+ :custom_field_values => {'2' => ''}}
+
+ assert_response 302
+ # check that the issues were updated
+ assert_equal [7, 7, 7], Issue.find([1,2,6]).map(&:priority_id)
+
+ issue = Issue.find(1)
+ journal = issue.journals.find(:first, :order => 'created_on DESC')
+ assert_equal '125', issue.custom_value_for(2).value
+ assert_equal 'Bulk editing', journal.notes
+ assert_equal 1, journal.details.size
+ end
+
+ def test_bulk_update_on_different_projects_without_rights
+ @request.session[:user_id] = 3
+ user = User.find(3)
+ action = { :controller => "issues", :action => "bulk_update" }
+ assert user.allowed_to?(action, Issue.find(1).project)
+ assert ! user.allowed_to?(action, Issue.find(6).project)
+ post :bulk_update, :ids => [1, 6], :notes => 'Bulk should fail',
+ :issue => {:priority_id => 7,
+ :assigned_to_id => '',
+ :custom_field_values => {'2' => ''}}
+ assert_response 403
+ assert_not_equal "Bulk should fail", Journal.last.notes
+ end
+
def test_bullk_update_should_send_a_notification
@request.session[:user_id] = 2
ActionMailer::Base.deliveries.clear
@@ -1061,6 +1262,13 @@
assert_equal 2, TimeEntry.find(2).issue_id
end
+ def test_destroy_issues_from_different_projects
+ @request.session[:user_id] = 2
+ post :destroy, :ids => [1, 2, 6], :todo => 'destroy'
+ assert_redirected_to :controller => 'issues', :action => 'index'
+ assert !(Issue.find_by_id(1) || Issue.find_by_id(2) || Issue.find_by_id(6))
+ end
+
def test_default_search_scope
get :index
assert_tag :div, :attributes => {:id => 'quick-search'},
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/messages_controller_test.rb
--- a/test/functional/messages_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/messages_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -87,7 +87,7 @@
:content => 'Message body'}
message = Message.find_by_subject('Test created message')
assert_not_nil message
- assert_redirected_to "boards/1/topics/#{message.to_param}"
+ assert_redirected_to "/boards/1/topics/#{message.to_param}"
assert_equal 'Message body', message.content
assert_equal 2, message.author_id
assert_equal 1, message.board_id
@@ -114,7 +114,7 @@
post :edit, :board_id => 1, :id => 1,
:message => { :subject => 'New subject',
:content => 'New body'}
- assert_redirected_to 'boards/1/topics/1'
+ assert_redirected_to '/boards/1/topics/1'
message = Message.find(1)
assert_equal 'New subject', message.subject
assert_equal 'New body', message.content
@@ -124,14 +124,14 @@
@request.session[:user_id] = 2
post :reply, :board_id => 1, :id => 1, :reply => { :content => 'This is a test reply', :subject => 'Test reply' }
reply = Message.find(:first, :order => 'id DESC')
- assert_redirected_to "boards/1/topics/1?r=#{reply.id}"
+ assert_redirected_to "/boards/1/topics/1?r=#{reply.id}"
assert Message.find_by_subject('Test reply')
end
def test_destroy_topic
@request.session[:user_id] = 2
post :destroy, :board_id => 1, :id => 1
- assert_redirected_to 'projects/ecookbook/boards/1'
+ assert_redirected_to '/projects/ecookbook/boards/1'
assert_nil Message.find_by_id(1)
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/my_controller_test.rb
--- a/test/functional/my_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/my_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -68,7 +68,7 @@
:login => "root",
:admin => 1,
:custom_field_values => {"4" => "0100562500"}}
- assert_redirected_to 'my/account'
+ assert_redirected_to '/my/account'
user = User.find(2)
assert_equal user, assigns(:user)
assert_equal "Joe", user.firstname
@@ -102,7 +102,7 @@
post :password, :password => 'jsmith',
:new_password => 'hello',
:new_password_confirmation => 'hello'
- assert_redirected_to 'my/account'
+ assert_redirected_to '/my/account'
assert User.try_to_login('jsmith', 'hello')
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/news_controller_test.rb
--- a/test/functional/news_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/news_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -73,7 +73,7 @@
post :create, :project_id => 1, :news => { :title => 'NewsControllerTest',
:description => 'This is the description',
:summary => '' }
- assert_redirected_to 'projects/ecookbook/news'
+ assert_redirected_to '/projects/ecookbook/news'
news = News.find_by_title('NewsControllerTest')
assert_not_nil news
@@ -93,7 +93,7 @@
def test_put_update
@request.session[:user_id] = 2
put :update, :id => 1, :news => { :description => 'Description changed by test_post_edit' }
- assert_redirected_to 'news/1'
+ assert_redirected_to '/news/1'
news = News.find(1)
assert_equal 'Description changed by test_post_edit', news.description
end
@@ -113,19 +113,8 @@
def test_destroy
@request.session[:user_id] = 2
- post :destroy, :id => 1
- assert_redirected_to 'projects/ecookbook/news'
+ delete :destroy, :id => 1
+ assert_redirected_to '/projects/ecookbook/news'
assert_nil News.find_by_id(1)
end
-
- def test_preview
- get :preview, :project_id => 1,
- :news => {:title => '',
- :description => 'News description',
- :summary => ''}
- assert_response :success
- assert_template 'common/_preview'
- assert_tag :tag => 'fieldset', :attributes => { :class => 'preview' },
- :content => /News description/
- end
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/previews_controller_test.rb
--- a/test/functional/previews_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/previews_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -19,4 +19,14 @@
assert_not_nil assigns(:notes)
end
+ def test_news
+ get :news, :project_id => 1,
+ :news => {:title => '',
+ :description => 'News description',
+ :summary => ''}
+ assert_response :success
+ assert_template 'common/_preview'
+ assert_tag :tag => 'fieldset', :attributes => { :class => 'preview' },
+ :content => /News description/
+ end
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/project_enumerations_controller_test.rb
--- a/test/functional/project_enumerations_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/project_enumerations_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -20,7 +20,7 @@
}
assert_response :redirect
- assert_redirected_to 'projects/ecookbook/settings/activities'
+ assert_redirected_to '/projects/ecookbook/settings/activities'
# Created project specific activities...
project = Project.find('ecookbook')
@@ -83,7 +83,7 @@
}
assert_response :redirect
- assert_redirected_to 'projects/ecookbook/settings/activities'
+ assert_redirected_to '/projects/ecookbook/settings/activities'
# Created project specific activities...
project = Project.find('ecookbook')
@@ -159,7 +159,7 @@
delete :destroy, :project_id => 1
assert_response :redirect
- assert_redirected_to 'projects/ecookbook/settings/activities'
+ assert_redirected_to '/projects/ecookbook/settings/activities'
assert_nil TimeEntryActivity.find_by_id(project_activity.id)
assert_nil TimeEntryActivity.find_by_id(project_activity_two.id)
@@ -179,7 +179,7 @@
delete :destroy, :project_id => 1
assert_response :redirect
- assert_redirected_to 'projects/ecookbook/settings/activities'
+ assert_redirected_to '/projects/ecookbook/settings/activities'
assert_nil TimeEntryActivity.find_by_id(project_activity.id)
assert_equal 0, TimeEntry.find_all_by_activity_id_and_project_id(project_activity.id, 1).size, "TimeEntries still assigned to project specific activity"
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/projects_controller_test.rb
--- a/test/functional/projects_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/projects_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -284,6 +284,18 @@
assert_template 'show'
assert_not_nil assigns(:project)
assert_equal Project.find_by_identifier('ecookbook'), assigns(:project)
+
+ assert_tag 'li', :content => /Development status/
+ end
+
+ def test_show_should_not_display_hidden_custom_fields
+ ProjectCustomField.find_by_name('Development status').update_attribute :visible, false
+ get :show, :id => 'ecookbook'
+ assert_response :success
+ assert_template 'show'
+ assert_not_nil assigns(:project)
+
+ assert_no_tag 'li', :content => /Development status/
end
def test_show_should_not_fail_when_custom_values_are_nil
@@ -296,6 +308,16 @@
assert_equal Project.find_by_identifier('ecookbook'), assigns(:project)
end
+ def show_archived_project_should_be_denied
+ project = Project.find_by_identifier('ecookbook')
+ project.archive!
+
+ get :show, :id => 'ecookbook'
+ assert_response 403
+ assert_nil assigns(:project)
+ assert_tag :tag => 'p', :content => /archived/
+ end
+
def test_private_subprojects_hidden
get :show, :id => 'ecookbook'
assert_response :success
@@ -322,7 +344,7 @@
@request.session[:user_id] = 2 # manager
post :update, :id => 1, :project => {:name => 'Test changed name',
:issue_custom_field_ids => ['']}
- assert_redirected_to 'projects/ecookbook/settings'
+ assert_redirected_to '/projects/ecookbook/settings'
project = Project.find(1)
assert_equal 'Test changed name', project.name
end
@@ -338,14 +360,14 @@
def test_post_destroy
@request.session[:user_id] = 1 # admin
post :destroy, :id => 1, :confirm => 1
- assert_redirected_to 'admin/projects'
+ assert_redirected_to '/admin/projects'
assert_nil Project.find_by_id(1)
end
def test_archive
@request.session[:user_id] = 1 # admin
post :archive, :id => 1
- assert_redirected_to 'admin/projects'
+ assert_redirected_to '/admin/projects'
assert !Project.find(1).active?
end
@@ -353,7 +375,7 @@
@request.session[:user_id] = 1 # admin
Project.find(1).archive
post :unarchive, :id => 1
- assert_redirected_to 'admin/projects'
+ assert_redirected_to '/admin/projects'
assert Project.find(1).active?
end
@@ -389,9 +411,20 @@
assert_redirected_to :controller => 'admin', :action => 'projects'
end
+ context "POST :copy" do
+ should "TODO: test the rest of the method"
+
+ should "redirect to the project settings when successful" do
+ @request.session[:user_id] = 1 # admin
+ post :copy, :id => 1, :project => {:name => 'Copy', :identifier => 'unique-copy'}
+ assert_response :redirect
+ assert_redirected_to :controller => 'projects', :action => 'settings'
+ end
+ end
+
def test_jump_should_redirect_to_active_tab
get :show, :id => 1, :jump => 'issues'
- assert_redirected_to 'projects/ecookbook/issues'
+ assert_redirected_to '/projects/ecookbook/issues'
end
def test_jump_should_not_redirect_to_inactive_tab
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/repositories_controller_test.rb
--- a/test/functional/repositories_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/repositories_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -98,7 +98,7 @@
assert_no_difference "Changeset.count(:conditions => 'user_id = 3')" do
post :committers, :id => 1, :committers => { '0' => ['foo', '2'], '1' => ['dlopper', '3']}
- assert_redirected_to 'projects/ecookbook/repository/committers'
+ assert_redirected_to '/projects/ecookbook/repository/committers'
assert_equal User.find(2), c.reload.user
end
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/repositories_cvs_controller_test.rb
--- a/test/functional/repositories_cvs_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/repositories_cvs_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -106,7 +106,7 @@
def test_entry_not_found
get :entry, :id => 1, :path => ['sources', 'zzz.c']
- assert_tag :tag => 'div', :attributes => { :class => /error/ },
+ assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
:content => /The entry or revision was not found in the repository/
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/repositories_git_controller_test.rb
--- a/test/functional/repositories_git_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/repositories_git_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -50,7 +50,7 @@
assert_response :success
assert_template 'show'
assert_not_nil assigns(:entries)
- assert_equal 7, assigns(:entries).size
+ assert_equal 9, assigns(:entries).size
assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'}
assert assigns(:entries).detect {|e| e.name == 'this_is_a_really_long_and_verbose_directory_name' && e.kind == 'dir'}
assert assigns(:entries).detect {|e| e.name == 'sources' && e.kind == 'dir'}
@@ -58,6 +58,8 @@
assert assigns(:entries).detect {|e| e.name == 'copied_README' && e.kind == 'file'}
assert assigns(:entries).detect {|e| e.name == 'new_file.txt' && e.kind == 'file'}
assert assigns(:entries).detect {|e| e.name == 'renamed_test.txt' && e.kind == 'file'}
+ assert assigns(:entries).detect {|e| e.name == 'filemane with spaces.txt' && e.kind == 'file'}
+ assert assigns(:entries).detect {|e| e.name == ' filename with a leading space.txt ' && e.kind == 'file'}
end
def test_browse_branch
@@ -152,7 +154,7 @@
def test_annotate_binary_file
get :annotate, :id => 3, :path => ['images', 'edit.png']
assert_response 500
- assert_tag :tag => 'div', :attributes => { :class => /error/ },
+ assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
:content => /can not be annotated/
end
else
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/repositories_subversion_controller_test.rb
--- a/test/functional/repositories_subversion_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/repositories_subversion_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -129,7 +129,7 @@
def test_entry_not_found
get :entry, :id => 1, :path => ['subversion_test', 'zzz.c']
- assert_tag :tag => 'div', :attributes => { :class => /error/ },
+ assert_tag :tag => 'p', :attributes => { :id => /errorExplanation/ },
:content => /The entry or revision was not found in the repository/
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/roles_controller_test.rb
--- a/test/functional/roles_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/roles_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -65,7 +65,7 @@
:permissions => ['add_issues', 'edit_issues', 'log_time', ''],
:assignable => '0'}
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
role = Role.find_by_name('RoleWithoutWorkflowCopy')
assert_not_nil role
assert_equal [:add_issues, :edit_issues, :log_time], role.permissions
@@ -78,7 +78,7 @@
:assignable => '0'},
:copy_workflow_from => '1'
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
role = Role.find_by_name('RoleWithWorkflowCopy')
assert_not_nil role
assert_equal Role.find(1).workflows.size, role.workflows.size
@@ -97,7 +97,7 @@
:permissions => ['edit_project', ''],
:assignable => '0'}
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
role = Role.find(1)
assert_equal [:edit_project], role.permissions
end
@@ -107,13 +107,13 @@
assert r.save
post :destroy, :id => r
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
assert_nil Role.find_by_id(r.id)
end
def test_destroy_role_in_use
post :destroy, :id => 1
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
assert flash[:error] == 'This role is in use and can not be deleted.'
assert_not_nil Role.find_by_id(1)
end
@@ -139,7 +139,7 @@
def test_post_report
post :report, :permissions => { '0' => '', '1' => ['edit_issues'], '3' => ['add_issues', 'delete_issues']}
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
assert_equal [:edit_issues], Role.find(1).permissions
assert_equal [:add_issues, :delete_issues], Role.find(3).permissions
@@ -148,33 +148,33 @@
def test_clear_all_permissions
post :report, :permissions => { '0' => '' }
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
assert Role.find(1).permissions.empty?
end
def test_move_highest
post :edit, :id => 3, :role => {:move_to => 'highest'}
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
assert_equal 1, Role.find(3).position
end
def test_move_higher
position = Role.find(3).position
post :edit, :id => 3, :role => {:move_to => 'higher'}
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
assert_equal position - 1, Role.find(3).position
end
def test_move_lower
position = Role.find(2).position
post :edit, :id => 2, :role => {:move_to => 'lower'}
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
assert_equal position + 1, Role.find(2).position
end
def test_move_lowest
post :edit, :id => 2, :role => {:move_to => 'lowest'}
- assert_redirected_to 'roles'
+ assert_redirected_to '/roles'
assert_equal Role.count, Role.find(2).position
end
end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/search_controller_test.rb
--- a/test/functional/search_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/search_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -126,7 +126,7 @@
def test_quick_jump_to_issue
# issue of a public project
get :index, :q => "3"
- assert_redirected_to 'issues/3'
+ assert_redirected_to '/issues/3'
# issue of a private project
get :index, :q => "4"
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/settings_controller_test.rb
--- a/test/functional/settings_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/settings_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -50,7 +50,7 @@
:notified_events => %w(issue_added issue_updated news_added),
:emails_footer => 'Test footer'
}
- assert_redirected_to 'settings/edit'
+ assert_redirected_to '/settings/edit'
assert_equal 'functional@test.foo', Setting.mail_from
assert !Setting.bcc_recipients?
assert_equal %w(issue_added issue_updated news_added), Setting.notified_events
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/time_entry_reports_controller_test.rb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/functional/time_entry_reports_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,134 @@
+# -*- coding: utf-8 -*-
+require File.dirname(__FILE__) + '/../test_helper'
+
+class TimeEntryReportsControllerTest < ActionController::TestCase
+ fixtures :projects, :enabled_modules, :roles, :members, :member_roles, :issues, :time_entries, :users, :trackers, :enumerations, :issue_statuses, :custom_fields, :custom_values
+
+ def test_report_no_criteria
+ get :report, :project_id => 1
+ assert_response :success
+ assert_template 'report'
+ end
+
+ def test_report_all_projects
+ get :report
+ assert_response :success
+ assert_template 'report'
+ end
+
+ def test_report_all_projects_denied
+ r = Role.anonymous
+ r.permissions.delete(:view_time_entries)
+ r.permissions_will_change!
+ r.save
+ get :report
+ assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Ftime_entries%2Freport'
+ end
+
+ def test_report_all_projects_one_criteria
+ get :report, :columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criterias => ['project']
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_equal "8.65", "%.2f" % assigns(:total_hours)
+ end
+
+ def test_report_all_time
+ get :report, :project_id => 1, :criterias => ['project', 'issue']
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_equal "162.90", "%.2f" % assigns(:total_hours)
+ end
+
+ def test_report_all_time_by_day
+ get :report, :project_id => 1, :criterias => ['project', 'issue'], :columns => 'day'
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_equal "162.90", "%.2f" % assigns(:total_hours)
+ assert_tag :tag => 'th', :content => '2007-03-12'
+ end
+
+ def test_report_one_criteria
+ get :report, :project_id => 1, :columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criterias => ['project']
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_equal "8.65", "%.2f" % assigns(:total_hours)
+ end
+
+ def test_report_two_criterias
+ get :report, :project_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criterias => ["member", "activity"]
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_equal "162.90", "%.2f" % assigns(:total_hours)
+ end
+
+ def test_report_one_day
+ get :report, :project_id => 1, :columns => 'day', :from => "2007-03-23", :to => "2007-03-23", :criterias => ["member", "activity"]
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_equal "4.25", "%.2f" % assigns(:total_hours)
+ end
+
+ def test_report_at_issue_level
+ get :report, :project_id => 1, :issue_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criterias => ["member", "activity"]
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_equal "154.25", "%.2f" % assigns(:total_hours)
+ end
+
+ def test_report_custom_field_criteria
+ get :report, :project_id => 1, :criterias => ['project', 'cf_1', 'cf_7']
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_not_nil assigns(:criterias)
+ assert_equal 3, assigns(:criterias).size
+ assert_equal "162.90", "%.2f" % assigns(:total_hours)
+ # Custom field column
+ assert_tag :tag => 'th', :content => 'Database'
+ # Custom field row
+ assert_tag :tag => 'td', :content => 'MySQL',
+ :sibling => { :tag => 'td', :attributes => { :class => 'hours' },
+ :child => { :tag => 'span', :attributes => { :class => 'hours hours-int' },
+ :content => '1' }}
+ # Second custom field column
+ assert_tag :tag => 'th', :content => 'Billable'
+ end
+
+ def test_report_one_criteria_no_result
+ get :report, :project_id => 1, :columns => 'week', :from => "1998-04-01", :to => "1998-04-30", :criterias => ['project']
+ assert_response :success
+ assert_template 'report'
+ assert_not_nil assigns(:total_hours)
+ assert_equal "0.00", "%.2f" % assigns(:total_hours)
+ end
+
+ def test_report_all_projects_csv_export
+ get :report, :columns => 'month', :from => "2007-01-01", :to => "2007-06-30", :criterias => ["project", "member", "activity"], :format => "csv"
+ assert_response :success
+ assert_equal 'text/csv', @response.content_type
+ lines = @response.body.chomp.split("\n")
+ # Headers
+ assert_equal 'Project,Member,Activity,2007-1,2007-2,2007-3,2007-4,2007-5,2007-6,Total', lines.first
+ # Total row
+ assert_equal 'Total,"","","","",154.25,8.65,"","",162.90', lines.last
+ end
+
+ def test_report_csv_export
+ get :report, :project_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-06-30", :criterias => ["project", "member", "activity"], :format => "csv"
+ assert_response :success
+ assert_equal 'text/csv', @response.content_type
+ lines = @response.body.chomp.split("\n")
+ # Headers
+ assert_equal 'Project,Member,Activity,2007-1,2007-2,2007-3,2007-4,2007-5,2007-6,Total', lines.first
+ # Total row
+ assert_equal 'Total,"","","","",154.25,8.65,"","",162.90', lines.last
+ end
+
+end
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/timelog_controller_test.rb
--- a/test/functional/timelog_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/timelog_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -31,9 +31,9 @@
@response = ActionController::TestResponse.new
end
- def test_get_edit
+ def test_get_new
@request.session[:user_id] = 3
- get :edit, :project_id => 1
+ get :new, :project_id => 1
assert_response :success
assert_template 'edit'
# Default activity selected
@@ -41,24 +41,24 @@
:content => 'Development'
end
+ def test_get_new_should_only_show_active_time_entry_activities
+ @request.session[:user_id] = 3
+ get :new, :project_id => 1
+ assert_response :success
+ assert_template 'edit'
+ assert_no_tag :tag => 'option', :content => 'Inactive Activity'
+
+ end
+
def test_get_edit_existing_time
@request.session[:user_id] = 2
get :edit, :id => 2, :project_id => nil
assert_response :success
assert_template 'edit'
# Default activity selected
- assert_tag :tag => 'form', :attributes => { :action => '/projects/ecookbook/timelog/edit/2' }
+ assert_tag :tag => 'form', :attributes => { :action => '/projects/ecookbook/time_entries/2' }
end
- def test_get_edit_should_only_show_active_time_entry_activities
- @request.session[:user_id] = 3
- get :edit, :project_id => 1
- assert_response :success
- assert_template 'edit'
- assert_no_tag :tag => 'option', :content => 'Inactive Activity'
-
- end
-
def test_get_edit_with_an_existing_time_entry_with_inactive_activity
te = TimeEntry.find(1)
te.activity = TimeEntryActivity.find_by_name("Inactive Activity")
@@ -72,18 +72,18 @@
assert_tag :tag => 'option', :content => '--- Please select ---'
end
- def test_post_edit
+ def test_post_create
# TODO: should POST to issues’ time log instead of project. change form
# and routing
@request.session[:user_id] = 3
- post :edit, :project_id => 1,
+ post :create, :project_id => 1,
:time_entry => {:comments => 'Some work on TimelogControllerTest',
# Not the default activity
:activity_id => '11',
:spent_on => '2008-03-14',
:issue_id => '1',
:hours => '7.3'}
- assert_redirected_to :action => 'details', :project_id => 'ecookbook'
+ assert_redirected_to :action => 'index', :project_id => 'ecookbook'
i = Issue.find(1)
t = TimeEntry.find_by_comments('Some work on TimelogControllerTest')
@@ -101,10 +101,10 @@
assert_equal 2, entry.user_id
@request.session[:user_id] = 1
- post :edit, :id => 1,
+ put :update, :id => 1,
:time_entry => {:issue_id => '2',
:hours => '8'}
- assert_redirected_to :action => 'details', :project_id => 'ecookbook'
+ assert_redirected_to :action => 'index', :project_id => 'ecookbook'
entry.reload
assert_equal 8, entry.hours
@@ -114,8 +114,8 @@
def test_destroy
@request.session[:user_id] = 2
- post :destroy, :id => 1
- assert_redirected_to :action => 'details', :project_id => 'ecookbook'
+ delete :destroy, :id => 1
+ assert_redirected_to :action => 'index', :project_id => 'ecookbook'
assert_equal I18n.t(:notice_successful_delete), flash[:notice]
assert_nil TimeEntry.find_by_id(1)
end
@@ -128,8 +128,8 @@
end
@request.session[:user_id] = 2
- post :destroy, :id => 1
- assert_redirected_to :action => 'details', :project_id => 'ecookbook'
+ delete :destroy, :id => 1
+ assert_redirected_to :action => 'index', :project_id => 'ecookbook'
assert_equal I18n.t(:notice_unable_delete_time_entry), flash[:error]
assert_not_nil TimeEntry.find_by_id(1)
@@ -137,145 +137,18 @@
TimeEntry.before_destroy.reject! {|callback| callback.method == :stop_callback_chain }
end
- def test_report_no_criteria
- get :report, :project_id => 1
+ def test_index_all_projects
+ get :index
assert_response :success
- assert_template 'report'
- end
-
- def test_report_all_projects
- get :report
- assert_response :success
- assert_template 'report'
- end
-
- def test_report_all_projects_denied
- r = Role.anonymous
- r.permissions.delete(:view_time_entries)
- r.permissions_will_change!
- r.save
- get :report
- assert_redirected_to '/login?back_url=http%3A%2F%2Ftest.host%2Ftime_entries%2Freport'
- end
-
- def test_report_all_projects_one_criteria
- get :report, :columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criterias => ['project']
- assert_response :success
- assert_template 'report'
- assert_not_nil assigns(:total_hours)
- assert_equal "8.65", "%.2f" % assigns(:total_hours)
- end
-
- def test_report_all_time
- get :report, :project_id => 1, :criterias => ['project', 'issue']
- assert_response :success
- assert_template 'report'
- assert_not_nil assigns(:total_hours)
- assert_equal "162.90", "%.2f" % assigns(:total_hours)
- end
-
- def test_report_all_time_by_day
- get :report, :project_id => 1, :criterias => ['project', 'issue'], :columns => 'day'
- assert_response :success
- assert_template 'report'
- assert_not_nil assigns(:total_hours)
- assert_equal "162.90", "%.2f" % assigns(:total_hours)
- assert_tag :tag => 'th', :content => '2007-03-12'
- end
-
- def test_report_one_criteria
- get :report, :project_id => 1, :columns => 'week', :from => "2007-04-01", :to => "2007-04-30", :criterias => ['project']
- assert_response :success
- assert_template 'report'
- assert_not_nil assigns(:total_hours)
- assert_equal "8.65", "%.2f" % assigns(:total_hours)
- end
-
- def test_report_two_criterias
- get :report, :project_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criterias => ["member", "activity"]
- assert_response :success
- assert_template 'report'
+ assert_template 'index'
assert_not_nil assigns(:total_hours)
assert_equal "162.90", "%.2f" % assigns(:total_hours)
end
- def test_report_one_day
- get :report, :project_id => 1, :columns => 'day', :from => "2007-03-23", :to => "2007-03-23", :criterias => ["member", "activity"]
+ def test_index_at_project_level
+ get :index, :project_id => 1
assert_response :success
- assert_template 'report'
- assert_not_nil assigns(:total_hours)
- assert_equal "4.25", "%.2f" % assigns(:total_hours)
- end
-
- def test_report_at_issue_level
- get :report, :project_id => 1, :issue_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criterias => ["member", "activity"]
- assert_response :success
- assert_template 'report'
- assert_not_nil assigns(:total_hours)
- assert_equal "154.25", "%.2f" % assigns(:total_hours)
- end
-
- def test_report_custom_field_criteria
- get :report, :project_id => 1, :criterias => ['project', 'cf_1', 'cf_7']
- assert_response :success
- assert_template 'report'
- assert_not_nil assigns(:total_hours)
- assert_not_nil assigns(:criterias)
- assert_equal 3, assigns(:criterias).size
- assert_equal "162.90", "%.2f" % assigns(:total_hours)
- # Custom field column
- assert_tag :tag => 'th', :content => 'Database'
- # Custom field row
- assert_tag :tag => 'td', :content => 'MySQL',
- :sibling => { :tag => 'td', :attributes => { :class => 'hours' },
- :child => { :tag => 'span', :attributes => { :class => 'hours hours-int' },
- :content => '1' }}
- # Second custom field column
- assert_tag :tag => 'th', :content => 'Billable'
- end
-
- def test_report_one_criteria_no_result
- get :report, :project_id => 1, :columns => 'week', :from => "1998-04-01", :to => "1998-04-30", :criterias => ['project']
- assert_response :success
- assert_template 'report'
- assert_not_nil assigns(:total_hours)
- assert_equal "0.00", "%.2f" % assigns(:total_hours)
- end
-
- def test_report_all_projects_csv_export
- get :report, :columns => 'month', :from => "2007-01-01", :to => "2007-06-30", :criterias => ["project", "member", "activity"], :format => "csv"
- assert_response :success
- assert_equal 'text/csv', @response.content_type
- lines = @response.body.chomp.split("\n")
- # Headers
- assert_equal 'Project,Member,Activity,2007-1,2007-2,2007-3,2007-4,2007-5,2007-6,Total', lines.first
- # Total row
- assert_equal 'Total,"","","","",154.25,8.65,"","",162.90', lines.last
- end
-
- def test_report_csv_export
- get :report, :project_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-06-30", :criterias => ["project", "member", "activity"], :format => "csv"
- assert_response :success
- assert_equal 'text/csv', @response.content_type
- lines = @response.body.chomp.split("\n")
- # Headers
- assert_equal 'Project,Member,Activity,2007-1,2007-2,2007-3,2007-4,2007-5,2007-6,Total', lines.first
- # Total row
- assert_equal 'Total,"","","","",154.25,8.65,"","",162.90', lines.last
- end
-
- def test_details_all_projects
- get :details
- assert_response :success
- assert_template 'details'
- assert_not_nil assigns(:total_hours)
- assert_equal "162.90", "%.2f" % assigns(:total_hours)
- end
-
- def test_details_at_project_level
- get :details, :project_id => 1
- assert_response :success
- assert_template 'details'
+ assert_template 'index'
assert_not_nil assigns(:entries)
assert_equal 4, assigns(:entries).size
# project and subproject
@@ -287,10 +160,10 @@
assert_equal '2007-04-22'.to_date, assigns(:to)
end
- def test_details_at_project_level_with_date_range
- get :details, :project_id => 1, :from => '2007-03-20', :to => '2007-04-30'
+ def test_index_at_project_level_with_date_range
+ get :index, :project_id => 1, :from => '2007-03-20', :to => '2007-04-30'
assert_response :success
- assert_template 'details'
+ assert_template 'index'
assert_not_nil assigns(:entries)
assert_equal 3, assigns(:entries).size
assert_not_nil assigns(:total_hours)
@@ -299,28 +172,28 @@
assert_equal '2007-04-30'.to_date, assigns(:to)
end
- def test_details_at_project_level_with_period
- get :details, :project_id => 1, :period => '7_days'
+ def test_index_at_project_level_with_period
+ get :index, :project_id => 1, :period => '7_days'
assert_response :success
- assert_template 'details'
+ assert_template 'index'
assert_not_nil assigns(:entries)
assert_not_nil assigns(:total_hours)
assert_equal Date.today - 7, assigns(:from)
assert_equal Date.today, assigns(:to)
end
- def test_details_one_day
- get :details, :project_id => 1, :from => "2007-03-23", :to => "2007-03-23"
+ def test_index_one_day
+ get :index, :project_id => 1, :from => "2007-03-23", :to => "2007-03-23"
assert_response :success
- assert_template 'details'
+ assert_template 'index'
assert_not_nil assigns(:total_hours)
assert_equal "4.25", "%.2f" % assigns(:total_hours)
end
- def test_details_at_issue_level
- get :details, :issue_id => 1
+ def test_index_at_issue_level
+ get :index, :issue_id => 1
assert_response :success
- assert_template 'details'
+ assert_template 'index'
assert_not_nil assigns(:entries)
assert_equal 2, assigns(:entries).size
assert_not_nil assigns(:total_hours)
@@ -330,26 +203,26 @@
assert_equal '2007-04-22'.to_date, assigns(:to)
end
- def test_details_atom_feed
- get :details, :project_id => 1, :format => 'atom'
+ def test_index_atom_feed
+ get :index, :project_id => 1, :format => 'atom'
assert_response :success
assert_equal 'application/atom+xml', @response.content_type
assert_not_nil assigns(:items)
assert assigns(:items).first.is_a?(TimeEntry)
end
- def test_details_all_projects_csv_export
+ def test_index_all_projects_csv_export
Setting.date_format = '%m/%d/%Y'
- get :details, :format => 'csv'
+ get :index, :format => 'csv'
assert_response :success
assert_equal 'text/csv', @response.content_type
assert @response.body.include?("Date,User,Activity,Project,Issue,Tracker,Subject,Hours,Comment\n")
assert @response.body.include?("\n04/21/2007,redMine Admin,Design,eCookbook,3,Bug,Error 281 when updating a recipe,1.0,\"\"\n")
end
- def test_details_csv_export
+ def test_index_csv_export
Setting.date_format = '%m/%d/%Y'
- get :details, :project_id => 1, :format => 'csv'
+ get :index, :project_id => 1, :format => 'csv'
assert_response :success
assert_equal 'text/csv', @response.content_type
assert @response.body.include?("Date,User,Activity,Project,Issue,Tracker,Subject,Hours,Comment\n")
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/users_controller_test.rb
--- a/test/functional/users_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/users_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -24,7 +24,7 @@
class UsersControllerTest < ActionController::TestCase
include Redmine::I18n
- fixtures :users, :projects, :members, :member_roles, :roles
+ fixtures :users, :projects, :members, :member_roles, :roles, :auth_sources, :custom_fields, :custom_values
def setup
@controller = UsersController.new
@@ -65,6 +65,19 @@
assert_response :success
assert_template 'show'
assert_not_nil assigns(:user)
+
+ assert_tag 'li', :content => /Phone number/
+ end
+
+ def test_show_should_not_display_hidden_custom_fields
+ @request.session[:user_id] = nil
+ UserCustomField.find_by_name('Phone number').update_attribute :visible, false
+ get :show, :id => 2
+ assert_response :success
+ assert_template 'show'
+ assert_not_nil assigns(:user)
+
+ assert_no_tag 'li', :content => /Phone number/
end
def test_show_should_not_fail_when_custom_values_are_nil
@@ -107,14 +120,65 @@
assert project_ids.include?(2) #private project admin can see
end
- def test_edit
+ context "GET :new" do
+ setup do
+ get :new
+ end
+
+ should_assign_to :user
+ should_respond_with :success
+ should_render_template :new
+ end
+
+ context "POST :create" do
+ context "when successful" do
+ setup do
+ post :create, :user => {
+ :firstname => 'John',
+ :lastname => 'Doe',
+ :login => 'jdoe',
+ :password => 'test',
+ :password_confirmation => 'test',
+ :mail => 'jdoe@gmail.com'
+ },
+ :notification_option => 'none'
+ end
+
+ should_assign_to :user
+ should_respond_with :redirect
+ should_redirect_to('user edit') { {:controller => 'users', :action => 'edit', :id => User.find_by_login('jdoe')}}
+
+ should 'set the users mail notification' do
+ user = User.last
+ assert_equal 'none', user.mail_notification
+ end
+ end
+
+ context "when unsuccessful" do
+ setup do
+ post :create, :user => {}
+ end
+
+ should_assign_to :user
+ should_respond_with :success
+ should_render_template :new
+ end
+
+ end
+
+ def test_update
ActionMailer::Base.deliveries.clear
- post :edit, :id => 2, :user => {:firstname => 'Changed'}
- assert_equal 'Changed', User.find(2).firstname
+ put :update, :id => 2, :user => {:firstname => 'Changed'}, :notification_option => 'all', :pref => {:hide_mail => '1', :comments_sorting => 'desc'}
+
+ user = User.find(2)
+ assert_equal 'Changed', user.firstname
+ assert_equal 'all', user.mail_notification
+ assert_equal true, user.pref[:hide_mail]
+ assert_equal 'desc', user.pref[:comments_sorting]
assert ActionMailer::Base.deliveries.empty?
end
- def test_edit_with_activation_should_send_a_notification
+ def test_update_with_activation_should_send_a_notification
u = User.new(:firstname => 'Foo', :lastname => 'Bar', :mail => 'foo.bar@somenet.foo', :language => 'fr')
u.login = 'foo'
u.status = User::STATUS_REGISTERED
@@ -122,7 +186,7 @@
ActionMailer::Base.deliveries.clear
Setting.bcc_recipients = '1'
- post :edit, :id => u.id, :user => {:status => User::STATUS_ACTIVE}
+ put :update, :id => u.id, :user => {:status => User::STATUS_ACTIVE}
assert u.reload.active?
mail = ActionMailer::Base.deliveries.last
assert_not_nil mail
@@ -130,12 +194,12 @@
assert mail.body.include?(ll('fr', :notice_account_activated))
end
- def test_edit_with_password_change_should_send_a_notification
+ def test_updat_with_password_change_should_send_a_notification
ActionMailer::Base.deliveries.clear
Setting.bcc_recipients = '1'
u = User.find(2)
- post :edit, :id => u.id, :user => {}, :password => 'newpass', :password_confirmation => 'newpass', :send_information => '1'
+ put :update, :id => u.id, :user => {}, :password => 'newpass', :password_confirmation => 'newpass', :send_information => '1'
assert_equal User.hash_password('newpass'), u.reload.hashed_password
mail = ActionMailer::Base.deliveries.last
@@ -144,13 +208,13 @@
assert mail.body.include?('newpass')
end
- test "POST :edit with a password change to an AuthSource user switching to Internal authentication" do
+ test "put :update with a password change to an AuthSource user switching to Internal authentication" do
# Configure as auth source
u = User.find(2)
u.auth_source = AuthSource.find(1)
u.save!
- post :edit, :id => u.id, :user => {:auth_source_id => ''}, :password => 'newpass', :password_confirmation => 'newpass'
+ put :update, :id => u.id, :user => {:auth_source_id => ''}, :password => 'newpass', :password_confirmation => 'newpass'
assert_equal nil, u.reload.auth_source
assert_equal User.hash_password('newpass'), u.reload.hashed_password
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/versions_controller_test.rb
--- a/test/functional/versions_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/versions_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -123,6 +123,15 @@
assert_equal 'New version name', version.name
assert_equal Date.today, version.effective_date
end
+
+ def test_post_update_with_validation_failure
+ @request.session[:user_id] = 2
+ put :update, :id => 2,
+ :version => { :name => '',
+ :effective_date => Date.today.strftime("%Y-%m-%d")}
+ assert_response :success
+ assert_template 'edit'
+ end
def test_destroy
@request.session[:user_id] = 2
diff -r 09b1d4349da3 -r 371eac10df0b test/functional/wiki_controller_test.rb
--- a/test/functional/wiki_controller_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/functional/wiki_controller_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -32,7 +32,7 @@
end
def test_show_start_page
- get :index, :id => 'ecookbook'
+ get :show, :project_id => 'ecookbook'
assert_response :success
assert_template 'show'
assert_tag :tag => 'h1', :content => /CookBook documentation/
@@ -45,7 +45,7 @@
end
def test_show_page_with_name
- get :index, :id => 1, :page => 'Another_page'
+ get :show, :project_id => 1, :id => 'Another_page'
assert_response :success
assert_template 'show'
assert_tag :tag => 'h1', :content => /Another page/
@@ -60,32 +60,32 @@
page.content = WikiContent.new(:text => 'Side bar content for test_show_with_sidebar')
page.save!
- get :index, :id => 1, :page => 'Another_page'
+ get :show, :project_id => 1, :id => 'Another_page'
assert_response :success
assert_tag :tag => 'div', :attributes => {:id => 'sidebar'},
:content => /Side bar content for test_show_with_sidebar/
end
def test_show_unexistent_page_without_edit_right
- get :index, :id => 1, :page => 'Unexistent page'
+ get :show, :project_id => 1, :id => 'Unexistent page'
assert_response 404
end
def test_show_unexistent_page_with_edit_right
@request.session[:user_id] = 2
- get :index, :id => 1, :page => 'Unexistent page'
+ get :show, :project_id => 1, :id => 'Unexistent page'
assert_response :success
assert_template 'edit'
end
def test_create_page
@request.session[:user_id] = 2
- post :edit, :id => 1,
- :page => 'New page',
+ put :update, :project_id => 1,
+ :id => 'New page',
:content => {:comments => 'Created the page',
:text => "h1. New page\n\nThis is a new page",
:version => 0}
- assert_redirected_to :action => 'index', :id => 'ecookbook', :page => 'New_page'
+ assert_redirected_to :action => 'show', :project_id => 'ecookbook', :id => 'New_page'
page = Project.find(1).wiki.find_page('New page')
assert !page.new_record?
assert_not_nil page.content
@@ -96,8 +96,8 @@
@request.session[:user_id] = 2
assert_difference 'WikiPage.count' do
assert_difference 'Attachment.count' do
- post :edit, :id => 1,
- :page => 'New page',
+ put :update, :project_id => 1,
+ :id => 'New page',
:content => {:comments => 'Created the page',
:text => "h1. New page\n\nThis is a new page",
:version => 0},
@@ -111,7 +111,7 @@
def test_preview
@request.session[:user_id] = 2
- xhr :post, :preview, :id => 1, :page => 'CookBook_documentation',
+ xhr :post, :preview, :project_id => 1, :id => 'CookBook_documentation',
:content => { :comments => '',
:text => 'this is a *previewed text*',
:version => 3 }
@@ -122,7 +122,7 @@
def test_preview_new_page
@request.session[:user_id] = 2
- xhr :post, :preview, :id => 1, :page => 'New page',
+ xhr :post, :preview, :project_id => 1, :id => 'New page',
:content => { :text => 'h1. New page',
:comments => '',
:version => 0 }
@@ -132,7 +132,7 @@
end
def test_history
- get :history, :id => 1, :page => 'CookBook_documentation'
+ get :history, :project_id => 1, :id => 'CookBook_documentation'
assert_response :success
assert_template 'history'
assert_not_nil assigns(:versions)
@@ -141,7 +141,7 @@
end
def test_history_with_one_version
- get :history, :id => 1, :page => 'Another_page'
+ get :history, :project_id => 1, :id => 'Another_page'
assert_response :success
assert_template 'history'
assert_not_nil assigns(:versions)
@@ -150,7 +150,7 @@
end
def test_diff
- get :diff, :id => 1, :page => 'CookBook_documentation', :version => 2, :version_from => 1
+ get :diff, :project_id => 1, :id => 'CookBook_documentation', :version => 2, :version_from => 1
assert_response :success
assert_template 'diff'
assert_tag :tag => 'span', :attributes => { :class => 'diff_in'},
@@ -158,7 +158,7 @@
end
def test_annotate
- get :annotate, :id => 1, :page => 'CookBook_documentation', :version => 2
+ get :annotate, :project_id => 1, :id => 'CookBook_documentation', :version => 2
assert_response :success
assert_template 'annotate'
# Line 1
@@ -170,13 +170,45 @@
:child => { :tag => 'td', :attributes => {:class => 'author'}, :content => /redMine Admin/ },
:child => { :tag => 'td', :content => /Some updated \[\[documentation\]\] here/ }
end
+
+ def test_get_rename
+ @request.session[:user_id] = 2
+ get :rename, :project_id => 1, :id => 'Another_page'
+ assert_response :success
+ assert_template 'rename'
+ assert_tag 'option',
+ :attributes => {:value => ''},
+ :content => '',
+ :parent => {:tag => 'select', :attributes => {:name => 'wiki_page[parent_id]'}}
+ assert_no_tag 'option',
+ :attributes => {:selected => 'selected'},
+ :parent => {:tag => 'select', :attributes => {:name => 'wiki_page[parent_id]'}}
+ end
+
+ def test_get_rename_child_page
+ @request.session[:user_id] = 2
+ get :rename, :project_id => 1, :id => 'Child_1'
+ assert_response :success
+ assert_template 'rename'
+ assert_tag 'option',
+ :attributes => {:value => ''},
+ :content => '',
+ :parent => {:tag => 'select', :attributes => {:name => 'wiki_page[parent_id]'}}
+ assert_tag 'option',
+ :attributes => {:value => '2', :selected => 'selected'},
+ :content => /Another page/,
+ :parent => {
+ :tag => 'select',
+ :attributes => {:name => 'wiki_page[parent_id]'}
+ }
+ end
def test_rename_with_redirect
@request.session[:user_id] = 2
- post :rename, :id => 1, :page => 'Another_page',
+ post :rename, :project_id => 1, :id => 'Another_page',
:wiki_page => { :title => 'Another renamed page',
:redirect_existing_links => 1 }
- assert_redirected_to :action => 'index', :id => 'ecookbook', :page => 'Another_renamed_page'
+ assert_redirected_to :action => 'show', :project_id => 'ecookbook', :id => 'Another_renamed_page'
wiki = Project.find(1).wiki
# Check redirects
assert_not_nil wiki.find_page('Another page')
@@ -185,25 +217,41 @@
def test_rename_without_redirect
@request.session[:user_id] = 2
- post :rename, :id => 1, :page => 'Another_page',
+ post :rename, :project_id => 1, :id => 'Another_page',
:wiki_page => { :title => 'Another renamed page',
:redirect_existing_links => "0" }
- assert_redirected_to :action => 'index', :id => 'ecookbook', :page => 'Another_renamed_page'
+ assert_redirected_to :action => 'show', :project_id => 'ecookbook', :id => 'Another_renamed_page'
wiki = Project.find(1).wiki
# Check that there's no redirects
assert_nil wiki.find_page('Another page')
end
+ def test_rename_with_parent_assignment
+ @request.session[:user_id] = 2
+ post :rename, :project_id => 1, :id => 'Another_page',
+ :wiki_page => { :title => 'Another page', :redirect_existing_links => "0", :parent_id => '4' }
+ assert_redirected_to :action => 'show', :project_id => 'ecookbook', :id => 'Another_page'
+ assert_equal WikiPage.find(4), WikiPage.find_by_title('Another_page').parent
+ end
+
+ def test_rename_with_parent_unassignment
+ @request.session[:user_id] = 2
+ post :rename, :project_id => 1, :id => 'Child_1',
+ :wiki_page => { :title => 'Child 1', :redirect_existing_links => "0", :parent_id => '' }
+ assert_redirected_to :action => 'show', :project_id => 'ecookbook', :id => 'Child_1'
+ assert_nil WikiPage.find_by_title('Child_1').parent
+ end
+
def test_destroy_child
@request.session[:user_id] = 2
- post :destroy, :id => 1, :page => 'Child_1'
- assert_redirected_to :action => 'special', :id => 'ecookbook', :page => 'Page_index'
+ delete :destroy, :project_id => 1, :id => 'Child_1'
+ assert_redirected_to :action => 'index', :project_id => 'ecookbook'
end
def test_destroy_parent
@request.session[:user_id] = 2
assert_no_difference('WikiPage.count') do
- post :destroy, :id => 1, :page => 'Another_page'
+ delete :destroy, :project_id => 1, :id => 'Another_page'
end
assert_response :success
assert_template 'destroy'
@@ -212,18 +260,18 @@
def test_destroy_parent_with_nullify
@request.session[:user_id] = 2
assert_difference('WikiPage.count', -1) do
- post :destroy, :id => 1, :page => 'Another_page', :todo => 'nullify'
+ delete :destroy, :project_id => 1, :id => 'Another_page', :todo => 'nullify'
end
- assert_redirected_to :action => 'special', :id => 'ecookbook', :page => 'Page_index'
+ assert_redirected_to :action => 'index', :project_id => 'ecookbook'
assert_nil WikiPage.find_by_id(2)
end
def test_destroy_parent_with_cascade
@request.session[:user_id] = 2
assert_difference('WikiPage.count', -3) do
- post :destroy, :id => 1, :page => 'Another_page', :todo => 'destroy'
+ delete :destroy, :project_id => 1, :id => 'Another_page', :todo => 'destroy'
end
- assert_redirected_to :action => 'special', :id => 'ecookbook', :page => 'Page_index'
+ assert_redirected_to :action => 'index', :project_id => 'ecookbook'
assert_nil WikiPage.find_by_id(2)
assert_nil WikiPage.find_by_id(5)
end
@@ -231,17 +279,17 @@
def test_destroy_parent_with_reassign
@request.session[:user_id] = 2
assert_difference('WikiPage.count', -1) do
- post :destroy, :id => 1, :page => 'Another_page', :todo => 'reassign', :reassign_to_id => 1
+ delete :destroy, :project_id => 1, :id => 'Another_page', :todo => 'reassign', :reassign_to_id => 1
end
- assert_redirected_to :action => 'special', :id => 'ecookbook', :page => 'Page_index'
+ assert_redirected_to :action => 'index', :project_id => 'ecookbook'
assert_nil WikiPage.find_by_id(2)
assert_equal WikiPage.find(1), WikiPage.find_by_id(5).parent
end
- def test_page_index
- get :special, :id => 'ecookbook', :page => 'Page_index'
+ def test_index
+ get :index, :project_id => 'ecookbook'
assert_response :success
- assert_template 'special_page_index'
+ assert_template 'index'
pages = assigns(:pages)
assert_not_nil pages
assert_equal Project.find(1).wiki.pages.size, pages.size
@@ -256,9 +304,49 @@
:child => { :tag => 'li', :child => { :tag => 'a', :attributes => { :href => '/projects/ecookbook/wiki/Another_page' },
:content => 'Another page' } }
end
+
+ context "GET :export" do
+ context "with an authorized user to export the wiki" do
+ setup do
+ @request.session[:user_id] = 2
+ get :export, :project_id => 'ecookbook'
+ end
+
+ should_respond_with :success
+ should_assign_to :pages
+ should_respond_with_content_type "text/html"
+ should "export all of the wiki pages to a single html file" do
+ assert_select "a[name=?]", "CookBook_documentation"
+ assert_select "a[name=?]", "Another_page"
+ assert_select "a[name=?]", "Page_with_an_inline_image"
+ end
+
+ end
+
+ context "with an unauthorized user" do
+ setup do
+ get :export, :project_id => 'ecookbook'
+
+ should_respond_with :redirect
+ should_redirect_to('wiki index') { {:action => 'show', :project_id => @project, :id => nil} }
+ end
+ end
+ end
+
+ context "GET :date_index" do
+ setup do
+ get :date_index, :project_id => 'ecookbook'
+ end
+
+ should_respond_with :success
+ should_assign_to :pages
+ should_assign_to :pages_by_date
+ should_render_template 'wiki/date_index'
+
+ end
def test_not_found
- get :index, :id => 999
+ get :show, :project_id => 999
assert_response 404
end
@@ -266,8 +354,8 @@
page = WikiPage.find_by_wiki_id_and_title(1, 'Another_page')
assert !page.protected?
@request.session[:user_id] = 2
- post :protect, :id => 1, :page => page.title, :protected => '1'
- assert_redirected_to :action => 'index', :id => 'ecookbook', :page => 'Another_page'
+ post :protect, :project_id => 1, :id => page.title, :protected => '1'
+ assert_redirected_to :action => 'show', :project_id => 'ecookbook', :id => 'Another_page'
assert page.reload.protected?
end
@@ -275,14 +363,14 @@
page = WikiPage.find_by_wiki_id_and_title(1, 'CookBook_documentation')
assert page.protected?
@request.session[:user_id] = 2
- post :protect, :id => 1, :page => page.title, :protected => '0'
- assert_redirected_to :action => 'index', :id => 'ecookbook', :page => 'CookBook_documentation'
+ post :protect, :project_id => 1, :id => page.title, :protected => '0'
+ assert_redirected_to :action => 'show', :project_id => 'ecookbook', :id => 'CookBook_documentation'
assert !page.reload.protected?
end
def test_show_page_with_edit_link
@request.session[:user_id] = 2
- get :index, :id => 1
+ get :show, :project_id => 1
assert_response :success
assert_template 'show'
assert_tag :tag => 'a', :attributes => { :href => '/projects/1/wiki/CookBook_documentation/edit' }
@@ -290,7 +378,7 @@
def test_show_page_without_edit_link
@request.session[:user_id] = 4
- get :index, :id => 1
+ get :show, :project_id => 1
assert_response :success
assert_template 'show'
assert_no_tag :tag => 'a', :attributes => { :href => '/projects/1/wiki/CookBook_documentation/edit' }
@@ -299,7 +387,7 @@
def test_edit_unprotected_page
# Non members can edit unprotected wiki pages
@request.session[:user_id] = 4
- get :edit, :id => 1, :page => 'Another_page'
+ get :edit, :project_id => 1, :id => 'Another_page'
assert_response :success
assert_template 'edit'
end
@@ -307,19 +395,19 @@
def test_edit_protected_page_by_nonmember
# Non members can't edit protected wiki pages
@request.session[:user_id] = 4
- get :edit, :id => 1, :page => 'CookBook_documentation'
+ get :edit, :project_id => 1, :id => 'CookBook_documentation'
assert_response 403
end
def test_edit_protected_page_by_member
@request.session[:user_id] = 2
- get :edit, :id => 1, :page => 'CookBook_documentation'
+ get :edit, :project_id => 1, :id => 'CookBook_documentation'
assert_response :success
assert_template 'edit'
end
def test_history_of_non_existing_page_should_return_404
- get :history, :id => 1, :page => 'Unknown_page'
+ get :history, :project_id => 1, :id => 'Unknown_page'
assert_response 404
end
end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/.svn/all-wcprops
--- a/test/integration/.svn/all-wcprops Thu Oct 21 11:19:14 2010 +0100
+++ b/test/integration/.svn/all-wcprops Wed Nov 24 12:20:08 2010 +0000
@@ -1,19 +1,7 @@
K 25
svn:wc:ra_dav:version-url
V 41
-/svn/!svn/ver/4172/trunk/test/integration
-END
-api_token_login_test.rb
-K 25
-svn:wc:ra_dav:version-url
-V 65
-/svn/!svn/ver/3220/trunk/test/integration/api_token_login_test.rb
-END
-projects_api_test.rb
-K 25
-svn:wc:ra_dav:version-url
-V 62
-/svn/!svn/ver/3687/trunk/test/integration/projects_api_test.rb
+/svn/!svn/ver/4407/trunk/test/integration
END
application_test.rb
K 25
@@ -21,59 +9,35 @@
V 61
/svn/!svn/ver/2779/trunk/test/integration/application_test.rb
END
-issues_api_test.rb
-K 25
-svn:wc:ra_dav:version-url
-V 60
-/svn/!svn/ver/4048/trunk/test/integration/issues_api_test.rb
-END
routing_test.rb
K 25
svn:wc:ra_dav:version-url
V 57
-/svn/!svn/ver/4172/trunk/test/integration/routing_test.rb
+/svn/!svn/ver/4372/trunk/test/integration/routing_test.rb
END
admin_test.rb
K 25
svn:wc:ra_dav:version-url
V 55
-/svn/!svn/ver/3050/trunk/test/integration/admin_test.rb
-END
-http_basic_login_test.rb
-K 25
-svn:wc:ra_dav:version-url
-V 66
-/svn/!svn/ver/3679/trunk/test/integration/http_basic_login_test.rb
+/svn/!svn/ver/4231/trunk/test/integration/admin_test.rb
END
projects_test.rb
K 25
svn:wc:ra_dav:version-url
V 58
-/svn/!svn/ver/2317/trunk/test/integration/projects_test.rb
+/svn/!svn/ver/4407/trunk/test/integration/projects_test.rb
END
issues_test.rb
K 25
svn:wc:ra_dav:version-url
V 56
-/svn/!svn/ver/4041/trunk/test/integration/issues_test.rb
+/svn/!svn/ver/4407/trunk/test/integration/issues_test.rb
END
account_test.rb
K 25
svn:wc:ra_dav:version-url
V 57
-/svn/!svn/ver/3492/trunk/test/integration/account_test.rb
-END
-http_basic_login_with_api_token_test.rb
-K 25
-svn:wc:ra_dav:version-url
-V 81
-/svn/!svn/ver/3220/trunk/test/integration/http_basic_login_with_api_token_test.rb
-END
-disabled_rest_api_test.rb
-K 25
-svn:wc:ra_dav:version-url
-V 67
-/svn/!svn/ver/3220/trunk/test/integration/disabled_rest_api_test.rb
+/svn/!svn/ver/4407/trunk/test/integration/account_test.rb
END
layout_test.rb
K 25
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/.svn/entries
--- a/test/integration/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/integration/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,15 +1,15 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test/integration
http://redmine.rubyforge.org/svn
-2010-09-23T15:20:19.085385Z
-4172
-edavis10
+2010-11-14T16:45:32.457767Z
+4407
+jplang
@@ -26,74 +26,6 @@
e93f8b46-1217-0410-a6f0-8f06a7374b81
-api_token_login_test.rb
-file
-
-
-
-
-2010-09-23T14:37:45.435782Z
-f99fc81982309b06b38b5a1ace40ca5e
-2009-12-23T06:27:44.373427Z
-3220
-edavis10
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2255
-
-projects_api_test.rb
-file
-
-
-
-
-2010-09-23T14:37:45.439778Z
-f71d3a9198cd46dcbe8c38b581be1bdb
-2010-04-21T16:02:55.125733Z
-3687
-edavis10
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3675
-
application_test.rb
file
@@ -128,40 +60,6 @@
1967
-issues_api_test.rb
-file
-
-
-
-
-2010-09-24T12:48:25.883734Z
-ffd48cf98057bd4ed0175bc4147c61cb
-2010-08-27T20:08:59.729788Z
-4048
-edavis10
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-9701
-
lib
dir
@@ -171,11 +69,11 @@
-2010-09-24T12:48:25.883734Z
-b1064aaf94d0e5242305bc5a09f0a596
-2010-09-23T15:20:19.085385Z
-4172
-edavis10
+2010-11-19T13:04:46.192843Z
+badebe423de738346d93306b99e49615
+2010-11-06T13:22:23.662480Z
+4372
+jplang
@@ -197,7 +95,10 @@
-24890
+27995
+
+api_test
+dir
admin_test.rb
file
@@ -205,10 +106,10 @@
-2010-09-23T14:37:45.435782Z
-d3db25767f7a6741931fa9b307ea9da9
-2009-11-14T19:41:02.240160Z
-3050
+2010-11-19T13:04:46.192843Z
+9d09badb144b1e0700cd7996b6582064
+2010-10-04T15:36:16.880272Z
+4231
edavis10
has-props
@@ -231,41 +132,7 @@
-2092
-
-http_basic_login_test.rb
-file
-
-
-
-
-2010-09-23T14:37:45.435782Z
-18dc5fe7b0619021768deecf38ad573a
-2010-04-17T12:45:23.887495Z
-3679
-jplang
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3403
+2097
projects_test.rb
file
@@ -273,11 +140,11 @@
-2010-09-23T14:37:45.439778Z
-aedb3aed4364cf43d6dc1e721d10b685
-2009-01-26T01:47:51.253124Z
-2317
-edavis10
+2010-11-19T13:04:46.192843Z
+c93f89c5c055ea2c9f60c8b845b3dc18
+2010-11-14T16:45:32.457767Z
+4407
+jplang
has-props
@@ -299,7 +166,7 @@
-1553
+1555
issues_test.rb
file
@@ -307,11 +174,11 @@
-2010-09-24T12:48:25.883734Z
-6125e0c4cbdc852b5831a85c0ded60f0
-2010-08-26T16:36:59.817467Z
-4041
-edavis10
+2010-11-19T13:04:46.196712Z
+d074b40a90cba528fe661e18a6e69f23
+2010-11-14T16:45:32.457767Z
+4407
+jplang
has-props
@@ -333,7 +200,7 @@
-4795
+4796
account_test.rb
file
@@ -341,10 +208,10 @@
-2010-09-23T14:37:45.435782Z
-dbb93f00bb81496a00069bc0f4d044c8
-2010-02-26T09:13:12.187275Z
-3492
+2010-11-19T13:04:46.196712Z
+8241ee2ac85e8c0bd227d80e120c2112
+2010-11-14T16:45:32.457767Z
+4407
jplang
has-props
@@ -367,75 +234,7 @@
-7130
-
-http_basic_login_with_api_token_test.rb
-file
-
-
-
-
-2010-09-23T14:37:45.435782Z
-f6d32b05d3ebaf4c30fac1532ecae7d2
-2009-12-23T06:27:44.373427Z
-3220
-edavis10
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2856
-
-disabled_rest_api_test.rb
-file
-
-
-
-
-2010-09-23T14:37:45.435782Z
-e244128a26c244c305a434ad5dab2946
-2009-12-23T06:27:44.373427Z
-3220
-edavis10
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3819
+7134
layout_test.rb
file
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/.svn/prop-base/issues_api_test.rb.svn-base
--- a/test/integration/.svn/prop-base/issues_api_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-K 13
-svn:eol-style
-V 6
-native
-END
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/.svn/prop-base/projects_api_test.rb.svn-base
--- a/test/integration/.svn/prop-base/projects_api_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-K 13
-svn:eol-style
-V 6
-native
-END
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/.svn/text-base/account_test.rb.svn-base
--- a/test/integration/.svn/text-base/account_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/integration/.svn/text-base/account_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -44,7 +44,7 @@
# User logs in with 'autologin' checked
post '/login', :username => user.login, :password => 'admin', :autologin => 1
- assert_redirected_to 'my/page'
+ assert_redirected_to '/my/page'
token = Token.find :first
assert_not_nil token
assert_equal user, token.user
@@ -105,7 +105,7 @@
post 'account/register', :user => {:login => "newuser", :language => "en", :firstname => "New", :lastname => "User", :mail => "newuser@foo.bar"},
:password => "newpass", :password_confirmation => "newpass"
- assert_redirected_to 'my/account'
+ assert_redirected_to '/my/account'
follow_redirect!
assert_response :success
assert_template 'my/account'
@@ -152,7 +152,7 @@
AuthSource.expects(:authenticate).returns({:login => 'foo', :firstname => 'Foo', :lastname => 'Smith', :mail => 'foo@bar.com', :auth_source_id => 66})
post 'account/login', :username => 'foo', :password => 'bar'
- assert_redirected_to 'my/page'
+ assert_redirected_to '/my/page'
user = User.find_by_login('foo')
assert user.is_a?(User)
@@ -187,7 +187,7 @@
sid = session[:session_id]
post '/login', :username => 'admin', :password => 'admin'
- assert_redirected_to 'my/page'
+ assert_redirected_to '/my/page'
assert_not_equal sid, session[:session_id], "login should reset session"
assert_equal 1, session[:user_id]
sid = session[:session_id]
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/.svn/text-base/admin_test.rb.svn-base
--- a/test/integration/.svn/text-base/admin_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/integration/.svn/text-base/admin_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -22,10 +22,10 @@
def test_add_user
log_user("admin", "admin")
- get "/users/add"
+ get "/users/new"
assert_response :success
- assert_template "users/add"
- post "/users/add", :user => { :login => "psmith", :firstname => "Paul", :lastname => "Smith", :mail => "psmith@somenet.foo", :language => "en" }, :password => "psmith09", :password_confirmation => "psmith09"
+ assert_template "users/new"
+ post "/users/create", :user => { :login => "psmith", :firstname => "Paul", :lastname => "Smith", :mail => "psmith@somenet.foo", :language => "en" }, :password => "psmith09", :password_confirmation => "psmith09"
user = User.find_by_login("psmith")
assert_kind_of User, user
@@ -35,15 +35,15 @@
assert_kind_of User, logged_user
assert_equal "Paul", logged_user.firstname
- post "users/edit", :id => user.id, :user => { :status => User::STATUS_LOCKED }
+ put "users/#{user.id}", :id => user.id, :user => { :status => User::STATUS_LOCKED }
assert_redirected_to "/users/#{ user.id }/edit"
locked_user = User.try_to_login("psmith", "psmith09")
assert_equal nil, locked_user
end
test "Add a user as an anonymous user should fail" do
- post '/users/add', :user => { :login => 'psmith', :firstname => 'Paul'}, :password => "psmith09", :password_confirmation => "psmith09"
+ post '/users/create', :user => { :login => 'psmith', :firstname => 'Paul'}, :password => "psmith09", :password_confirmation => "psmith09"
assert_response :redirect
- assert_redirected_to "/login?back_url=http%3A%2F%2Fwww.example.com%2Fusers%2Fnew"
+ assert_redirected_to "/login?back_url=http%3A%2F%2Fwww.example.com%2Fusers"
end
end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/.svn/text-base/api_token_login_test.rb.svn-base
--- a/test/integration/.svn/text-base/api_token_login_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-require "#{File.dirname(__FILE__)}/../test_helper"
-
-class ApiTokenLoginTest < ActionController::IntegrationTest
- fixtures :all
-
- def setup
- Setting.rest_api_enabled = '1'
- Setting.login_required = '1'
- end
-
- def teardown
- Setting.rest_api_enabled = '0'
- Setting.login_required = '0'
- end
-
- # Using the NewsController because it's a simple API.
- context "get /news" do
-
- context "in :xml format" do
- context "with a valid api token" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'api')
- get "/news.xml?key=#{@token.value}"
- end
-
- should_respond_with :success
- should_respond_with_content_type :xml
- should "login as the user" do
- assert_equal @user, User.current
- end
- end
-
- context "with an invalid api token" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'feeds')
- get "/news.xml?key=#{@token.value}"
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :xml
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
- end
-
- context "in :json format" do
- context "with a valid api token" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'api')
- get "/news.json?key=#{@token.value}"
- end
-
- should_respond_with :success
- should_respond_with_content_type :json
- should "login as the user" do
- assert_equal @user, User.current
- end
- end
-
- context "with an invalid api token" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'feeds')
- get "/news.json?key=#{@token.value}"
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :json
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
- end
-
- end
-end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/.svn/text-base/disabled_rest_api_test.rb.svn-base
--- a/test/integration/.svn/text-base/disabled_rest_api_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-require "#{File.dirname(__FILE__)}/../test_helper"
-
-class DisabledRestApi < ActionController::IntegrationTest
- fixtures :all
-
- def setup
- Setting.rest_api_enabled = '0'
- Setting.login_required = '1'
- end
-
- def teardown
- Setting.rest_api_enabled = '1'
- Setting.login_required = '0'
- end
-
- # Using the NewsController because it's a simple API.
- context "get /news with the API disabled" do
-
- context "in :xml format" do
- context "with a valid api token" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'api')
- get "/news.xml?key=#{@token.value}"
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :xml
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
-
- context "with a valid HTTP authentication" do
- setup do
- @user = User.generate_with_protected!(:password => 'my_password', :password_confirmation => 'my_password')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'my_password')
- get "/news.xml", nil, :authorization => @authorization
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :xml
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
-
- context "with a valid HTTP authentication using the API token" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'api')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'X')
- get "/news.xml", nil, :authorization => @authorization
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :xml
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
- end
-
- context "in :json format" do
- context "with a valid api token" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'api')
- get "/news.json?key=#{@token.value}"
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :json
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
-
- context "with a valid HTTP authentication" do
- setup do
- @user = User.generate_with_protected!(:password => 'my_password', :password_confirmation => 'my_password')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'my_password')
- get "/news.json", nil, :authorization => @authorization
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :json
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
-
- context "with a valid HTTP authentication using the API token" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'api')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'DoesNotMatter')
- get "/news.json", nil, :authorization => @authorization
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :json
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
-
- end
- end
-end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/.svn/text-base/http_basic_login_test.rb.svn-base
--- a/test/integration/.svn/text-base/http_basic_login_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-require "#{File.dirname(__FILE__)}/../test_helper"
-
-class HttpBasicLoginTest < ActionController::IntegrationTest
- fixtures :all
-
- def setup
- Setting.rest_api_enabled = '1'
- Setting.login_required = '1'
- end
-
- def teardown
- Setting.rest_api_enabled = '0'
- Setting.login_required = '0'
- end
-
- # Using the NewsController because it's a simple API.
- context "get /news" do
-
- context "in :xml format" do
- context "with a valid HTTP authentication" do
- setup do
- @user = User.generate_with_protected!(:password => 'my_password', :password_confirmation => 'my_password')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'my_password')
- get "/news.xml", nil, :authorization => @authorization
- end
-
- should_respond_with :success
- should_respond_with_content_type :xml
- should "login as the user" do
- assert_equal @user, User.current
- end
- end
-
- context "with an invalid HTTP authentication" do
- setup do
- @user = User.generate_with_protected!
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'wrong_password')
- get "/news.xml", nil, :authorization => @authorization
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :xml
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
-
- context "without credentials" do
- setup do
- get "/projects/onlinestore/news.xml"
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :xml
- should "include_www_authenticate_header" do
- assert @controller.response.headers.has_key?('WWW-Authenticate')
- end
- end
- end
-
- context "in :json format" do
- context "with a valid HTTP authentication" do
- setup do
- @user = User.generate_with_protected!(:password => 'my_password', :password_confirmation => 'my_password')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'my_password')
- get "/news.json", nil, :authorization => @authorization
- end
-
- should_respond_with :success
- should_respond_with_content_type :json
- should "login as the user" do
- assert_equal @user, User.current
- end
- end
-
- context "with an invalid HTTP authentication" do
- setup do
- @user = User.generate_with_protected!
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'wrong_password')
- get "/news.json", nil, :authorization => @authorization
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :json
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
- end
-
- context "without credentials" do
- setup do
- get "/projects/onlinestore/news.json"
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :json
- should "include_www_authenticate_header" do
- assert @controller.response.headers.has_key?('WWW-Authenticate')
- end
- end
- end
-end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/.svn/text-base/http_basic_login_with_api_token_test.rb.svn-base
--- a/test/integration/.svn/text-base/http_basic_login_with_api_token_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-require "#{File.dirname(__FILE__)}/../test_helper"
-
-class HttpBasicLoginWithApiTokenTest < ActionController::IntegrationTest
- fixtures :all
-
- def setup
- Setting.rest_api_enabled = '1'
- Setting.login_required = '1'
- end
-
- def teardown
- Setting.rest_api_enabled = '0'
- Setting.login_required = '0'
- end
-
- # Using the NewsController because it's a simple API.
- context "get /news" do
-
- context "in :xml format" do
- context "with a valid HTTP authentication using the API token" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'api')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'X')
- get "/news.xml", nil, :authorization => @authorization
- end
-
- should_respond_with :success
- should_respond_with_content_type :xml
- should "login as the user" do
- assert_equal @user, User.current
- end
- end
-
- context "with an invalid HTTP authentication" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'feeds')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'X')
- get "/news.xml", nil, :authorization => @authorization
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :xml
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
- end
-
- context "in :json format" do
- context "with a valid HTTP authentication" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'api')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'DoesNotMatter')
- get "/news.json", nil, :authorization => @authorization
- end
-
- should_respond_with :success
- should_respond_with_content_type :json
- should "login as the user" do
- assert_equal @user, User.current
- end
- end
-
- context "with an invalid HTTP authentication" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'feeds')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'DoesNotMatter')
- get "/news.json", nil, :authorization => @authorization
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :json
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
- end
-
- end
-end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/.svn/text-base/issues_api_test.rb.svn-base
--- a/test/integration/.svn/text-base/issues_api_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,349 +0,0 @@
-# Redmine - project management software
-# Copyright (C) 2006-2010 Jean-Philippe Lang
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-require "#{File.dirname(__FILE__)}/../test_helper"
-
-class IssuesApiTest < ActionController::IntegrationTest
- fixtures :projects,
- :users,
- :roles,
- :members,
- :member_roles,
- :issues,
- :issue_statuses,
- :versions,
- :trackers,
- :projects_trackers,
- :issue_categories,
- :enabled_modules,
- :enumerations,
- :attachments,
- :workflows,
- :custom_fields,
- :custom_values,
- :custom_fields_projects,
- :custom_fields_trackers,
- :time_entries,
- :journals,
- :journal_details,
- :queries
-
- def setup
- Setting.rest_api_enabled = '1'
- end
-
- context "/index.xml" do
- setup do
- get '/issues.xml'
- end
-
- should_respond_with :success
- should_respond_with_content_type 'application/xml'
- end
-
- context "/index.json" do
- setup do
- get '/issues.json'
- end
-
- should_respond_with :success
- should_respond_with_content_type 'application/json'
-
- should 'return a valid JSON string' do
- assert ActiveSupport::JSON.decode(response.body)
- end
- end
-
- context "/index.xml with filter" do
- setup do
- get '/issues.xml?status_id=5'
- end
-
- should_respond_with :success
- should_respond_with_content_type 'application/xml'
- should "show only issues with the status_id" do
- assert_tag :tag => 'issues',
- :children => { :count => Issue.visible.count(:conditions => {:status_id => 5}),
- :only => { :tag => 'issue' } }
- end
- end
-
- context "/index.json with filter" do
- setup do
- get '/issues.json?status_id=5'
- end
-
- should_respond_with :success
- should_respond_with_content_type 'application/json'
-
- should 'return a valid JSON string' do
- assert ActiveSupport::JSON.decode(response.body)
- end
-
- should "show only issues with the status_id" do
- json = ActiveSupport::JSON.decode(response.body)
- status_ids_used = json.collect {|j| j['status_id'] }
- assert_equal 3, status_ids_used.length
- assert status_ids_used.all? {|id| id == 5 }
- end
-
- end
-
- context "/issues/1.xml" do
- setup do
- get '/issues/1.xml'
- end
-
- should_respond_with :success
- should_respond_with_content_type 'application/xml'
- end
-
- context "/issues/1.json" do
- setup do
- get '/issues/1.json'
- end
-
- should_respond_with :success
- should_respond_with_content_type 'application/json'
-
- should 'return a valid JSON string' do
- assert ActiveSupport::JSON.decode(response.body)
- end
- end
-
- context "POST /issues.xml" do
- setup do
- @issue_count = Issue.count
- @attributes = {:project_id => 1, :subject => 'API test', :tracker_id => 2, :status_id => 3}
- post '/issues.xml', {:issue => @attributes}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :created
- should_respond_with_content_type 'application/xml'
-
- should "create an issue with the attributes" do
- assert_equal Issue.count, @issue_count + 1
-
- issue = Issue.first(:order => 'id DESC')
- @attributes.each do |attribute, value|
- assert_equal value, issue.send(attribute)
- end
- end
- end
-
- context "POST /issues.xml with failure" do
- setup do
- @attributes = {:project_id => 1}
- post '/issues.xml', {:issue => @attributes}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :unprocessable_entity
- should_respond_with_content_type 'application/xml'
-
- should "have an errors tag" do
- assert_tag :errors, :child => {:tag => 'error', :content => "Subject can't be blank"}
- end
- end
-
- context "POST /issues.json" do
- setup do
- @issue_count = Issue.count
- @attributes = {:project_id => 1, :subject => 'API test', :tracker_id => 2, :status_id => 3}
- post '/issues.json', {:issue => @attributes}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :created
- should_respond_with_content_type 'application/json'
-
- should "create an issue with the attributes" do
- assert_equal Issue.count, @issue_count + 1
-
- issue = Issue.first(:order => 'id DESC')
- @attributes.each do |attribute, value|
- assert_equal value, issue.send(attribute)
- end
- end
- end
-
- context "POST /issues.json with failure" do
- setup do
- @attributes = {:project_id => 1}
- post '/issues.json', {:issue => @attributes}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :unprocessable_entity
- should_respond_with_content_type 'application/json'
-
- should "have an errors element" do
- json = ActiveSupport::JSON.decode(response.body)
- assert_equal "can't be blank", json.first['subject']
- end
- end
-
- context "PUT /issues/1.xml" do
- setup do
- @issue_count = Issue.count
- @journal_count = Journal.count
- @attributes = {:subject => 'API update', :notes => 'A new note'}
-
- put '/issues/1.xml', {:issue => @attributes}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :ok
- should_respond_with_content_type 'application/xml'
-
- should "not create a new issue" do
- assert_equal Issue.count, @issue_count
- end
-
- should "create a new journal" do
- assert_equal Journal.count, @journal_count + 1
- end
-
- should "add the note to the journal" do
- journal = Journal.last
- assert_equal "A new note", journal.notes
- end
-
- should "update the issue" do
- issue = Issue.find(1)
- @attributes.each do |attribute, value|
- assert_equal value, issue.send(attribute) unless attribute == :notes
- end
- end
-
- end
-
- context "PUT /issues/1.xml with failed update" do
- setup do
- @attributes = {:subject => ''}
- @issue_count = Issue.count
- @journal_count = Journal.count
-
- put '/issues/1.xml', {:issue => @attributes}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :unprocessable_entity
- should_respond_with_content_type 'application/xml'
-
- should "not create a new issue" do
- assert_equal Issue.count, @issue_count
- end
-
- should "not create a new journal" do
- assert_equal Journal.count, @journal_count
- end
-
- should "have an errors tag" do
- assert_tag :errors, :child => {:tag => 'error', :content => "Subject can't be blank"}
- end
- end
-
- context "PUT /issues/1.json" do
- setup do
- @issue_count = Issue.count
- @journal_count = Journal.count
- @attributes = {:subject => 'API update', :notes => 'A new note'}
-
- put '/issues/1.json', {:issue => @attributes}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :ok
- should_respond_with_content_type 'application/json'
-
- should "not create a new issue" do
- assert_equal Issue.count, @issue_count
- end
-
- should "create a new journal" do
- assert_equal Journal.count, @journal_count + 1
- end
-
- should "add the note to the journal" do
- journal = Journal.last
- assert_equal "A new note", journal.notes
- end
-
- should "update the issue" do
- issue = Issue.find(1)
- @attributes.each do |attribute, value|
- assert_equal value, issue.send(attribute) unless attribute == :notes
- end
- end
-
- end
-
- context "PUT /issues/1.json with failed update" do
- setup do
- @attributes = {:subject => ''}
- @issue_count = Issue.count
- @journal_count = Journal.count
-
- put '/issues/1.json', {:issue => @attributes}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :unprocessable_entity
- should_respond_with_content_type 'application/json'
-
- should "not create a new issue" do
- assert_equal Issue.count, @issue_count
- end
-
- should "not create a new journal" do
- assert_equal Journal.count, @journal_count
- end
-
- should "have an errors attribute" do
- json = ActiveSupport::JSON.decode(response.body)
- assert_equal "can't be blank", json.first['subject']
- end
- end
-
- context "DELETE /issues/1.xml" do
- setup do
- @issue_count = Issue.count
- delete '/issues/1.xml', {}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :ok
- should_respond_with_content_type 'application/xml'
-
- should "delete the issue" do
- assert_equal Issue.count, @issue_count -1
- assert_nil Issue.find_by_id(1)
- end
- end
-
- context "DELETE /issues/1.json" do
- setup do
- @issue_count = Issue.count
- delete '/issues/1.json', {}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :ok
- should_respond_with_content_type 'application/json'
-
- should "delete the issue" do
- assert_equal Issue.count, @issue_count -1
- assert_nil Issue.find_by_id(1)
- end
- end
-
- def credentials(user, password=nil)
- ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user)
- end
-end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/.svn/text-base/issues_test.rb.svn-base
--- a/test/integration/.svn/text-base/issues_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/integration/.svn/text-base/issues_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -72,7 +72,7 @@
put 'issues/1',
:notes => 'Some notes',
:attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'This is an attachment'}}
- assert_redirected_to "issues/1"
+ assert_redirected_to "/issues/1"
# make sure attachment was saved
attachment = Issue.find(1).attachments.find_by_filename("testfile.txt")
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/.svn/text-base/projects_api_test.rb.svn-base
--- a/test/integration/.svn/text-base/projects_api_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-# Redmine - project management software
-# Copyright (C) 2006-2010 Jean-Philippe Lang
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-require "#{File.dirname(__FILE__)}/../test_helper"
-
-class ProjectsApiTest < ActionController::IntegrationTest
- fixtures :projects, :versions, :users, :roles, :members, :member_roles, :issues, :journals, :journal_details,
- :trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations, :boards, :messages,
- :attachments, :custom_fields, :custom_values, :time_entries
-
- def setup
- Setting.rest_api_enabled = '1'
- end
-
- def test_index
- get '/projects.xml'
- assert_response :success
- assert_equal 'application/xml', @response.content_type
- end
-
- def test_show
- get '/projects/1.xml'
- assert_response :success
- assert_equal 'application/xml', @response.content_type
- end
-
- def test_create
- attributes = {:name => 'API test', :identifier => 'api-test'}
- assert_difference 'Project.count' do
- post '/projects.xml', {:project => attributes}, :authorization => credentials('admin')
- end
- assert_response :created
- assert_equal 'application/xml', @response.content_type
- project = Project.first(:order => 'id DESC')
- attributes.each do |attribute, value|
- assert_equal value, project.send(attribute)
- end
- end
-
- def test_create_failure
- attributes = {:name => 'API test'}
- assert_no_difference 'Project.count' do
- post '/projects.xml', {:project => attributes}, :authorization => credentials('admin')
- end
- assert_response :unprocessable_entity
- assert_equal 'application/xml', @response.content_type
- assert_tag :errors, :child => {:tag => 'error', :content => "Identifier can't be blank"}
- end
-
- def test_update
- attributes = {:name => 'API update'}
- assert_no_difference 'Project.count' do
- put '/projects/1.xml', {:project => attributes}, :authorization => credentials('jsmith')
- end
- assert_response :ok
- assert_equal 'application/xml', @response.content_type
- project = Project.find(1)
- attributes.each do |attribute, value|
- assert_equal value, project.send(attribute)
- end
- end
-
- def test_update_failure
- attributes = {:name => ''}
- assert_no_difference 'Project.count' do
- put '/projects/1.xml', {:project => attributes}, :authorization => credentials('jsmith')
- end
- assert_response :unprocessable_entity
- assert_equal 'application/xml', @response.content_type
- assert_tag :errors, :child => {:tag => 'error', :content => "Name can't be blank"}
- end
-
- def test_destroy
- assert_difference 'Project.count', -1 do
- delete '/projects/2.xml', {}, :authorization => credentials('admin')
- end
- assert_response :ok
- assert_equal 'application/xml', @response.content_type
- assert_nil Project.find_by_id(2)
- end
-
- def credentials(user, password=nil)
- ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user)
- end
-end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/.svn/text-base/projects_test.rb.svn-base
--- a/test/integration/.svn/text-base/projects_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/integration/.svn/text-base/projects_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -27,7 +27,7 @@
assert_response :success
assert_template "admin/projects"
post "projects/archive", :id => 1
- assert_redirected_to "admin/projects"
+ assert_redirected_to "/admin/projects"
assert !Project.find(1).active?
get 'projects/1'
@@ -36,7 +36,7 @@
assert_response 403
post "projects/unarchive", :id => 1
- assert_redirected_to "admin/projects"
+ assert_redirected_to "/admin/projects"
assert Project.find(1).active?
get "projects/1"
assert_response :success
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/.svn/text-base/routing_test.rb.svn-base
--- a/test/integration/.svn/text-base/routing_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/integration/.svn/text-base/routing_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -157,13 +157,14 @@
should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567'
should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234'
should_route :get, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567'
+ should_route :get, "/news/preview", :controller => 'previews', :action => 'news'
+
+ should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567'
+ should_route :post, "/news/567/comments", :controller => 'comments', :action => 'create', :id => '567'
- should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567'
- should_route :post, "/news/567/destroy", :controller => 'news', :action => 'destroy', :id => '567'
- should_route :post, "/news/567/comments", :controller => 'comments', :action => 'create', :id => '567'
-
- should_route :put, "/news/567/edit", :controller => 'news', :action => 'update', :id => '567'
+ should_route :put, "/news/567", :controller => 'news', :action => 'update', :id => '567'
+ should_route :delete, "/news/567", :controller => 'news', :action => 'destroy', :id => '567'
should_route :delete, "/news/567/comments/15", :controller => 'comments', :action => 'destroy', :id => '567', :comment_id => '15'
end
@@ -220,40 +221,81 @@
should_route :post, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
end
- context "timelogs" do
- should_route :get, "/issues/567/time_entries/new", :controller => 'timelog', :action => 'edit', :issue_id => '567'
- should_route :get, "/projects/ecookbook/time_entries/new", :controller => 'timelog', :action => 'edit', :project_id => 'ecookbook'
- should_route :get, "/projects/ecookbook/issues/567/time_entries/new", :controller => 'timelog', :action => 'edit', :project_id => 'ecookbook', :issue_id => '567'
+ context "timelogs (global)" do
+ should_route :get, "/time_entries", :controller => 'timelog', :action => 'index'
+ should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'index', :format => 'csv'
+ should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'index', :format => 'atom'
+ should_route :get, "/time_entries/new", :controller => 'timelog', :action => 'new'
should_route :get, "/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22'
- should_route :get, "/time_entries/report", :controller => 'timelog', :action => 'report'
- should_route :get, "/projects/567/time_entries/report", :controller => 'timelog', :action => 'report', :project_id => '567'
- should_route :get, "/projects/567/time_entries/report.csv", :controller => 'timelog', :action => 'report', :project_id => '567', :format => 'csv'
- should_route :get, "/time_entries", :controller => 'timelog', :action => 'details'
- should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'details', :format => 'csv'
- should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'details', :format => 'atom'
- should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'details', :project_id => '567'
- should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'details', :project_id => '567', :format => 'csv'
- should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'details', :project_id => '567', :format => 'atom'
- should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'details', :issue_id => '234'
- should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'details', :issue_id => '234', :format => 'csv'
- should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'details', :issue_id => '234', :format => 'atom'
- should_route :get, "/projects/ecookbook/issues/123/time_entries", :controller => 'timelog', :action => 'details', :project_id => 'ecookbook', :issue_id => '123'
- should_route :post, "/time_entries/55/destroy", :controller => 'timelog', :action => 'destroy', :id => '55'
+ should_route :post, "/time_entries", :controller => 'timelog', :action => 'create'
+
+ should_route :put, "/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22'
+
+ should_route :delete, "/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55'
+ end
+
+ context "timelogs (scoped under project)" do
+ should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'index', :project_id => '567'
+ should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'csv'
+ should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'atom'
+ should_route :get, "/projects/567/time_entries/new", :controller => 'timelog', :action => 'new', :project_id => '567'
+ should_route :get, "/projects/567/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :project_id => '567'
+
+ should_route :post, "/projects/567/time_entries", :controller => 'timelog', :action => 'create', :project_id => '567'
+
+ should_route :put, "/projects/567/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :project_id => '567'
+
+ should_route :delete, "/projects/567/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :project_id => '567'
+ end
+
+ context "timelogs (scoped under issues)" do
+ should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234'
+ should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'csv'
+ should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'atom'
+ should_route :get, "/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234'
+ should_route :get, "/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234'
+
+ should_route :post, "/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234'
+
+ should_route :put, "/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234'
+
+ should_route :delete, "/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234'
+ end
+
+ context "timelogs (scoped under project and issues)" do
+ should_route :get, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook'
+ should_route :get, "/projects/ecookbook/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'csv'
+ should_route :get, "/projects/ecookbook/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'atom'
+ should_route :get, "/projects/ecookbook/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234', :project_id => 'ecookbook'
+ should_route :get, "/projects/ecookbook/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
+
+ should_route :post, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234', :project_id => 'ecookbook'
+
+ should_route :put, "/projects/ecookbook/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
+
+ should_route :delete, "/projects/ecookbook/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234', :project_id => 'ecookbook'
+ end
+
+ context "time_entry_reports" do
+ should_route :get, "/time_entries/report", :controller => 'time_entry_reports', :action => 'report'
+ should_route :get, "/projects/567/time_entries/report", :controller => 'time_entry_reports', :action => 'report', :project_id => '567'
+ should_route :get, "/projects/567/time_entries/report.csv", :controller => 'time_entry_reports', :action => 'report', :project_id => '567', :format => 'csv'
end
context "users" do
should_route :get, "/users", :controller => 'users', :action => 'index'
should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44'
- should_route :get, "/users/new", :controller => 'users', :action => 'add'
+ should_route :get, "/users/new", :controller => 'users', :action => 'new'
should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444'
should_route :get, "/users/222/edit/membership", :controller => 'users', :action => 'edit', :id => '222', :tab => 'membership'
- should_route :post, "/users/new", :controller => 'users', :action => 'add'
- should_route :post, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444'
+ should_route :post, "/users", :controller => 'users', :action => 'create'
should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123'
should_route :post, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55'
should_route :post, "/users/567/memberships/12/destroy", :controller => 'users', :action => 'destroy_membership', :id => '567', :membership_id => '12'
+
+ should_route :put, "/users/444", :controller => 'users', :action => 'update', :id => '444'
end
# TODO: should they all be scoped under /projects/:project_id ?
@@ -269,23 +311,27 @@
end
context "wiki (singular, project's pages)" do
- should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'index', :id => '567'
- should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'index', :id => '567', :page => 'lalala'
- should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :id => '567', :page => 'my_page'
- should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :id => '1', :page => 'CookBook_documentation'
- should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2/vs/1", :controller => 'wiki', :action => 'diff', :id => '1', :page => 'CookBook_documentation', :version => '2', :version_from => '1'
- should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :id => '1', :page => 'CookBook_documentation', :version => '2'
- should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :id => '22', :page => 'ladida'
- should_route :get, "/projects/567/wiki/page_index", :controller => 'wiki', :action => 'special', :id => '567', :page => 'page_index'
- should_route :get, "/projects/567/wiki/Page_Index", :controller => 'wiki', :action => 'special', :id => '567', :page => 'Page_Index'
- should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'special', :id => '567', :page => 'date_index'
- should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'special', :id => '567', :page => 'export'
+ should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'show', :project_id => '567'
+ should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'show', :project_id => '567', :id => 'lalala'
+ should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :project_id => '567', :id => 'my_page'
+ should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :project_id => '1', :id => 'CookBook_documentation'
+ should_route :get, "/projects/1/wiki/CookBook_documentation/diff", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation'
+ should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2'
+ should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2/vs/1", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2', :version_from => '1'
+ should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :project_id => '1', :id => 'CookBook_documentation', :version => '2'
+ should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida'
+ should_route :get, "/projects/567/wiki/index", :controller => 'wiki', :action => 'index', :project_id => '567'
+ should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'date_index', :project_id => '567'
+ should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'export', :project_id => '567'
- should_route :post, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :id => '567', :page => 'my_page'
- should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :id => '567', :page => 'CookBook_documentation'
- should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :id => '22', :page => 'ladida'
- should_route :post, "/projects/22/wiki/ladida/destroy", :controller => 'wiki', :action => 'destroy', :id => '22', :page => 'ladida'
- should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :id => '22', :page => 'ladida'
+ should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :project_id => '567', :id => 'CookBook_documentation'
+ should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida'
+ should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :project_id => '22', :id => 'ladida'
+ should_route :post, "/projects/22/wiki/ladida/add_attachment", :controller => 'wiki', :action => 'add_attachment', :project_id => '22', :id => 'ladida'
+
+ should_route :put, "/projects/567/wiki/my_page", :controller => 'wiki', :action => 'update', :project_id => '567', :id => 'my_page'
+
+ should_route :delete, "/projects/22/wiki/ladida", :controller => 'wiki', :action => 'destroy', :project_id => '22', :id => 'ladida'
end
context "wikis (plural, admin setup)" do
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/account_test.rb
--- a/test/integration/account_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/integration/account_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -44,7 +44,7 @@
# User logs in with 'autologin' checked
post '/login', :username => user.login, :password => 'admin', :autologin => 1
- assert_redirected_to 'my/page'
+ assert_redirected_to '/my/page'
token = Token.find :first
assert_not_nil token
assert_equal user, token.user
@@ -105,7 +105,7 @@
post 'account/register', :user => {:login => "newuser", :language => "en", :firstname => "New", :lastname => "User", :mail => "newuser@foo.bar"},
:password => "newpass", :password_confirmation => "newpass"
- assert_redirected_to 'my/account'
+ assert_redirected_to '/my/account'
follow_redirect!
assert_response :success
assert_template 'my/account'
@@ -152,7 +152,7 @@
AuthSource.expects(:authenticate).returns({:login => 'foo', :firstname => 'Foo', :lastname => 'Smith', :mail => 'foo@bar.com', :auth_source_id => 66})
post 'account/login', :username => 'foo', :password => 'bar'
- assert_redirected_to 'my/page'
+ assert_redirected_to '/my/page'
user = User.find_by_login('foo')
assert user.is_a?(User)
@@ -187,7 +187,7 @@
sid = session[:session_id]
post '/login', :username => 'admin', :password => 'admin'
- assert_redirected_to 'my/page'
+ assert_redirected_to '/my/page'
assert_not_equal sid, session[:session_id], "login should reset session"
assert_equal 1, session[:user_id]
sid = session[:session_id]
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/admin_test.rb
--- a/test/integration/admin_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/integration/admin_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -22,10 +22,10 @@
def test_add_user
log_user("admin", "admin")
- get "/users/add"
+ get "/users/new"
assert_response :success
- assert_template "users/add"
- post "/users/add", :user => { :login => "psmith", :firstname => "Paul", :lastname => "Smith", :mail => "psmith@somenet.foo", :language => "en" }, :password => "psmith09", :password_confirmation => "psmith09"
+ assert_template "users/new"
+ post "/users/create", :user => { :login => "psmith", :firstname => "Paul", :lastname => "Smith", :mail => "psmith@somenet.foo", :language => "en" }, :password => "psmith09", :password_confirmation => "psmith09"
user = User.find_by_login("psmith")
assert_kind_of User, user
@@ -35,15 +35,15 @@
assert_kind_of User, logged_user
assert_equal "Paul", logged_user.firstname
- post "users/edit", :id => user.id, :user => { :status => User::STATUS_LOCKED }
+ put "users/#{user.id}", :id => user.id, :user => { :status => User::STATUS_LOCKED }
assert_redirected_to "/users/#{ user.id }/edit"
locked_user = User.try_to_login("psmith", "psmith09")
assert_equal nil, locked_user
end
test "Add a user as an anonymous user should fail" do
- post '/users/add', :user => { :login => 'psmith', :firstname => 'Paul'}, :password => "psmith09", :password_confirmation => "psmith09"
+ post '/users/create', :user => { :login => 'psmith', :firstname => 'Paul'}, :password => "psmith09", :password_confirmation => "psmith09"
assert_response :redirect
- assert_redirected_to "/login?back_url=http%3A%2F%2Fwww.example.com%2Fusers%2Fnew"
+ assert_redirected_to "/login?back_url=http%3A%2F%2Fwww.example.com%2Fusers"
end
end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/api_test/.svn/all-wcprops
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/integration/api_test/.svn/all-wcprops Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,41 @@
+K 25
+svn:wc:ra_dav:version-url
+V 50
+/svn/!svn/ver/4397/trunk/test/integration/api_test
+END
+token_authentication_test.rb
+K 25
+svn:wc:ra_dav:version-url
+V 79
+/svn/!svn/ver/4358/trunk/test/integration/api_test/token_authentication_test.rb
+END
+http_basic_login_test.rb
+K 25
+svn:wc:ra_dav:version-url
+V 75
+/svn/!svn/ver/4360/trunk/test/integration/api_test/http_basic_login_test.rb
+END
+projects_test.rb
+K 25
+svn:wc:ra_dav:version-url
+V 67
+/svn/!svn/ver/4397/trunk/test/integration/api_test/projects_test.rb
+END
+issues_test.rb
+K 25
+svn:wc:ra_dav:version-url
+V 65
+/svn/!svn/ver/4397/trunk/test/integration/api_test/issues_test.rb
+END
+http_basic_login_with_api_token_test.rb
+K 25
+svn:wc:ra_dav:version-url
+V 90
+/svn/!svn/ver/4363/trunk/test/integration/api_test/http_basic_login_with_api_token_test.rb
+END
+disabled_rest_api_test.rb
+K 25
+svn:wc:ra_dav:version-url
+V 76
+/svn/!svn/ver/4357/trunk/test/integration/api_test/disabled_rest_api_test.rb
+END
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/api_test/.svn/entries
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/integration/api_test/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,232 @@
+10
+
+dir
+4411
+http://redmine.rubyforge.org/svn/trunk/test/integration/api_test
+http://redmine.rubyforge.org/svn
+
+
+
+2010-11-13T10:05:43.644565Z
+4397
+jplang
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+e93f8b46-1217-0410-a6f0-8f06a7374b81
+
+token_authentication_test.rb
+file
+
+
+
+
+2010-11-19T13:04:46.164708Z
+65fbddeb3566ca683746b74e4cbbcedd
+2010-11-01T15:45:03.207475Z
+4358
+edavis10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+606
+
+http_basic_login_test.rb
+file
+
+
+
+
+2010-11-19T13:04:46.164708Z
+c8145f134a31604365baa69990b0233f
+2010-11-02T15:52:06.649052Z
+4360
+edavis10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+830
+
+projects_test.rb
+file
+
+
+
+
+2010-11-19T13:04:46.164708Z
+925aa948a6a6bcf558ea5270731a93e5
+2010-11-13T10:05:43.644565Z
+4397
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4223
+
+issues_test.rb
+file
+
+
+
+
+2010-11-19T13:04:46.164708Z
+4d1156dc608214ea129768309dd61963
+2010-11-13T10:05:43.644565Z
+4397
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+11171
+
+http_basic_login_with_api_token_test.rb
+file
+
+
+
+
+2010-11-19T13:04:46.164708Z
+48bd13d41a1e011f9bdde27bc8cf034c
+2010-11-03T16:48:23.980579Z
+4363
+edavis10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+634
+
+disabled_rest_api_test.rb
+file
+
+
+
+
+2010-11-19T13:04:46.164708Z
+5294c8d805e67e246bb1535b4fe769d4
+2010-11-01T15:26:05.436106Z
+4357
+edavis10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3835
+
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/api_test/.svn/prop-base/issues_test.rb.svn-base
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/integration/api_test/.svn/prop-base/issues_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/api_test/.svn/prop-base/projects_test.rb.svn-base
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/integration/api_test/.svn/prop-base/projects_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,5 @@
+K 13
+svn:eol-style
+V 6
+native
+END
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/api_test/.svn/text-base/disabled_rest_api_test.rb.svn-base
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/integration/api_test/.svn/text-base/disabled_rest_api_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,110 @@
+require "#{File.dirname(__FILE__)}/../../test_helper"
+
+class ApiTest::DisabledRestApiTest < ActionController::IntegrationTest
+ fixtures :all
+
+ def setup
+ Setting.rest_api_enabled = '0'
+ Setting.login_required = '1'
+ end
+
+ def teardown
+ Setting.rest_api_enabled = '1'
+ Setting.login_required = '0'
+ end
+
+ # Using the NewsController because it's a simple API.
+ context "get /news with the API disabled" do
+
+ context "in :xml format" do
+ context "with a valid api token" do
+ setup do
+ @user = User.generate_with_protected!
+ @token = Token.generate!(:user => @user, :action => 'api')
+ get "/news.xml?key=#{@token.value}"
+ end
+
+ should_respond_with :unauthorized
+ should_respond_with_content_type :xml
+ should "not login as the user" do
+ assert_equal User.anonymous, User.current
+ end
+ end
+
+ context "with a valid HTTP authentication" do
+ setup do
+ @user = User.generate_with_protected!(:password => 'my_password', :password_confirmation => 'my_password')
+ @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'my_password')
+ get "/news.xml", nil, :authorization => @authorization
+ end
+
+ should_respond_with :unauthorized
+ should_respond_with_content_type :xml
+ should "not login as the user" do
+ assert_equal User.anonymous, User.current
+ end
+ end
+
+ context "with a valid HTTP authentication using the API token" do
+ setup do
+ @user = User.generate_with_protected!
+ @token = Token.generate!(:user => @user, :action => 'api')
+ @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'X')
+ get "/news.xml", nil, :authorization => @authorization
+ end
+
+ should_respond_with :unauthorized
+ should_respond_with_content_type :xml
+ should "not login as the user" do
+ assert_equal User.anonymous, User.current
+ end
+ end
+ end
+
+ context "in :json format" do
+ context "with a valid api token" do
+ setup do
+ @user = User.generate_with_protected!
+ @token = Token.generate!(:user => @user, :action => 'api')
+ get "/news.json?key=#{@token.value}"
+ end
+
+ should_respond_with :unauthorized
+ should_respond_with_content_type :json
+ should "not login as the user" do
+ assert_equal User.anonymous, User.current
+ end
+ end
+
+ context "with a valid HTTP authentication" do
+ setup do
+ @user = User.generate_with_protected!(:password => 'my_password', :password_confirmation => 'my_password')
+ @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'my_password')
+ get "/news.json", nil, :authorization => @authorization
+ end
+
+ should_respond_with :unauthorized
+ should_respond_with_content_type :json
+ should "not login as the user" do
+ assert_equal User.anonymous, User.current
+ end
+ end
+
+ context "with a valid HTTP authentication using the API token" do
+ setup do
+ @user = User.generate_with_protected!
+ @token = Token.generate!(:user => @user, :action => 'api')
+ @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'DoesNotMatter')
+ get "/news.json", nil, :authorization => @authorization
+ end
+
+ should_respond_with :unauthorized
+ should_respond_with_content_type :json
+ should "not login as the user" do
+ assert_equal User.anonymous, User.current
+ end
+ end
+
+ end
+ end
+end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/api_test/.svn/text-base/http_basic_login_test.rb.svn-base
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/integration/api_test/.svn/text-base/http_basic_login_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,31 @@
+require "#{File.dirname(__FILE__)}/../../test_helper"
+
+class ApiTest::HttpBasicLoginTest < ActionController::IntegrationTest
+ fixtures :all
+
+ def setup
+ Setting.rest_api_enabled = '1'
+ Setting.login_required = '1'
+ end
+
+ def teardown
+ Setting.rest_api_enabled = '0'
+ Setting.login_required = '0'
+ end
+
+ # Using the NewsController because it's a simple API.
+ context "get /news" do
+ setup do
+ project = Project.find('onlinestore')
+ EnabledModule.create(:project => project, :name => 'news')
+ end
+
+ context "in :xml format" do
+ should_allow_http_basic_auth_with_username_and_password(:get, "/projects/onlinestore/news.xml")
+ end
+
+ context "in :json format" do
+ should_allow_http_basic_auth_with_username_and_password(:get, "/projects/onlinestore/news.json")
+ end
+ end
+end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/api_test/.svn/text-base/http_basic_login_with_api_token_test.rb.svn-base
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/integration/api_test/.svn/text-base/http_basic_login_with_api_token_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,27 @@
+require "#{File.dirname(__FILE__)}/../../test_helper"
+
+class ApiTest::HttpBasicLoginWithApiTokenTest < ActionController::IntegrationTest
+ fixtures :all
+
+ def setup
+ Setting.rest_api_enabled = '1'
+ Setting.login_required = '1'
+ end
+
+ def teardown
+ Setting.rest_api_enabled = '0'
+ Setting.login_required = '0'
+ end
+
+ # Using the NewsController because it's a simple API.
+ context "get /news" do
+
+ context "in :xml format" do
+ should_allow_http_basic_auth_with_key(:get, "/news.xml")
+ end
+
+ context "in :json format" do
+ should_allow_http_basic_auth_with_key(:get, "/news.json")
+ end
+ end
+end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/api_test/.svn/text-base/issues_test.rb.svn-base
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/integration/api_test/.svn/text-base/issues_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,340 @@
+# Redmine - project management software
+# Copyright (C) 2006-2010 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+require "#{File.dirname(__FILE__)}/../../test_helper"
+
+class ApiTest::IssuesTest < ActionController::IntegrationTest
+ fixtures :projects,
+ :users,
+ :roles,
+ :members,
+ :member_roles,
+ :issues,
+ :issue_statuses,
+ :versions,
+ :trackers,
+ :projects_trackers,
+ :issue_categories,
+ :enabled_modules,
+ :enumerations,
+ :attachments,
+ :workflows,
+ :custom_fields,
+ :custom_values,
+ :custom_fields_projects,
+ :custom_fields_trackers,
+ :time_entries,
+ :journals,
+ :journal_details,
+ :queries
+
+ def setup
+ Setting.rest_api_enabled = '1'
+ end
+
+ # Use a private project to make sure auth is really working and not just
+ # only showing public issues.
+ context "/index.xml" do
+ should_allow_api_authentication(:get, "/projects/private-child/issues.xml")
+ end
+
+ context "/index.json" do
+ should_allow_api_authentication(:get, "/projects/private-child/issues.json")
+ end
+
+ context "/index.xml with filter" do
+ should_allow_api_authentication(:get, "/projects/private-child/issues.xml?status_id=5")
+
+ should "show only issues with the status_id" do
+ get '/issues.xml?status_id=5'
+ assert_tag :tag => 'issues',
+ :children => { :count => Issue.visible.count(:conditions => {:status_id => 5}),
+ :only => { :tag => 'issue' } }
+ end
+ end
+
+ context "/index.json with filter" do
+ should_allow_api_authentication(:get, "/projects/private-child/issues.json?status_id=5")
+
+ should "show only issues with the status_id" do
+ get '/issues.json?status_id=5'
+
+ json = ActiveSupport::JSON.decode(response.body)
+ status_ids_used = json.collect {|j| j['status_id'] }
+ assert_equal 3, status_ids_used.length
+ assert status_ids_used.all? {|id| id == 5 }
+ end
+
+ end
+
+ # Issue 6 is on a private project
+ context "/issues/6.xml" do
+ should_allow_api_authentication(:get, "/issues/6.xml")
+ end
+
+ context "/issues/6.json" do
+ should_allow_api_authentication(:get, "/issues/6.json")
+ end
+
+ context "POST /issues.xml" do
+ should_allow_api_authentication(:post,
+ '/issues.xml',
+ {:issue => {:project_id => 1, :subject => 'API test', :tracker_id => 2, :status_id => 3}},
+ {:success_code => :created})
+
+ should "create an issue with the attributes" do
+ assert_difference('Issue.count') do
+ post '/issues.xml', {:issue => {:project_id => 1, :subject => 'API test', :tracker_id => 2, :status_id => 3}}, :authorization => credentials('jsmith')
+ end
+
+ issue = Issue.first(:order => 'id DESC')
+ assert_equal 1, issue.project_id
+ assert_equal 2, issue.tracker_id
+ assert_equal 3, issue.status_id
+ assert_equal 'API test', issue.subject
+
+ assert_response :created
+ assert_equal 'application/xml', @response.content_type
+ assert_tag 'issue', :child => {:tag => 'id', :content => issue.id.to_s}
+ end
+ end
+
+ context "POST /issues.xml with failure" do
+ should_allow_api_authentication(:post,
+ '/issues.xml',
+ {:issue => {:project_id => 1}},
+ {:success_code => :unprocessable_entity})
+
+ should "have an errors tag" do
+ assert_no_difference('Issue.count') do
+ post '/issues.xml', {:issue => {:project_id => 1}}, :authorization => credentials('jsmith')
+ end
+
+ assert_tag :errors, :child => {:tag => 'error', :content => "Subject can't be blank"}
+ end
+ end
+
+ context "POST /issues.json" do
+ should_allow_api_authentication(:post,
+ '/issues.json',
+ {:issue => {:project_id => 1, :subject => 'API test', :tracker_id => 2, :status_id => 3}},
+ {:success_code => :created})
+
+ should "create an issue with the attributes" do
+ assert_difference('Issue.count') do
+ post '/issues.json', {:issue => {:project_id => 1, :subject => 'API test', :tracker_id => 2, :status_id => 3}}, :authorization => credentials('jsmith')
+ end
+
+ issue = Issue.first(:order => 'id DESC')
+ assert_equal 1, issue.project_id
+ assert_equal 2, issue.tracker_id
+ assert_equal 3, issue.status_id
+ assert_equal 'API test', issue.subject
+ end
+
+ end
+
+ context "POST /issues.json with failure" do
+ should_allow_api_authentication(:post,
+ '/issues.json',
+ {:issue => {:project_id => 1}},
+ {:success_code => :unprocessable_entity})
+
+ should "have an errors element" do
+ assert_no_difference('Issue.count') do
+ post '/issues.json', {:issue => {:project_id => 1}}, :authorization => credentials('jsmith')
+ end
+
+ json = ActiveSupport::JSON.decode(response.body)
+ assert_equal "can't be blank", json.first['subject']
+ end
+ end
+
+ # Issue 6 is on a private project
+ context "PUT /issues/6.xml" do
+ setup do
+ @parameters = {:issue => {:subject => 'API update', :notes => 'A new note'}}
+ @headers = { :authorization => credentials('jsmith') }
+ end
+
+ should_allow_api_authentication(:put,
+ '/issues/6.xml',
+ {:issue => {:subject => 'API update', :notes => 'A new note'}},
+ {:success_code => :ok})
+
+ should "not create a new issue" do
+ assert_no_difference('Issue.count') do
+ put '/issues/6.xml', @parameters, @headers
+ end
+ end
+
+ should "create a new journal" do
+ assert_difference('Journal.count') do
+ put '/issues/6.xml', @parameters, @headers
+ end
+ end
+
+ should "add the note to the journal" do
+ put '/issues/6.xml', @parameters, @headers
+
+ journal = Journal.last
+ assert_equal "A new note", journal.notes
+ end
+
+ should "update the issue" do
+ put '/issues/6.xml', @parameters, @headers
+
+ issue = Issue.find(6)
+ assert_equal "API update", issue.subject
+ end
+
+ end
+
+ context "PUT /issues/6.xml with failed update" do
+ setup do
+ @parameters = {:issue => {:subject => ''}}
+ @headers = { :authorization => credentials('jsmith') }
+ end
+
+ should_allow_api_authentication(:put,
+ '/issues/6.xml',
+ {:issue => {:subject => ''}}, # Missing subject should fail
+ {:success_code => :unprocessable_entity})
+
+ should "not create a new issue" do
+ assert_no_difference('Issue.count') do
+ put '/issues/6.xml', @parameters, @headers
+ end
+ end
+
+ should "not create a new journal" do
+ assert_no_difference('Journal.count') do
+ put '/issues/6.xml', @parameters, @headers
+ end
+ end
+
+ should "have an errors tag" do
+ put '/issues/6.xml', @parameters, @headers
+
+ assert_tag :errors, :child => {:tag => 'error', :content => "Subject can't be blank"}
+ end
+ end
+
+ context "PUT /issues/6.json" do
+ setup do
+ @parameters = {:issue => {:subject => 'API update', :notes => 'A new note'}}
+ @headers = { :authorization => credentials('jsmith') }
+ end
+
+ should_allow_api_authentication(:put,
+ '/issues/6.json',
+ {:issue => {:subject => 'API update', :notes => 'A new note'}},
+ {:success_code => :ok})
+
+ should "not create a new issue" do
+ assert_no_difference('Issue.count') do
+ put '/issues/6.json', @parameters, @headers
+ end
+ end
+
+ should "create a new journal" do
+ assert_difference('Journal.count') do
+ put '/issues/6.json', @parameters, @headers
+ end
+ end
+
+ should "add the note to the journal" do
+ put '/issues/6.json', @parameters, @headers
+
+ journal = Journal.last
+ assert_equal "A new note", journal.notes
+ end
+
+ should "update the issue" do
+ put '/issues/6.json', @parameters, @headers
+
+ issue = Issue.find(6)
+ assert_equal "API update", issue.subject
+ end
+
+ end
+
+ context "PUT /issues/6.json with failed update" do
+ setup do
+ @parameters = {:issue => {:subject => ''}}
+ @headers = { :authorization => credentials('jsmith') }
+ end
+
+ should_allow_api_authentication(:put,
+ '/issues/6.json',
+ {:issue => {:subject => ''}}, # Missing subject should fail
+ {:success_code => :unprocessable_entity})
+
+ should "not create a new issue" do
+ assert_no_difference('Issue.count') do
+ put '/issues/6.json', @parameters, @headers
+ end
+ end
+
+ should "not create a new journal" do
+ assert_no_difference('Journal.count') do
+ put '/issues/6.json', @parameters, @headers
+ end
+ end
+
+ should "have an errors attribute" do
+ put '/issues/6.json', @parameters, @headers
+
+ json = ActiveSupport::JSON.decode(response.body)
+ assert_equal "can't be blank", json.first['subject']
+ end
+ end
+
+ context "DELETE /issues/1.xml" do
+ should_allow_api_authentication(:delete,
+ '/issues/6.xml',
+ {},
+ {:success_code => :ok})
+
+ should "delete the issue" do
+ assert_difference('Issue.count',-1) do
+ delete '/issues/6.xml', {}, :authorization => credentials('jsmith')
+ end
+
+ assert_nil Issue.find_by_id(6)
+ end
+ end
+
+ context "DELETE /issues/1.json" do
+ should_allow_api_authentication(:delete,
+ '/issues/6.json',
+ {},
+ {:success_code => :ok})
+
+ should "delete the issue" do
+ assert_difference('Issue.count',-1) do
+ delete '/issues/6.json', {}, :authorization => credentials('jsmith')
+ end
+
+ assert_nil Issue.find_by_id(6)
+ end
+ end
+
+ def credentials(user, password=nil)
+ ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user)
+ end
+end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/api_test/.svn/text-base/projects_test.rb.svn-base
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/integration/api_test/.svn/text-base/projects_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,111 @@
+# Redmine - project management software
+# Copyright (C) 2006-2010 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+require "#{File.dirname(__FILE__)}/../../test_helper"
+
+class ApiTest::ProjectsTest < ActionController::IntegrationTest
+ fixtures :projects, :versions, :users, :roles, :members, :member_roles, :issues, :journals, :journal_details,
+ :trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations, :boards, :messages,
+ :attachments, :custom_fields, :custom_values, :time_entries
+
+ def setup
+ Setting.rest_api_enabled = '1'
+ end
+
+ def test_index
+ get '/projects.xml'
+ assert_response :success
+ assert_equal 'application/xml', @response.content_type
+ end
+
+ def test_show
+ get '/projects/1.xml'
+ assert_response :success
+ assert_equal 'application/xml', @response.content_type
+ assert_tag 'custom_field', :attributes => {:name => 'Development status'}, :content => 'Stable'
+ end
+
+ def test_show_should_not_display_hidden_custom_fields
+ ProjectCustomField.find_by_name('Development status').update_attribute :visible, false
+ get '/projects/1.xml'
+ assert_response :success
+ assert_equal 'application/xml', @response.content_type
+ assert_no_tag 'custom_field', :attributes => {:name => 'Development status'}
+ end
+
+ def test_create
+ attributes = {:name => 'API test', :identifier => 'api-test'}
+ assert_difference 'Project.count' do
+ post '/projects.xml', {:project => attributes}, :authorization => credentials('admin')
+ end
+
+ project = Project.first(:order => 'id DESC')
+ attributes.each do |attribute, value|
+ assert_equal value, project.send(attribute)
+ end
+
+ assert_response :created
+ assert_equal 'application/xml', @response.content_type
+ assert_tag 'project', :child => {:tag => 'id', :content => project.id.to_s}
+ end
+
+ def test_create_failure
+ attributes = {:name => 'API test'}
+ assert_no_difference 'Project.count' do
+ post '/projects.xml', {:project => attributes}, :authorization => credentials('admin')
+ end
+ assert_response :unprocessable_entity
+ assert_equal 'application/xml', @response.content_type
+ assert_tag :errors, :child => {:tag => 'error', :content => "Identifier can't be blank"}
+ end
+
+ def test_update
+ attributes = {:name => 'API update'}
+ assert_no_difference 'Project.count' do
+ put '/projects/1.xml', {:project => attributes}, :authorization => credentials('jsmith')
+ end
+ assert_response :ok
+ assert_equal 'application/xml', @response.content_type
+ project = Project.find(1)
+ attributes.each do |attribute, value|
+ assert_equal value, project.send(attribute)
+ end
+ end
+
+ def test_update_failure
+ attributes = {:name => ''}
+ assert_no_difference 'Project.count' do
+ put '/projects/1.xml', {:project => attributes}, :authorization => credentials('jsmith')
+ end
+ assert_response :unprocessable_entity
+ assert_equal 'application/xml', @response.content_type
+ assert_tag :errors, :child => {:tag => 'error', :content => "Name can't be blank"}
+ end
+
+ def test_destroy
+ assert_difference 'Project.count', -1 do
+ delete '/projects/2.xml', {}, :authorization => credentials('admin')
+ end
+ assert_response :ok
+ assert_equal 'application/xml', @response.content_type
+ assert_nil Project.find_by_id(2)
+ end
+
+ def credentials(user, password=nil)
+ ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user)
+ end
+end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/api_test/.svn/text-base/token_authentication_test.rb.svn-base
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/integration/api_test/.svn/text-base/token_authentication_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,26 @@
+require "#{File.dirname(__FILE__)}/../../test_helper"
+
+class ApiTest::TokenAuthenticationTest < ActionController::IntegrationTest
+ fixtures :all
+
+ def setup
+ Setting.rest_api_enabled = '1'
+ Setting.login_required = '1'
+ end
+
+ def teardown
+ Setting.rest_api_enabled = '0'
+ Setting.login_required = '0'
+ end
+
+ # Using the NewsController because it's a simple API.
+ context "get /news" do
+ context "in :xml format" do
+ should_allow_key_based_auth(:get, "/news.xml")
+ end
+
+ context "in :json format" do
+ should_allow_key_based_auth(:get, "/news.json")
+ end
+ end
+end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/api_test/disabled_rest_api_test.rb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/integration/api_test/disabled_rest_api_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,110 @@
+require "#{File.dirname(__FILE__)}/../../test_helper"
+
+class ApiTest::DisabledRestApiTest < ActionController::IntegrationTest
+ fixtures :all
+
+ def setup
+ Setting.rest_api_enabled = '0'
+ Setting.login_required = '1'
+ end
+
+ def teardown
+ Setting.rest_api_enabled = '1'
+ Setting.login_required = '0'
+ end
+
+ # Using the NewsController because it's a simple API.
+ context "get /news with the API disabled" do
+
+ context "in :xml format" do
+ context "with a valid api token" do
+ setup do
+ @user = User.generate_with_protected!
+ @token = Token.generate!(:user => @user, :action => 'api')
+ get "/news.xml?key=#{@token.value}"
+ end
+
+ should_respond_with :unauthorized
+ should_respond_with_content_type :xml
+ should "not login as the user" do
+ assert_equal User.anonymous, User.current
+ end
+ end
+
+ context "with a valid HTTP authentication" do
+ setup do
+ @user = User.generate_with_protected!(:password => 'my_password', :password_confirmation => 'my_password')
+ @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'my_password')
+ get "/news.xml", nil, :authorization => @authorization
+ end
+
+ should_respond_with :unauthorized
+ should_respond_with_content_type :xml
+ should "not login as the user" do
+ assert_equal User.anonymous, User.current
+ end
+ end
+
+ context "with a valid HTTP authentication using the API token" do
+ setup do
+ @user = User.generate_with_protected!
+ @token = Token.generate!(:user => @user, :action => 'api')
+ @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'X')
+ get "/news.xml", nil, :authorization => @authorization
+ end
+
+ should_respond_with :unauthorized
+ should_respond_with_content_type :xml
+ should "not login as the user" do
+ assert_equal User.anonymous, User.current
+ end
+ end
+ end
+
+ context "in :json format" do
+ context "with a valid api token" do
+ setup do
+ @user = User.generate_with_protected!
+ @token = Token.generate!(:user => @user, :action => 'api')
+ get "/news.json?key=#{@token.value}"
+ end
+
+ should_respond_with :unauthorized
+ should_respond_with_content_type :json
+ should "not login as the user" do
+ assert_equal User.anonymous, User.current
+ end
+ end
+
+ context "with a valid HTTP authentication" do
+ setup do
+ @user = User.generate_with_protected!(:password => 'my_password', :password_confirmation => 'my_password')
+ @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'my_password')
+ get "/news.json", nil, :authorization => @authorization
+ end
+
+ should_respond_with :unauthorized
+ should_respond_with_content_type :json
+ should "not login as the user" do
+ assert_equal User.anonymous, User.current
+ end
+ end
+
+ context "with a valid HTTP authentication using the API token" do
+ setup do
+ @user = User.generate_with_protected!
+ @token = Token.generate!(:user => @user, :action => 'api')
+ @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'DoesNotMatter')
+ get "/news.json", nil, :authorization => @authorization
+ end
+
+ should_respond_with :unauthorized
+ should_respond_with_content_type :json
+ should "not login as the user" do
+ assert_equal User.anonymous, User.current
+ end
+ end
+
+ end
+ end
+end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/api_test/http_basic_login_test.rb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/integration/api_test/http_basic_login_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,31 @@
+require "#{File.dirname(__FILE__)}/../../test_helper"
+
+class ApiTest::HttpBasicLoginTest < ActionController::IntegrationTest
+ fixtures :all
+
+ def setup
+ Setting.rest_api_enabled = '1'
+ Setting.login_required = '1'
+ end
+
+ def teardown
+ Setting.rest_api_enabled = '0'
+ Setting.login_required = '0'
+ end
+
+ # Using the NewsController because it's a simple API.
+ context "get /news" do
+ setup do
+ project = Project.find('onlinestore')
+ EnabledModule.create(:project => project, :name => 'news')
+ end
+
+ context "in :xml format" do
+ should_allow_http_basic_auth_with_username_and_password(:get, "/projects/onlinestore/news.xml")
+ end
+
+ context "in :json format" do
+ should_allow_http_basic_auth_with_username_and_password(:get, "/projects/onlinestore/news.json")
+ end
+ end
+end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/api_test/http_basic_login_with_api_token_test.rb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/integration/api_test/http_basic_login_with_api_token_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,27 @@
+require "#{File.dirname(__FILE__)}/../../test_helper"
+
+class ApiTest::HttpBasicLoginWithApiTokenTest < ActionController::IntegrationTest
+ fixtures :all
+
+ def setup
+ Setting.rest_api_enabled = '1'
+ Setting.login_required = '1'
+ end
+
+ def teardown
+ Setting.rest_api_enabled = '0'
+ Setting.login_required = '0'
+ end
+
+ # Using the NewsController because it's a simple API.
+ context "get /news" do
+
+ context "in :xml format" do
+ should_allow_http_basic_auth_with_key(:get, "/news.xml")
+ end
+
+ context "in :json format" do
+ should_allow_http_basic_auth_with_key(:get, "/news.json")
+ end
+ end
+end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/api_test/issues_test.rb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/integration/api_test/issues_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,340 @@
+# Redmine - project management software
+# Copyright (C) 2006-2010 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+require "#{File.dirname(__FILE__)}/../../test_helper"
+
+class ApiTest::IssuesTest < ActionController::IntegrationTest
+ fixtures :projects,
+ :users,
+ :roles,
+ :members,
+ :member_roles,
+ :issues,
+ :issue_statuses,
+ :versions,
+ :trackers,
+ :projects_trackers,
+ :issue_categories,
+ :enabled_modules,
+ :enumerations,
+ :attachments,
+ :workflows,
+ :custom_fields,
+ :custom_values,
+ :custom_fields_projects,
+ :custom_fields_trackers,
+ :time_entries,
+ :journals,
+ :journal_details,
+ :queries
+
+ def setup
+ Setting.rest_api_enabled = '1'
+ end
+
+ # Use a private project to make sure auth is really working and not just
+ # only showing public issues.
+ context "/index.xml" do
+ should_allow_api_authentication(:get, "/projects/private-child/issues.xml")
+ end
+
+ context "/index.json" do
+ should_allow_api_authentication(:get, "/projects/private-child/issues.json")
+ end
+
+ context "/index.xml with filter" do
+ should_allow_api_authentication(:get, "/projects/private-child/issues.xml?status_id=5")
+
+ should "show only issues with the status_id" do
+ get '/issues.xml?status_id=5'
+ assert_tag :tag => 'issues',
+ :children => { :count => Issue.visible.count(:conditions => {:status_id => 5}),
+ :only => { :tag => 'issue' } }
+ end
+ end
+
+ context "/index.json with filter" do
+ should_allow_api_authentication(:get, "/projects/private-child/issues.json?status_id=5")
+
+ should "show only issues with the status_id" do
+ get '/issues.json?status_id=5'
+
+ json = ActiveSupport::JSON.decode(response.body)
+ status_ids_used = json.collect {|j| j['status_id'] }
+ assert_equal 3, status_ids_used.length
+ assert status_ids_used.all? {|id| id == 5 }
+ end
+
+ end
+
+ # Issue 6 is on a private project
+ context "/issues/6.xml" do
+ should_allow_api_authentication(:get, "/issues/6.xml")
+ end
+
+ context "/issues/6.json" do
+ should_allow_api_authentication(:get, "/issues/6.json")
+ end
+
+ context "POST /issues.xml" do
+ should_allow_api_authentication(:post,
+ '/issues.xml',
+ {:issue => {:project_id => 1, :subject => 'API test', :tracker_id => 2, :status_id => 3}},
+ {:success_code => :created})
+
+ should "create an issue with the attributes" do
+ assert_difference('Issue.count') do
+ post '/issues.xml', {:issue => {:project_id => 1, :subject => 'API test', :tracker_id => 2, :status_id => 3}}, :authorization => credentials('jsmith')
+ end
+
+ issue = Issue.first(:order => 'id DESC')
+ assert_equal 1, issue.project_id
+ assert_equal 2, issue.tracker_id
+ assert_equal 3, issue.status_id
+ assert_equal 'API test', issue.subject
+
+ assert_response :created
+ assert_equal 'application/xml', @response.content_type
+ assert_tag 'issue', :child => {:tag => 'id', :content => issue.id.to_s}
+ end
+ end
+
+ context "POST /issues.xml with failure" do
+ should_allow_api_authentication(:post,
+ '/issues.xml',
+ {:issue => {:project_id => 1}},
+ {:success_code => :unprocessable_entity})
+
+ should "have an errors tag" do
+ assert_no_difference('Issue.count') do
+ post '/issues.xml', {:issue => {:project_id => 1}}, :authorization => credentials('jsmith')
+ end
+
+ assert_tag :errors, :child => {:tag => 'error', :content => "Subject can't be blank"}
+ end
+ end
+
+ context "POST /issues.json" do
+ should_allow_api_authentication(:post,
+ '/issues.json',
+ {:issue => {:project_id => 1, :subject => 'API test', :tracker_id => 2, :status_id => 3}},
+ {:success_code => :created})
+
+ should "create an issue with the attributes" do
+ assert_difference('Issue.count') do
+ post '/issues.json', {:issue => {:project_id => 1, :subject => 'API test', :tracker_id => 2, :status_id => 3}}, :authorization => credentials('jsmith')
+ end
+
+ issue = Issue.first(:order => 'id DESC')
+ assert_equal 1, issue.project_id
+ assert_equal 2, issue.tracker_id
+ assert_equal 3, issue.status_id
+ assert_equal 'API test', issue.subject
+ end
+
+ end
+
+ context "POST /issues.json with failure" do
+ should_allow_api_authentication(:post,
+ '/issues.json',
+ {:issue => {:project_id => 1}},
+ {:success_code => :unprocessable_entity})
+
+ should "have an errors element" do
+ assert_no_difference('Issue.count') do
+ post '/issues.json', {:issue => {:project_id => 1}}, :authorization => credentials('jsmith')
+ end
+
+ json = ActiveSupport::JSON.decode(response.body)
+ assert_equal "can't be blank", json.first['subject']
+ end
+ end
+
+ # Issue 6 is on a private project
+ context "PUT /issues/6.xml" do
+ setup do
+ @parameters = {:issue => {:subject => 'API update', :notes => 'A new note'}}
+ @headers = { :authorization => credentials('jsmith') }
+ end
+
+ should_allow_api_authentication(:put,
+ '/issues/6.xml',
+ {:issue => {:subject => 'API update', :notes => 'A new note'}},
+ {:success_code => :ok})
+
+ should "not create a new issue" do
+ assert_no_difference('Issue.count') do
+ put '/issues/6.xml', @parameters, @headers
+ end
+ end
+
+ should "create a new journal" do
+ assert_difference('Journal.count') do
+ put '/issues/6.xml', @parameters, @headers
+ end
+ end
+
+ should "add the note to the journal" do
+ put '/issues/6.xml', @parameters, @headers
+
+ journal = Journal.last
+ assert_equal "A new note", journal.notes
+ end
+
+ should "update the issue" do
+ put '/issues/6.xml', @parameters, @headers
+
+ issue = Issue.find(6)
+ assert_equal "API update", issue.subject
+ end
+
+ end
+
+ context "PUT /issues/6.xml with failed update" do
+ setup do
+ @parameters = {:issue => {:subject => ''}}
+ @headers = { :authorization => credentials('jsmith') }
+ end
+
+ should_allow_api_authentication(:put,
+ '/issues/6.xml',
+ {:issue => {:subject => ''}}, # Missing subject should fail
+ {:success_code => :unprocessable_entity})
+
+ should "not create a new issue" do
+ assert_no_difference('Issue.count') do
+ put '/issues/6.xml', @parameters, @headers
+ end
+ end
+
+ should "not create a new journal" do
+ assert_no_difference('Journal.count') do
+ put '/issues/6.xml', @parameters, @headers
+ end
+ end
+
+ should "have an errors tag" do
+ put '/issues/6.xml', @parameters, @headers
+
+ assert_tag :errors, :child => {:tag => 'error', :content => "Subject can't be blank"}
+ end
+ end
+
+ context "PUT /issues/6.json" do
+ setup do
+ @parameters = {:issue => {:subject => 'API update', :notes => 'A new note'}}
+ @headers = { :authorization => credentials('jsmith') }
+ end
+
+ should_allow_api_authentication(:put,
+ '/issues/6.json',
+ {:issue => {:subject => 'API update', :notes => 'A new note'}},
+ {:success_code => :ok})
+
+ should "not create a new issue" do
+ assert_no_difference('Issue.count') do
+ put '/issues/6.json', @parameters, @headers
+ end
+ end
+
+ should "create a new journal" do
+ assert_difference('Journal.count') do
+ put '/issues/6.json', @parameters, @headers
+ end
+ end
+
+ should "add the note to the journal" do
+ put '/issues/6.json', @parameters, @headers
+
+ journal = Journal.last
+ assert_equal "A new note", journal.notes
+ end
+
+ should "update the issue" do
+ put '/issues/6.json', @parameters, @headers
+
+ issue = Issue.find(6)
+ assert_equal "API update", issue.subject
+ end
+
+ end
+
+ context "PUT /issues/6.json with failed update" do
+ setup do
+ @parameters = {:issue => {:subject => ''}}
+ @headers = { :authorization => credentials('jsmith') }
+ end
+
+ should_allow_api_authentication(:put,
+ '/issues/6.json',
+ {:issue => {:subject => ''}}, # Missing subject should fail
+ {:success_code => :unprocessable_entity})
+
+ should "not create a new issue" do
+ assert_no_difference('Issue.count') do
+ put '/issues/6.json', @parameters, @headers
+ end
+ end
+
+ should "not create a new journal" do
+ assert_no_difference('Journal.count') do
+ put '/issues/6.json', @parameters, @headers
+ end
+ end
+
+ should "have an errors attribute" do
+ put '/issues/6.json', @parameters, @headers
+
+ json = ActiveSupport::JSON.decode(response.body)
+ assert_equal "can't be blank", json.first['subject']
+ end
+ end
+
+ context "DELETE /issues/1.xml" do
+ should_allow_api_authentication(:delete,
+ '/issues/6.xml',
+ {},
+ {:success_code => :ok})
+
+ should "delete the issue" do
+ assert_difference('Issue.count',-1) do
+ delete '/issues/6.xml', {}, :authorization => credentials('jsmith')
+ end
+
+ assert_nil Issue.find_by_id(6)
+ end
+ end
+
+ context "DELETE /issues/1.json" do
+ should_allow_api_authentication(:delete,
+ '/issues/6.json',
+ {},
+ {:success_code => :ok})
+
+ should "delete the issue" do
+ assert_difference('Issue.count',-1) do
+ delete '/issues/6.json', {}, :authorization => credentials('jsmith')
+ end
+
+ assert_nil Issue.find_by_id(6)
+ end
+ end
+
+ def credentials(user, password=nil)
+ ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user)
+ end
+end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/api_test/projects_test.rb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/integration/api_test/projects_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,111 @@
+# Redmine - project management software
+# Copyright (C) 2006-2010 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+require "#{File.dirname(__FILE__)}/../../test_helper"
+
+class ApiTest::ProjectsTest < ActionController::IntegrationTest
+ fixtures :projects, :versions, :users, :roles, :members, :member_roles, :issues, :journals, :journal_details,
+ :trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations, :boards, :messages,
+ :attachments, :custom_fields, :custom_values, :time_entries
+
+ def setup
+ Setting.rest_api_enabled = '1'
+ end
+
+ def test_index
+ get '/projects.xml'
+ assert_response :success
+ assert_equal 'application/xml', @response.content_type
+ end
+
+ def test_show
+ get '/projects/1.xml'
+ assert_response :success
+ assert_equal 'application/xml', @response.content_type
+ assert_tag 'custom_field', :attributes => {:name => 'Development status'}, :content => 'Stable'
+ end
+
+ def test_show_should_not_display_hidden_custom_fields
+ ProjectCustomField.find_by_name('Development status').update_attribute :visible, false
+ get '/projects/1.xml'
+ assert_response :success
+ assert_equal 'application/xml', @response.content_type
+ assert_no_tag 'custom_field', :attributes => {:name => 'Development status'}
+ end
+
+ def test_create
+ attributes = {:name => 'API test', :identifier => 'api-test'}
+ assert_difference 'Project.count' do
+ post '/projects.xml', {:project => attributes}, :authorization => credentials('admin')
+ end
+
+ project = Project.first(:order => 'id DESC')
+ attributes.each do |attribute, value|
+ assert_equal value, project.send(attribute)
+ end
+
+ assert_response :created
+ assert_equal 'application/xml', @response.content_type
+ assert_tag 'project', :child => {:tag => 'id', :content => project.id.to_s}
+ end
+
+ def test_create_failure
+ attributes = {:name => 'API test'}
+ assert_no_difference 'Project.count' do
+ post '/projects.xml', {:project => attributes}, :authorization => credentials('admin')
+ end
+ assert_response :unprocessable_entity
+ assert_equal 'application/xml', @response.content_type
+ assert_tag :errors, :child => {:tag => 'error', :content => "Identifier can't be blank"}
+ end
+
+ def test_update
+ attributes = {:name => 'API update'}
+ assert_no_difference 'Project.count' do
+ put '/projects/1.xml', {:project => attributes}, :authorization => credentials('jsmith')
+ end
+ assert_response :ok
+ assert_equal 'application/xml', @response.content_type
+ project = Project.find(1)
+ attributes.each do |attribute, value|
+ assert_equal value, project.send(attribute)
+ end
+ end
+
+ def test_update_failure
+ attributes = {:name => ''}
+ assert_no_difference 'Project.count' do
+ put '/projects/1.xml', {:project => attributes}, :authorization => credentials('jsmith')
+ end
+ assert_response :unprocessable_entity
+ assert_equal 'application/xml', @response.content_type
+ assert_tag :errors, :child => {:tag => 'error', :content => "Name can't be blank"}
+ end
+
+ def test_destroy
+ assert_difference 'Project.count', -1 do
+ delete '/projects/2.xml', {}, :authorization => credentials('admin')
+ end
+ assert_response :ok
+ assert_equal 'application/xml', @response.content_type
+ assert_nil Project.find_by_id(2)
+ end
+
+ def credentials(user, password=nil)
+ ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user)
+ end
+end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/api_test/token_authentication_test.rb
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/integration/api_test/token_authentication_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,26 @@
+require "#{File.dirname(__FILE__)}/../../test_helper"
+
+class ApiTest::TokenAuthenticationTest < ActionController::IntegrationTest
+ fixtures :all
+
+ def setup
+ Setting.rest_api_enabled = '1'
+ Setting.login_required = '1'
+ end
+
+ def teardown
+ Setting.rest_api_enabled = '0'
+ Setting.login_required = '0'
+ end
+
+ # Using the NewsController because it's a simple API.
+ context "get /news" do
+ context "in :xml format" do
+ should_allow_key_based_auth(:get, "/news.xml")
+ end
+
+ context "in :json format" do
+ should_allow_key_based_auth(:get, "/news.json")
+ end
+ end
+end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/api_token_login_test.rb
--- a/test/integration/api_token_login_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-require "#{File.dirname(__FILE__)}/../test_helper"
-
-class ApiTokenLoginTest < ActionController::IntegrationTest
- fixtures :all
-
- def setup
- Setting.rest_api_enabled = '1'
- Setting.login_required = '1'
- end
-
- def teardown
- Setting.rest_api_enabled = '0'
- Setting.login_required = '0'
- end
-
- # Using the NewsController because it's a simple API.
- context "get /news" do
-
- context "in :xml format" do
- context "with a valid api token" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'api')
- get "/news.xml?key=#{@token.value}"
- end
-
- should_respond_with :success
- should_respond_with_content_type :xml
- should "login as the user" do
- assert_equal @user, User.current
- end
- end
-
- context "with an invalid api token" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'feeds')
- get "/news.xml?key=#{@token.value}"
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :xml
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
- end
-
- context "in :json format" do
- context "with a valid api token" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'api')
- get "/news.json?key=#{@token.value}"
- end
-
- should_respond_with :success
- should_respond_with_content_type :json
- should "login as the user" do
- assert_equal @user, User.current
- end
- end
-
- context "with an invalid api token" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'feeds')
- get "/news.json?key=#{@token.value}"
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :json
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
- end
-
- end
-end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/disabled_rest_api_test.rb
--- a/test/integration/disabled_rest_api_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-require "#{File.dirname(__FILE__)}/../test_helper"
-
-class DisabledRestApi < ActionController::IntegrationTest
- fixtures :all
-
- def setup
- Setting.rest_api_enabled = '0'
- Setting.login_required = '1'
- end
-
- def teardown
- Setting.rest_api_enabled = '1'
- Setting.login_required = '0'
- end
-
- # Using the NewsController because it's a simple API.
- context "get /news with the API disabled" do
-
- context "in :xml format" do
- context "with a valid api token" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'api')
- get "/news.xml?key=#{@token.value}"
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :xml
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
-
- context "with a valid HTTP authentication" do
- setup do
- @user = User.generate_with_protected!(:password => 'my_password', :password_confirmation => 'my_password')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'my_password')
- get "/news.xml", nil, :authorization => @authorization
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :xml
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
-
- context "with a valid HTTP authentication using the API token" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'api')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'X')
- get "/news.xml", nil, :authorization => @authorization
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :xml
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
- end
-
- context "in :json format" do
- context "with a valid api token" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'api')
- get "/news.json?key=#{@token.value}"
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :json
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
-
- context "with a valid HTTP authentication" do
- setup do
- @user = User.generate_with_protected!(:password => 'my_password', :password_confirmation => 'my_password')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'my_password')
- get "/news.json", nil, :authorization => @authorization
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :json
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
-
- context "with a valid HTTP authentication using the API token" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'api')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'DoesNotMatter')
- get "/news.json", nil, :authorization => @authorization
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :json
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
-
- end
- end
-end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/http_basic_login_test.rb
--- a/test/integration/http_basic_login_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-require "#{File.dirname(__FILE__)}/../test_helper"
-
-class HttpBasicLoginTest < ActionController::IntegrationTest
- fixtures :all
-
- def setup
- Setting.rest_api_enabled = '1'
- Setting.login_required = '1'
- end
-
- def teardown
- Setting.rest_api_enabled = '0'
- Setting.login_required = '0'
- end
-
- # Using the NewsController because it's a simple API.
- context "get /news" do
-
- context "in :xml format" do
- context "with a valid HTTP authentication" do
- setup do
- @user = User.generate_with_protected!(:password => 'my_password', :password_confirmation => 'my_password')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'my_password')
- get "/news.xml", nil, :authorization => @authorization
- end
-
- should_respond_with :success
- should_respond_with_content_type :xml
- should "login as the user" do
- assert_equal @user, User.current
- end
- end
-
- context "with an invalid HTTP authentication" do
- setup do
- @user = User.generate_with_protected!
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'wrong_password')
- get "/news.xml", nil, :authorization => @authorization
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :xml
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
-
- context "without credentials" do
- setup do
- get "/projects/onlinestore/news.xml"
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :xml
- should "include_www_authenticate_header" do
- assert @controller.response.headers.has_key?('WWW-Authenticate')
- end
- end
- end
-
- context "in :json format" do
- context "with a valid HTTP authentication" do
- setup do
- @user = User.generate_with_protected!(:password => 'my_password', :password_confirmation => 'my_password')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'my_password')
- get "/news.json", nil, :authorization => @authorization
- end
-
- should_respond_with :success
- should_respond_with_content_type :json
- should "login as the user" do
- assert_equal @user, User.current
- end
- end
-
- context "with an invalid HTTP authentication" do
- setup do
- @user = User.generate_with_protected!
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'wrong_password')
- get "/news.json", nil, :authorization => @authorization
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :json
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
- end
-
- context "without credentials" do
- setup do
- get "/projects/onlinestore/news.json"
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :json
- should "include_www_authenticate_header" do
- assert @controller.response.headers.has_key?('WWW-Authenticate')
- end
- end
- end
-end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/http_basic_login_with_api_token_test.rb
--- a/test/integration/http_basic_login_with_api_token_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-require "#{File.dirname(__FILE__)}/../test_helper"
-
-class HttpBasicLoginWithApiTokenTest < ActionController::IntegrationTest
- fixtures :all
-
- def setup
- Setting.rest_api_enabled = '1'
- Setting.login_required = '1'
- end
-
- def teardown
- Setting.rest_api_enabled = '0'
- Setting.login_required = '0'
- end
-
- # Using the NewsController because it's a simple API.
- context "get /news" do
-
- context "in :xml format" do
- context "with a valid HTTP authentication using the API token" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'api')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'X')
- get "/news.xml", nil, :authorization => @authorization
- end
-
- should_respond_with :success
- should_respond_with_content_type :xml
- should "login as the user" do
- assert_equal @user, User.current
- end
- end
-
- context "with an invalid HTTP authentication" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'feeds')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'X')
- get "/news.xml", nil, :authorization => @authorization
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :xml
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
- end
-
- context "in :json format" do
- context "with a valid HTTP authentication" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'api')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'DoesNotMatter')
- get "/news.json", nil, :authorization => @authorization
- end
-
- should_respond_with :success
- should_respond_with_content_type :json
- should "login as the user" do
- assert_equal @user, User.current
- end
- end
-
- context "with an invalid HTTP authentication" do
- setup do
- @user = User.generate_with_protected!
- @token = Token.generate!(:user => @user, :action => 'feeds')
- @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'DoesNotMatter')
- get "/news.json", nil, :authorization => @authorization
- end
-
- should_respond_with :unauthorized
- should_respond_with_content_type :json
- should "not login as the user" do
- assert_equal User.anonymous, User.current
- end
- end
- end
-
- end
-end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/issues_api_test.rb
--- a/test/integration/issues_api_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,349 +0,0 @@
-# Redmine - project management software
-# Copyright (C) 2006-2010 Jean-Philippe Lang
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-require "#{File.dirname(__FILE__)}/../test_helper"
-
-class IssuesApiTest < ActionController::IntegrationTest
- fixtures :projects,
- :users,
- :roles,
- :members,
- :member_roles,
- :issues,
- :issue_statuses,
- :versions,
- :trackers,
- :projects_trackers,
- :issue_categories,
- :enabled_modules,
- :enumerations,
- :attachments,
- :workflows,
- :custom_fields,
- :custom_values,
- :custom_fields_projects,
- :custom_fields_trackers,
- :time_entries,
- :journals,
- :journal_details,
- :queries
-
- def setup
- Setting.rest_api_enabled = '1'
- end
-
- context "/index.xml" do
- setup do
- get '/issues.xml'
- end
-
- should_respond_with :success
- should_respond_with_content_type 'application/xml'
- end
-
- context "/index.json" do
- setup do
- get '/issues.json'
- end
-
- should_respond_with :success
- should_respond_with_content_type 'application/json'
-
- should 'return a valid JSON string' do
- assert ActiveSupport::JSON.decode(response.body)
- end
- end
-
- context "/index.xml with filter" do
- setup do
- get '/issues.xml?status_id=5'
- end
-
- should_respond_with :success
- should_respond_with_content_type 'application/xml'
- should "show only issues with the status_id" do
- assert_tag :tag => 'issues',
- :children => { :count => Issue.visible.count(:conditions => {:status_id => 5}),
- :only => { :tag => 'issue' } }
- end
- end
-
- context "/index.json with filter" do
- setup do
- get '/issues.json?status_id=5'
- end
-
- should_respond_with :success
- should_respond_with_content_type 'application/json'
-
- should 'return a valid JSON string' do
- assert ActiveSupport::JSON.decode(response.body)
- end
-
- should "show only issues with the status_id" do
- json = ActiveSupport::JSON.decode(response.body)
- status_ids_used = json.collect {|j| j['status_id'] }
- assert_equal 3, status_ids_used.length
- assert status_ids_used.all? {|id| id == 5 }
- end
-
- end
-
- context "/issues/1.xml" do
- setup do
- get '/issues/1.xml'
- end
-
- should_respond_with :success
- should_respond_with_content_type 'application/xml'
- end
-
- context "/issues/1.json" do
- setup do
- get '/issues/1.json'
- end
-
- should_respond_with :success
- should_respond_with_content_type 'application/json'
-
- should 'return a valid JSON string' do
- assert ActiveSupport::JSON.decode(response.body)
- end
- end
-
- context "POST /issues.xml" do
- setup do
- @issue_count = Issue.count
- @attributes = {:project_id => 1, :subject => 'API test', :tracker_id => 2, :status_id => 3}
- post '/issues.xml', {:issue => @attributes}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :created
- should_respond_with_content_type 'application/xml'
-
- should "create an issue with the attributes" do
- assert_equal Issue.count, @issue_count + 1
-
- issue = Issue.first(:order => 'id DESC')
- @attributes.each do |attribute, value|
- assert_equal value, issue.send(attribute)
- end
- end
- end
-
- context "POST /issues.xml with failure" do
- setup do
- @attributes = {:project_id => 1}
- post '/issues.xml', {:issue => @attributes}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :unprocessable_entity
- should_respond_with_content_type 'application/xml'
-
- should "have an errors tag" do
- assert_tag :errors, :child => {:tag => 'error', :content => "Subject can't be blank"}
- end
- end
-
- context "POST /issues.json" do
- setup do
- @issue_count = Issue.count
- @attributes = {:project_id => 1, :subject => 'API test', :tracker_id => 2, :status_id => 3}
- post '/issues.json', {:issue => @attributes}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :created
- should_respond_with_content_type 'application/json'
-
- should "create an issue with the attributes" do
- assert_equal Issue.count, @issue_count + 1
-
- issue = Issue.first(:order => 'id DESC')
- @attributes.each do |attribute, value|
- assert_equal value, issue.send(attribute)
- end
- end
- end
-
- context "POST /issues.json with failure" do
- setup do
- @attributes = {:project_id => 1}
- post '/issues.json', {:issue => @attributes}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :unprocessable_entity
- should_respond_with_content_type 'application/json'
-
- should "have an errors element" do
- json = ActiveSupport::JSON.decode(response.body)
- assert_equal "can't be blank", json.first['subject']
- end
- end
-
- context "PUT /issues/1.xml" do
- setup do
- @issue_count = Issue.count
- @journal_count = Journal.count
- @attributes = {:subject => 'API update', :notes => 'A new note'}
-
- put '/issues/1.xml', {:issue => @attributes}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :ok
- should_respond_with_content_type 'application/xml'
-
- should "not create a new issue" do
- assert_equal Issue.count, @issue_count
- end
-
- should "create a new journal" do
- assert_equal Journal.count, @journal_count + 1
- end
-
- should "add the note to the journal" do
- journal = Journal.last
- assert_equal "A new note", journal.notes
- end
-
- should "update the issue" do
- issue = Issue.find(1)
- @attributes.each do |attribute, value|
- assert_equal value, issue.send(attribute) unless attribute == :notes
- end
- end
-
- end
-
- context "PUT /issues/1.xml with failed update" do
- setup do
- @attributes = {:subject => ''}
- @issue_count = Issue.count
- @journal_count = Journal.count
-
- put '/issues/1.xml', {:issue => @attributes}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :unprocessable_entity
- should_respond_with_content_type 'application/xml'
-
- should "not create a new issue" do
- assert_equal Issue.count, @issue_count
- end
-
- should "not create a new journal" do
- assert_equal Journal.count, @journal_count
- end
-
- should "have an errors tag" do
- assert_tag :errors, :child => {:tag => 'error', :content => "Subject can't be blank"}
- end
- end
-
- context "PUT /issues/1.json" do
- setup do
- @issue_count = Issue.count
- @journal_count = Journal.count
- @attributes = {:subject => 'API update', :notes => 'A new note'}
-
- put '/issues/1.json', {:issue => @attributes}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :ok
- should_respond_with_content_type 'application/json'
-
- should "not create a new issue" do
- assert_equal Issue.count, @issue_count
- end
-
- should "create a new journal" do
- assert_equal Journal.count, @journal_count + 1
- end
-
- should "add the note to the journal" do
- journal = Journal.last
- assert_equal "A new note", journal.notes
- end
-
- should "update the issue" do
- issue = Issue.find(1)
- @attributes.each do |attribute, value|
- assert_equal value, issue.send(attribute) unless attribute == :notes
- end
- end
-
- end
-
- context "PUT /issues/1.json with failed update" do
- setup do
- @attributes = {:subject => ''}
- @issue_count = Issue.count
- @journal_count = Journal.count
-
- put '/issues/1.json', {:issue => @attributes}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :unprocessable_entity
- should_respond_with_content_type 'application/json'
-
- should "not create a new issue" do
- assert_equal Issue.count, @issue_count
- end
-
- should "not create a new journal" do
- assert_equal Journal.count, @journal_count
- end
-
- should "have an errors attribute" do
- json = ActiveSupport::JSON.decode(response.body)
- assert_equal "can't be blank", json.first['subject']
- end
- end
-
- context "DELETE /issues/1.xml" do
- setup do
- @issue_count = Issue.count
- delete '/issues/1.xml', {}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :ok
- should_respond_with_content_type 'application/xml'
-
- should "delete the issue" do
- assert_equal Issue.count, @issue_count -1
- assert_nil Issue.find_by_id(1)
- end
- end
-
- context "DELETE /issues/1.json" do
- setup do
- @issue_count = Issue.count
- delete '/issues/1.json', {}, :authorization => credentials('jsmith')
- end
-
- should_respond_with :ok
- should_respond_with_content_type 'application/json'
-
- should "delete the issue" do
- assert_equal Issue.count, @issue_count -1
- assert_nil Issue.find_by_id(1)
- end
- end
-
- def credentials(user, password=nil)
- ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user)
- end
-end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/issues_test.rb
--- a/test/integration/issues_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/integration/issues_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -72,7 +72,7 @@
put 'issues/1',
:notes => 'Some notes',
:attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'This is an attachment'}}
- assert_redirected_to "issues/1"
+ assert_redirected_to "/issues/1"
# make sure attachment was saved
attachment = Issue.find(1).attachments.find_by_filename("testfile.txt")
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/lib/.svn/entries
--- a/test/integration/lib/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/integration/lib/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test/integration/lib
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/lib/redmine/.svn/entries
--- a/test/integration/lib/redmine/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/integration/lib/redmine/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test/integration/lib/redmine
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/projects_api_test.rb
--- a/test/integration/projects_api_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-# Redmine - project management software
-# Copyright (C) 2006-2010 Jean-Philippe Lang
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-require "#{File.dirname(__FILE__)}/../test_helper"
-
-class ProjectsApiTest < ActionController::IntegrationTest
- fixtures :projects, :versions, :users, :roles, :members, :member_roles, :issues, :journals, :journal_details,
- :trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations, :boards, :messages,
- :attachments, :custom_fields, :custom_values, :time_entries
-
- def setup
- Setting.rest_api_enabled = '1'
- end
-
- def test_index
- get '/projects.xml'
- assert_response :success
- assert_equal 'application/xml', @response.content_type
- end
-
- def test_show
- get '/projects/1.xml'
- assert_response :success
- assert_equal 'application/xml', @response.content_type
- end
-
- def test_create
- attributes = {:name => 'API test', :identifier => 'api-test'}
- assert_difference 'Project.count' do
- post '/projects.xml', {:project => attributes}, :authorization => credentials('admin')
- end
- assert_response :created
- assert_equal 'application/xml', @response.content_type
- project = Project.first(:order => 'id DESC')
- attributes.each do |attribute, value|
- assert_equal value, project.send(attribute)
- end
- end
-
- def test_create_failure
- attributes = {:name => 'API test'}
- assert_no_difference 'Project.count' do
- post '/projects.xml', {:project => attributes}, :authorization => credentials('admin')
- end
- assert_response :unprocessable_entity
- assert_equal 'application/xml', @response.content_type
- assert_tag :errors, :child => {:tag => 'error', :content => "Identifier can't be blank"}
- end
-
- def test_update
- attributes = {:name => 'API update'}
- assert_no_difference 'Project.count' do
- put '/projects/1.xml', {:project => attributes}, :authorization => credentials('jsmith')
- end
- assert_response :ok
- assert_equal 'application/xml', @response.content_type
- project = Project.find(1)
- attributes.each do |attribute, value|
- assert_equal value, project.send(attribute)
- end
- end
-
- def test_update_failure
- attributes = {:name => ''}
- assert_no_difference 'Project.count' do
- put '/projects/1.xml', {:project => attributes}, :authorization => credentials('jsmith')
- end
- assert_response :unprocessable_entity
- assert_equal 'application/xml', @response.content_type
- assert_tag :errors, :child => {:tag => 'error', :content => "Name can't be blank"}
- end
-
- def test_destroy
- assert_difference 'Project.count', -1 do
- delete '/projects/2.xml', {}, :authorization => credentials('admin')
- end
- assert_response :ok
- assert_equal 'application/xml', @response.content_type
- assert_nil Project.find_by_id(2)
- end
-
- def credentials(user, password=nil)
- ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user)
- end
-end
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/projects_test.rb
--- a/test/integration/projects_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/integration/projects_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -27,7 +27,7 @@
assert_response :success
assert_template "admin/projects"
post "projects/archive", :id => 1
- assert_redirected_to "admin/projects"
+ assert_redirected_to "/admin/projects"
assert !Project.find(1).active?
get 'projects/1'
@@ -36,7 +36,7 @@
assert_response 403
post "projects/unarchive", :id => 1
- assert_redirected_to "admin/projects"
+ assert_redirected_to "/admin/projects"
assert Project.find(1).active?
get "projects/1"
assert_response :success
diff -r 09b1d4349da3 -r 371eac10df0b test/integration/routing_test.rb
--- a/test/integration/routing_test.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/integration/routing_test.rb Wed Nov 24 12:20:08 2010 +0000
@@ -157,13 +157,14 @@
should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567'
should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234'
should_route :get, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567'
+ should_route :get, "/news/preview", :controller => 'previews', :action => 'news'
+
+ should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567'
+ should_route :post, "/news/567/comments", :controller => 'comments', :action => 'create', :id => '567'
- should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567'
- should_route :post, "/news/567/destroy", :controller => 'news', :action => 'destroy', :id => '567'
- should_route :post, "/news/567/comments", :controller => 'comments', :action => 'create', :id => '567'
-
- should_route :put, "/news/567/edit", :controller => 'news', :action => 'update', :id => '567'
+ should_route :put, "/news/567", :controller => 'news', :action => 'update', :id => '567'
+ should_route :delete, "/news/567", :controller => 'news', :action => 'destroy', :id => '567'
should_route :delete, "/news/567/comments/15", :controller => 'comments', :action => 'destroy', :id => '567', :comment_id => '15'
end
@@ -220,40 +221,81 @@
should_route :post, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
end
- context "timelogs" do
- should_route :get, "/issues/567/time_entries/new", :controller => 'timelog', :action => 'edit', :issue_id => '567'
- should_route :get, "/projects/ecookbook/time_entries/new", :controller => 'timelog', :action => 'edit', :project_id => 'ecookbook'
- should_route :get, "/projects/ecookbook/issues/567/time_entries/new", :controller => 'timelog', :action => 'edit', :project_id => 'ecookbook', :issue_id => '567'
+ context "timelogs (global)" do
+ should_route :get, "/time_entries", :controller => 'timelog', :action => 'index'
+ should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'index', :format => 'csv'
+ should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'index', :format => 'atom'
+ should_route :get, "/time_entries/new", :controller => 'timelog', :action => 'new'
should_route :get, "/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22'
- should_route :get, "/time_entries/report", :controller => 'timelog', :action => 'report'
- should_route :get, "/projects/567/time_entries/report", :controller => 'timelog', :action => 'report', :project_id => '567'
- should_route :get, "/projects/567/time_entries/report.csv", :controller => 'timelog', :action => 'report', :project_id => '567', :format => 'csv'
- should_route :get, "/time_entries", :controller => 'timelog', :action => 'details'
- should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'details', :format => 'csv'
- should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'details', :format => 'atom'
- should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'details', :project_id => '567'
- should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'details', :project_id => '567', :format => 'csv'
- should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'details', :project_id => '567', :format => 'atom'
- should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'details', :issue_id => '234'
- should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'details', :issue_id => '234', :format => 'csv'
- should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'details', :issue_id => '234', :format => 'atom'
- should_route :get, "/projects/ecookbook/issues/123/time_entries", :controller => 'timelog', :action => 'details', :project_id => 'ecookbook', :issue_id => '123'
- should_route :post, "/time_entries/55/destroy", :controller => 'timelog', :action => 'destroy', :id => '55'
+ should_route :post, "/time_entries", :controller => 'timelog', :action => 'create'
+
+ should_route :put, "/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22'
+
+ should_route :delete, "/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55'
+ end
+
+ context "timelogs (scoped under project)" do
+ should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'index', :project_id => '567'
+ should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'csv'
+ should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'atom'
+ should_route :get, "/projects/567/time_entries/new", :controller => 'timelog', :action => 'new', :project_id => '567'
+ should_route :get, "/projects/567/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :project_id => '567'
+
+ should_route :post, "/projects/567/time_entries", :controller => 'timelog', :action => 'create', :project_id => '567'
+
+ should_route :put, "/projects/567/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :project_id => '567'
+
+ should_route :delete, "/projects/567/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :project_id => '567'
+ end
+
+ context "timelogs (scoped under issues)" do
+ should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234'
+ should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'csv'
+ should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'atom'
+ should_route :get, "/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234'
+ should_route :get, "/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234'
+
+ should_route :post, "/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234'
+
+ should_route :put, "/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234'
+
+ should_route :delete, "/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234'
+ end
+
+ context "timelogs (scoped under project and issues)" do
+ should_route :get, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook'
+ should_route :get, "/projects/ecookbook/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'csv'
+ should_route :get, "/projects/ecookbook/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'atom'
+ should_route :get, "/projects/ecookbook/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234', :project_id => 'ecookbook'
+ should_route :get, "/projects/ecookbook/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
+
+ should_route :post, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234', :project_id => 'ecookbook'
+
+ should_route :put, "/projects/ecookbook/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
+
+ should_route :delete, "/projects/ecookbook/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234', :project_id => 'ecookbook'
+ end
+
+ context "time_entry_reports" do
+ should_route :get, "/time_entries/report", :controller => 'time_entry_reports', :action => 'report'
+ should_route :get, "/projects/567/time_entries/report", :controller => 'time_entry_reports', :action => 'report', :project_id => '567'
+ should_route :get, "/projects/567/time_entries/report.csv", :controller => 'time_entry_reports', :action => 'report', :project_id => '567', :format => 'csv'
end
context "users" do
should_route :get, "/users", :controller => 'users', :action => 'index'
should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44'
- should_route :get, "/users/new", :controller => 'users', :action => 'add'
+ should_route :get, "/users/new", :controller => 'users', :action => 'new'
should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444'
should_route :get, "/users/222/edit/membership", :controller => 'users', :action => 'edit', :id => '222', :tab => 'membership'
- should_route :post, "/users/new", :controller => 'users', :action => 'add'
- should_route :post, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444'
+ should_route :post, "/users", :controller => 'users', :action => 'create'
should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123'
should_route :post, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55'
should_route :post, "/users/567/memberships/12/destroy", :controller => 'users', :action => 'destroy_membership', :id => '567', :membership_id => '12'
+
+ should_route :put, "/users/444", :controller => 'users', :action => 'update', :id => '444'
end
# TODO: should they all be scoped under /projects/:project_id ?
@@ -269,23 +311,27 @@
end
context "wiki (singular, project's pages)" do
- should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'index', :id => '567'
- should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'index', :id => '567', :page => 'lalala'
- should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :id => '567', :page => 'my_page'
- should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :id => '1', :page => 'CookBook_documentation'
- should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2/vs/1", :controller => 'wiki', :action => 'diff', :id => '1', :page => 'CookBook_documentation', :version => '2', :version_from => '1'
- should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :id => '1', :page => 'CookBook_documentation', :version => '2'
- should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :id => '22', :page => 'ladida'
- should_route :get, "/projects/567/wiki/page_index", :controller => 'wiki', :action => 'special', :id => '567', :page => 'page_index'
- should_route :get, "/projects/567/wiki/Page_Index", :controller => 'wiki', :action => 'special', :id => '567', :page => 'Page_Index'
- should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'special', :id => '567', :page => 'date_index'
- should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'special', :id => '567', :page => 'export'
+ should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'show', :project_id => '567'
+ should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'show', :project_id => '567', :id => 'lalala'
+ should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :project_id => '567', :id => 'my_page'
+ should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :project_id => '1', :id => 'CookBook_documentation'
+ should_route :get, "/projects/1/wiki/CookBook_documentation/diff", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation'
+ should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2'
+ should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2/vs/1", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2', :version_from => '1'
+ should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :project_id => '1', :id => 'CookBook_documentation', :version => '2'
+ should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida'
+ should_route :get, "/projects/567/wiki/index", :controller => 'wiki', :action => 'index', :project_id => '567'
+ should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'date_index', :project_id => '567'
+ should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'export', :project_id => '567'
- should_route :post, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :id => '567', :page => 'my_page'
- should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :id => '567', :page => 'CookBook_documentation'
- should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :id => '22', :page => 'ladida'
- should_route :post, "/projects/22/wiki/ladida/destroy", :controller => 'wiki', :action => 'destroy', :id => '22', :page => 'ladida'
- should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :id => '22', :page => 'ladida'
+ should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :project_id => '567', :id => 'CookBook_documentation'
+ should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida'
+ should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :project_id => '22', :id => 'ladida'
+ should_route :post, "/projects/22/wiki/ladida/add_attachment", :controller => 'wiki', :action => 'add_attachment', :project_id => '22', :id => 'ladida'
+
+ should_route :put, "/projects/567/wiki/my_page", :controller => 'wiki', :action => 'update', :project_id => '567', :id => 'my_page'
+
+ should_route :delete, "/projects/22/wiki/ladida", :controller => 'wiki', :action => 'destroy', :project_id => '22', :id => 'ladida'
end
context "wikis (plural, admin setup)" do
diff -r 09b1d4349da3 -r 371eac10df0b test/mocks/.svn/entries
--- a/test/mocks/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/mocks/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test/mocks
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b test/mocks/development/.svn/entries
--- a/test/mocks/development/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/mocks/development/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test/mocks/development
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b test/mocks/test/.svn/entries
--- a/test/mocks/test/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/mocks/test/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test/mocks/test
http://redmine.rubyforge.org/svn
diff -r 09b1d4349da3 -r 371eac10df0b test/test_helper.rb
--- a/test/test_helper.rb Thu Oct 21 11:19:14 2010 +0100
+++ b/test/test_helper.rb Wed Nov 24 12:20:08 2010 +0000
@@ -113,11 +113,15 @@
def self.repository_configured?(vendor)
File.directory?(repository_path(vendor))
end
+
+ def assert_error_tag(options={})
+ assert_tag({:tag => 'p', :attributes => { :id => 'errorExplanation' }}.merge(options))
+ end
# Shoulda macros
def self.should_render_404
should_respond_with :not_found
- should_render_template 'common/404'
+ should_render_template 'common/error'
end
def self.should_have_before_filter(expected_method, options = {})
@@ -181,4 +185,236 @@
assert !user.new_record?
end
end
+
+ # Test that a request allows the three types of API authentication
+ #
+ # * HTTP Basic with username and password
+ # * HTTP Basic with an api key for the username
+ # * Key based with the key=X parameter
+ #
+ # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
+ # @param [String] url the request url
+ # @param [optional, Hash] parameters additional request parameters
+ # @param [optional, Hash] options additional options
+ # @option options [Symbol] :success_code Successful response code (:success)
+ # @option options [Symbol] :failure_code Failure response code (:unauthorized)
+ def self.should_allow_api_authentication(http_method, url, parameters={}, options={})
+ should_allow_http_basic_auth_with_username_and_password(http_method, url, parameters, options)
+ should_allow_http_basic_auth_with_key(http_method, url, parameters, options)
+ should_allow_key_based_auth(http_method, url, parameters, options)
+ end
+
+ # Test that a request allows the username and password for HTTP BASIC
+ #
+ # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
+ # @param [String] url the request url
+ # @param [optional, Hash] parameters additional request parameters
+ # @param [optional, Hash] options additional options
+ # @option options [Symbol] :success_code Successful response code (:success)
+ # @option options [Symbol] :failure_code Failure response code (:unauthorized)
+ def self.should_allow_http_basic_auth_with_username_and_password(http_method, url, parameters={}, options={})
+ success_code = options[:success_code] || :success
+ failure_code = options[:failure_code] || :unauthorized
+
+ context "should allow http basic auth using a username and password for #{http_method} #{url}" do
+ context "with a valid HTTP authentication" do
+ setup do
+ @user = User.generate_with_protected!(:password => 'my_password', :password_confirmation => 'my_password', :admin => true) # Admin so they can access the project
+ @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'my_password')
+ send(http_method, url, parameters, {:authorization => @authorization})
+ end
+
+ should_respond_with success_code
+ should_respond_with_content_type_based_on_url(url)
+ should "login as the user" do
+ assert_equal @user, User.current
+ end
+ end
+
+ context "with an invalid HTTP authentication" do
+ setup do
+ @user = User.generate_with_protected!
+ @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@user.login, 'wrong_password')
+ send(http_method, url, parameters, {:authorization => @authorization})
+ end
+
+ should_respond_with failure_code
+ should_respond_with_content_type_based_on_url(url)
+ should "not login as the user" do
+ assert_equal User.anonymous, User.current
+ end
+ end
+
+ context "without credentials" do
+ setup do
+ send(http_method, url, parameters, {:authorization => ''})
+ end
+
+ should_respond_with failure_code
+ should_respond_with_content_type_based_on_url(url)
+ should "include_www_authenticate_header" do
+ assert @controller.response.headers.has_key?('WWW-Authenticate')
+ end
+ end
+ end
+
+ end
+
+ # Test that a request allows the API key with HTTP BASIC
+ #
+ # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
+ # @param [String] url the request url
+ # @param [optional, Hash] parameters additional request parameters
+ # @param [optional, Hash] options additional options
+ # @option options [Symbol] :success_code Successful response code (:success)
+ # @option options [Symbol] :failure_code Failure response code (:unauthorized)
+ def self.should_allow_http_basic_auth_with_key(http_method, url, parameters={}, options={})
+ success_code = options[:success_code] || :success
+ failure_code = options[:failure_code] || :unauthorized
+
+ context "should allow http basic auth with a key for #{http_method} #{url}" do
+ context "with a valid HTTP authentication using the API token" do
+ setup do
+ @user = User.generate_with_protected!(:admin => true)
+ @token = Token.generate!(:user => @user, :action => 'api')
+ @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'X')
+ send(http_method, url, parameters, {:authorization => @authorization})
+ end
+
+ should_respond_with success_code
+ should_respond_with_content_type_based_on_url(url)
+ should_be_a_valid_response_string_based_on_url(url)
+ should "login as the user" do
+ assert_equal @user, User.current
+ end
+ end
+
+ context "with an invalid HTTP authentication" do
+ setup do
+ @user = User.generate_with_protected!
+ @token = Token.generate!(:user => @user, :action => 'feeds')
+ @authorization = ActionController::HttpAuthentication::Basic.encode_credentials(@token.value, 'X')
+ send(http_method, url, parameters, {:authorization => @authorization})
+ end
+
+ should_respond_with failure_code
+ should_respond_with_content_type_based_on_url(url)
+ should "not login as the user" do
+ assert_equal User.anonymous, User.current
+ end
+ end
+ end
+ end
+
+ # Test that a request allows full key authentication
+ #
+ # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete)
+ # @param [String] url the request url, without the key=ZXY parameter
+ # @param [optional, Hash] parameters additional request parameters
+ # @param [optional, Hash] options additional options
+ # @option options [Symbol] :success_code Successful response code (:success)
+ # @option options [Symbol] :failure_code Failure response code (:unauthorized)
+ def self.should_allow_key_based_auth(http_method, url, parameters={}, options={})
+ success_code = options[:success_code] || :success
+ failure_code = options[:failure_code] || :unauthorized
+
+ context "should allow key based auth using key=X for #{http_method} #{url}" do
+ context "with a valid api token" do
+ setup do
+ @user = User.generate_with_protected!(:admin => true)
+ @token = Token.generate!(:user => @user, :action => 'api')
+ # Simple url parse to add on ?key= or &key=
+ request_url = if url.match(/\?/)
+ url + "&key=#{@token.value}"
+ else
+ url + "?key=#{@token.value}"
+ end
+ send(http_method, request_url, parameters)
+ end
+
+ should_respond_with success_code
+ should_respond_with_content_type_based_on_url(url)
+ should_be_a_valid_response_string_based_on_url(url)
+ should "login as the user" do
+ assert_equal @user, User.current
+ end
+ end
+
+ context "with an invalid api token" do
+ setup do
+ @user = User.generate_with_protected!
+ @token = Token.generate!(:user => @user, :action => 'feeds')
+ # Simple url parse to add on ?key= or &key=
+ request_url = if url.match(/\?/)
+ url + "&key=#{@token.value}"
+ else
+ url + "?key=#{@token.value}"
+ end
+ send(http_method, request_url, parameters)
+ end
+
+ should_respond_with failure_code
+ should_respond_with_content_type_based_on_url(url)
+ should "not login as the user" do
+ assert_equal User.anonymous, User.current
+ end
+ end
+ end
+
+ end
+
+ # Uses should_respond_with_content_type based on what's in the url:
+ #
+ # '/project/issues.xml' => should_respond_with_content_type :xml
+ # '/project/issues.json' => should_respond_with_content_type :json
+ #
+ # @param [String] url Request
+ def self.should_respond_with_content_type_based_on_url(url)
+ case
+ when url.match(/xml/i)
+ should_respond_with_content_type :xml
+ when url.match(/json/i)
+ should_respond_with_content_type :json
+ else
+ raise "Unknown content type for should_respond_with_content_type_based_on_url: #{url}"
+ end
+
+ end
+
+ # Uses the url to assert which format the response should be in
+ #
+ # '/project/issues.xml' => should_be_a_valid_xml_string
+ # '/project/issues.json' => should_be_a_valid_json_string
+ #
+ # @param [String] url Request
+ def self.should_be_a_valid_response_string_based_on_url(url)
+ case
+ when url.match(/xml/i)
+ should_be_a_valid_xml_string
+ when url.match(/json/i)
+ should_be_a_valid_json_string
+ else
+ raise "Unknown content type for should_be_a_valid_response_based_on_url: #{url}"
+ end
+
+ end
+
+ # Checks that the response is a valid JSON string
+ def self.should_be_a_valid_json_string
+ should "be a valid JSON string (or empty)" do
+ assert (response.body.blank? || ActiveSupport::JSON.decode(response.body))
+ end
+ end
+
+ # Checks that the response is a valid XML string
+ def self.should_be_a_valid_xml_string
+ should "be a valid XML string" do
+ assert REXML::Document.new(response.body)
+ end
+ end
+
end
+
+# Simple module to "namespace" all of the API tests
+module ApiTest
+end
diff -r 09b1d4349da3 -r 371eac10df0b test/unit/.svn/all-wcprops
--- a/test/unit/.svn/all-wcprops Thu Oct 21 11:19:14 2010 +0100
+++ b/test/unit/.svn/all-wcprops Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
K 25
svn:wc:ra_dav:version-url
V 34
-/svn/!svn/ver/4167/trunk/test/unit
+/svn/!svn/ver/4408/trunk/test/unit
END
document_test.rb
K 25
@@ -19,7 +19,7 @@
K 25
svn:wc:ra_dav:version-url
V 57
-/svn/!svn/ver/3828/trunk/test/unit/repository_git_test.rb
+/svn/!svn/ver/4189/trunk/test/unit/repository_git_test.rb
END
repository_mercurial_test.rb
K 25
@@ -55,7 +55,7 @@
K 25
svn:wc:ra_dav:version-url
V 48
-/svn/!svn/ver/4072/trunk/test/unit/issue_test.rb
+/svn/!svn/ver/4408/trunk/test/unit/issue_test.rb
END
issue_status_test.rb
K 25
@@ -87,18 +87,18 @@
V 60
/svn/!svn/ver/2887/trunk/test/unit/repository_bazaar_test.rb
END
+role_test.rb
+K 25
+svn:wc:ra_dav:version-url
+V 47
+/svn/!svn/ver/3363/trunk/test/unit/role_test.rb
+END
changeset_test.rb
K 25
svn:wc:ra_dav:version-url
V 52
/svn/!svn/ver/3466/trunk/test/unit/changeset_test.rb
END
-role_test.rb
-K 25
-svn:wc:ra_dav:version-url
-V 47
-/svn/!svn/ver/3363/trunk/test/unit/role_test.rb
-END
comment_test.rb
K 25
svn:wc:ra_dav:version-url
@@ -139,7 +139,19 @@
K 25
svn:wc:ra_dav:version-url
V 47
-/svn/!svn/ver/4058/trunk/test/unit/user_test.rb
+/svn/!svn/ver/4233/trunk/test/unit/user_test.rb
+END
+mail_handler_test.rb
+K 25
+svn:wc:ra_dav:version-url
+V 55
+/svn/!svn/ver/4404/trunk/test/unit/mail_handler_test.rb
+END
+repository_test.rb
+K 25
+svn:wc:ra_dav:version-url
+V 53
+/svn/!svn/ver/4221/trunk/test/unit/repository_test.rb
END
time_entry_test.rb
K 25
@@ -147,17 +159,11 @@
V 53
/svn/!svn/ver/4087/trunk/test/unit/time_entry_test.rb
END
-repository_test.rb
+principal_test.rb
K 25
svn:wc:ra_dav:version-url
-V 53
-/svn/!svn/ver/2895/trunk/test/unit/repository_test.rb
-END
-mail_handler_test.rb
-K 25
-svn:wc:ra_dav:version-url
-V 55
-/svn/!svn/ver/3801/trunk/test/unit/mail_handler_test.rb
+V 52
+/svn/!svn/ver/3152/trunk/test/unit/principal_test.rb
END
auth_source_ldap_test.rb
K 25
@@ -165,11 +171,17 @@
V 59
/svn/!svn/ver/3492/trunk/test/unit/auth_source_ldap_test.rb
END
-principal_test.rb
+journal_observer_test.rb
K 25
svn:wc:ra_dav:version-url
-V 52
-/svn/!svn/ver/3152/trunk/test/unit/principal_test.rb
+V 59
+/svn/!svn/ver/4221/trunk/test/unit/journal_observer_test.rb
+END
+project_nested_set_test.rb
+K 25
+svn:wc:ra_dav:version-url
+V 61
+/svn/!svn/ver/3354/trunk/test/unit/project_nested_set_test.rb
END
repository_filesystem_test.rb
K 25
@@ -177,12 +189,6 @@
V 64
/svn/!svn/ver/2887/trunk/test/unit/repository_filesystem_test.rb
END
-project_nested_set_test.rb
-K 25
-svn:wc:ra_dav:version-url
-V 61
-/svn/!svn/ver/3354/trunk/test/unit/project_nested_set_test.rb
-END
wiki_redirect_test.rb
K 25
svn:wc:ra_dav:version-url
@@ -271,7 +277,7 @@
K 25
svn:wc:ra_dav:version-url
V 48
-/svn/!svn/ver/4106/trunk/test/unit/query_test.rb
+/svn/!svn/ver/4260/trunk/test/unit/query_test.rb
END
search_test.rb
K 25
@@ -283,7 +289,7 @@
K 25
svn:wc:ra_dav:version-url
V 50
-/svn/!svn/ver/4072/trunk/test/unit/project_test.rb
+/svn/!svn/ver/4391/trunk/test/unit/project_test.rb
END
custom_value_test.rb
K 25
@@ -301,7 +307,7 @@
K 25
svn:wc:ra_dav:version-url
V 49
-/svn/!svn/ver/4167/trunk/test/unit/mailer_test.rb
+/svn/!svn/ver/4362/trunk/test/unit/mailer_test.rb
END
news_test.rb
K 25
diff -r 09b1d4349da3 -r 371eac10df0b test/unit/.svn/entries
--- a/test/unit/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/unit/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,15 +1,15 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test/unit
http://redmine.rubyforge.org/svn
-2010-09-20T23:17:51.402972Z
-4167
-edavis10
+2010-11-14T16:51:10.651861Z
+4408
+jplang
@@ -100,10 +100,10 @@
-2010-09-23T14:37:45.507762Z
-b599c36bc2156f6812220a40f054d41e
-2010-07-06T02:07:46.557097Z
-3828
+2010-11-19T13:04:41.337562Z
+7c656f1b1b7984259ebf4d29bdc629a5
+2010-09-26T21:54:52.929683Z
+4189
edavis10
has-props
@@ -304,11 +304,11 @@
-2010-09-24T12:48:25.791803Z
-0e1f710ecc564f8951d5f5805c440bc8
-2010-09-10T03:09:02.311267Z
-4072
-edavis10
+2010-11-19T13:04:41.337562Z
+b66aaf32f10148354e6319cd7ae7ca27
+2010-11-14T16:51:10.651861Z
+4408
+jplang
has-props
@@ -330,7 +330,7 @@
-26011
+29577
issue_status_test.rb
file
@@ -502,6 +502,43 @@
3118
+helpers
+dir
+
+role_test.rb
+file
+
+
+
+
+2010-09-23T14:37:45.507762Z
+01913aeac402c002ff86c6497513c795
+2010-02-03T17:47:47.868223Z
+3363
+edavis10
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3049
+
changeset_test.rb
file
@@ -536,43 +573,6 @@
4805
-role_test.rb
-file
-
-
-
-
-2010-09-23T14:37:45.507762Z
-01913aeac402c002ff86c6497513c795
-2010-02-03T17:47:47.868223Z
-3363
-edavis10
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3049
-
-helpers
-dir
-
comment_test.rb
file
@@ -786,10 +786,10 @@
-2010-09-24T12:48:25.791803Z
-ee0a9f52ec52313eb2a7e6496590a3fc
-2010-09-03T20:16:00.529106Z
-4058
+2010-11-19T13:04:41.341624Z
+59e73a45159ae21d5dc53098f8e1b637
+2010-10-06T05:08:31.041293Z
+4233
jbbarth
has-props
@@ -812,75 +812,7 @@
-13887
-
-mail_handler_test.rb
-file
-
-
-
-
-2010-09-23T14:37:45.503764Z
-53cf7d3c94f63febd50685da486d8adf
-2010-06-20T16:22:36.211973Z
-3801
-edavis10
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-14765
-
-repository_test.rb
-file
-
-
-
-
-2010-09-23T14:37:45.507762Z
-fe604b00b9f78fbe70c9c48bac2cd05d
-2009-09-20T14:06:57.257282Z
-2895
-jplang
-has-props
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-6407
+17550
time_entry_test.rb
file
@@ -916,39 +848,73 @@
3574
-principal_test.rb
+repository_test.rb
file
-2010-09-23T14:37:45.503764Z
-f36cb1e2cd1746903fbd8d269179f177
-2009-12-12T06:18:40.500267Z
-3152
+2010-11-19T13:04:41.341624Z
+61d46cec13bffa4dce694de6c0fb0c93
+2010-09-28T20:20:00.843023Z
+4221
edavis10
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2073
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+6469
+
+mail_handler_test.rb
+file
+
+
+
+
+2010-11-19T13:04:41.341624Z
+b5e8191d182e090ce55ccd46b3cc3954
+2010-11-14T13:48:01.671461Z
+4404
+jplang
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+17912
auth_source_ldap_test.rb
file
@@ -984,6 +950,74 @@
2788
+principal_test.rb
+file
+
+
+
+
+2010-09-23T14:37:45.503764Z
+f36cb1e2cd1746903fbd8d269179f177
+2009-12-12T06:18:40.500267Z
+3152
+edavis10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2073
+
+journal_observer_test.rb
+file
+
+
+
+
+2010-11-19T13:04:41.341624Z
+b8ca46992b1064fd7f35c44663a40358
+2010-09-28T20:20:00.843023Z
+4221
+edavis10
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3954
+
repository_filesystem_test.rb
file
@@ -1534,10 +1568,10 @@
-2010-09-24T12:48:25.791803Z
-950344f6f29a4c954bd631c9ab64b447
-2010-09-20T02:55:32.251493Z
-4106
+2010-11-19T13:04:41.341624Z
+e84894671a39a3e44cd69ad6e4d6f9d9
+2010-10-16T00:00:23.359489Z
+4260
edavis10
has-props
@@ -1560,7 +1594,7 @@
-20070
+20090
search_test.rb
file
@@ -1602,11 +1636,11 @@
-2010-09-24T12:48:25.791803Z
-987d196dcce3cb336836d449fd1cbd78
-2010-09-10T03:09:02.311267Z
-4072
-edavis10
+2010-11-19T13:04:41.341624Z
+5cb6742ca68637e837794c7a912a1c71
+2010-11-11T13:39:14.764400Z
+4391
+jplang
has-props
@@ -1628,7 +1662,7 @@
-35653
+37951
custom_value_test.rb
file
@@ -1704,10 +1738,10 @@
-2010-09-24T12:48:25.791803Z
-53a7d37c2d3f37d4bd092f325cd8d9ac
-2010-09-20T23:17:51.402972Z
-4167
+2010-11-19T13:04:41.341624Z
+59e4140b58e03b066b15f7213c23fc6d
+2010-11-02T19:00:36.834304Z
+4362
edavis10
has-props
@@ -1730,7 +1764,7 @@
-13583
+13954
news_test.rb
file
diff -r 09b1d4349da3 -r 371eac10df0b test/unit/.svn/text-base/issue_test.rb.svn-base
--- a/test/unit/.svn/text-base/issue_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/unit/.svn/text-base/issue_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -503,6 +503,17 @@
assert !closed_statuses.empty?
end
+ def test_rescheduling_an_issue_should_reschedule_following_issue
+ issue1 = Issue.create!(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :subject => '-', :start_date => Date.today, :due_date => Date.today + 2)
+ issue2 = Issue.create!(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :subject => '-', :start_date => Date.today, :due_date => Date.today + 2)
+ IssueRelation.create!(:issue_from => issue1, :issue_to => issue2, :relation_type => IssueRelation::TYPE_PRECEDES)
+ assert_equal issue1.due_date + 1, issue2.reload.start_date
+
+ issue1.due_date = Date.today + 5
+ issue1.save!
+ assert_equal issue1.due_date + 1, issue2.reload.start_date
+ end
+
def test_overdue
assert Issue.new(:due_date => 1.day.ago.to_date).overdue?
assert !Issue.new(:due_date => Date.today).overdue?
@@ -532,9 +543,28 @@
assert Issue.new(:start_date => 100.days.ago.to_date, :due_date => Date.today, :done_ratio => 90).behind_schedule?
end
end
-
- def test_assignable_users
- assert_kind_of User, Issue.find(1).assignable_users.first
+
+ context "#assignable_users" do
+ should "be Users" do
+ assert_kind_of User, Issue.find(1).assignable_users.first
+ end
+
+ should "include the issue author" do
+ project = Project.find(1)
+ non_project_member = User.generate!
+ issue = Issue.generate_for_project!(project, :author => non_project_member)
+
+ assert issue.assignable_users.include?(non_project_member)
+ end
+
+ should "not show the issue author twice" do
+ assignable_user_ids = Issue.find(1).assignable_users.collect(&:id)
+ assert_equal 2, assignable_user_ids.length
+
+ assignable_user_ids.each do |user_id|
+ assert_equal 1, assignable_user_ids.select {|i| i == user_id}.length, "User #{user_id} appears more or less than once"
+ end
+ end
end
def test_create_should_send_email_notification
@@ -544,7 +574,7 @@
assert issue.save
assert_equal 1, ActionMailer::Base.deliveries.size
end
-
+
def test_stale_issue_should_not_send_email_notification
ActionMailer::Base.deliveries.clear
issue = Issue.find(1)
@@ -593,6 +623,9 @@
@issue = Issue.find(1)
@issue_status = IssueStatus.find(1)
@issue_status.update_attribute(:default_done_ratio, 50)
+ @issue2 = Issue.find(2)
+ @issue_status2 = IssueStatus.find(2)
+ @issue_status2.update_attribute(:default_done_ratio, 0)
end
context "with Setting.issue_done_ratio using the issue_field" do
@@ -602,6 +635,7 @@
should "read the issue's field" do
assert_equal 0, @issue.done_ratio
+ assert_equal 30, @issue2.done_ratio
end
end
@@ -612,6 +646,7 @@
should "read the Issue Status's default done ratio" do
assert_equal 50, @issue.done_ratio
+ assert_equal 0, @issue2.done_ratio
end
end
end
@@ -621,6 +656,9 @@
@issue = Issue.find(1)
@issue_status = IssueStatus.find(1)
@issue_status.update_attribute(:default_done_ratio, 50)
+ @issue2 = Issue.find(2)
+ @issue_status2 = IssueStatus.find(2)
+ @issue_status2.update_attribute(:default_done_ratio, 0)
end
context "with Setting.issue_done_ratio using the issue_field" do
@@ -630,8 +668,10 @@
should "not change the issue" do
@issue.update_done_ratio_from_issue_status
+ @issue2.update_done_ratio_from_issue_status
- assert_equal 0, @issue.done_ratio
+ assert_equal 0, @issue.read_attribute(:done_ratio)
+ assert_equal 30, @issue2.read_attribute(:done_ratio)
end
end
@@ -640,10 +680,12 @@
Setting.issue_done_ratio = 'issue_status'
end
- should "not change the issue's done ratio" do
+ should "change the issue's done ratio" do
@issue.update_done_ratio_from_issue_status
+ @issue2.update_done_ratio_from_issue_status
- assert_equal 50, @issue.done_ratio
+ assert_equal 50, @issue.read_attribute(:done_ratio)
+ assert_equal 0, @issue2.read_attribute(:done_ratio)
end
end
end
@@ -726,4 +768,49 @@
assert issue.save
assert_equal before, Issue.on_active_project.length
end
+
+ context "Issue#recipients" do
+ setup do
+ @project = Project.find(1)
+ @author = User.generate_with_protected!
+ @assignee = User.generate_with_protected!
+ @issue = Issue.generate_for_project!(@project, :assigned_to => @assignee, :author => @author)
+ end
+
+ should "include project recipients" do
+ assert @project.recipients.present?
+ @project.recipients.each do |project_recipient|
+ assert @issue.recipients.include?(project_recipient)
+ end
+ end
+
+ should "include the author if the author is active" do
+ assert @issue.author, "No author set for Issue"
+ assert @issue.recipients.include?(@issue.author.mail)
+ end
+
+ should "include the assigned to user if the assigned to user is active" do
+ assert @issue.assigned_to, "No assigned_to set for Issue"
+ assert @issue.recipients.include?(@issue.assigned_to.mail)
+ end
+
+ should "not include users who opt out of all email" do
+ @author.update_attribute(:mail_notification, :none)
+
+ assert !@issue.recipients.include?(@issue.author.mail)
+ end
+
+ should "not include the issue author if they are only notified of assigned issues" do
+ @author.update_attribute(:mail_notification, :only_assigned)
+
+ assert !@issue.recipients.include?(@issue.author.mail)
+ end
+
+ should "not include the assigned user if they are only notified of owned issues" do
+ @assignee.update_attribute(:mail_notification, :only_owner)
+
+ assert !@issue.recipients.include?(@issue.assigned_to.mail)
+ end
+
+ end
end
diff -r 09b1d4349da3 -r 371eac10df0b test/unit/.svn/text-base/journal_observer_test.rb.svn-base
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/unit/.svn/text-base/journal_observer_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -0,0 +1,118 @@
+# redMine - project management software
+# Copyright (C) 2006-2009 Jean-Philippe Lang
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+require File.dirname(__FILE__) + '/../test_helper'
+
+class JournalObserverTest < ActiveSupport::TestCase
+ fixtures :issues, :issue_statuses, :journals, :journal_details
+
+ def setup
+ ActionMailer::Base.deliveries.clear
+ @journal = Journal.find 1
+ end
+
+ # context: issue_updated notified_events
+ def test_create_should_send_email_notification_with_issue_updated
+ Setting.notified_events = ['issue_updated']
+ issue = Issue.find(:first)
+ user = User.find(:first)
+ journal = issue.init_journal(user, issue)
+
+ assert journal.save
+ assert_equal 1, ActionMailer::Base.deliveries.size
+ end
+
+ def test_create_should_not_send_email_notification_without_issue_updated
+ Setting.notified_events = []
+ issue = Issue.find(:first)
+ user = User.find(:first)
+ journal = issue.init_journal(user, issue)
+
+ assert journal.save
+ assert_equal 0, ActionMailer::Base.deliveries.size
+ end
+
+ # context: issue_note_added notified_events
+ def test_create_should_send_email_notification_with_issue_note_added
+ Setting.notified_events = ['issue_note_added']
+ issue = Issue.find(:first)
+ user = User.find(:first)
+ journal = issue.init_journal(user, issue)
+ journal.notes = 'This update has a note'
+
+ assert journal.save
+ assert_equal 1, ActionMailer::Base.deliveries.size
+ end
+
+ def test_create_should_not_send_email_notification_without_issue_note_added
+ Setting.notified_events = []
+ issue = Issue.find(:first)
+ user = User.find(:first)
+ journal = issue.init_journal(user, issue)
+ journal.notes = 'This update has a note'
+
+ assert journal.save
+ assert_equal 0, ActionMailer::Base.deliveries.size
+ end
+
+ # context: issue_status_updated notified_events
+ def test_create_should_send_email_notification_with_issue_status_updated
+ Setting.notified_events = ['issue_status_updated']
+ issue = Issue.find(:first)
+ user = User.find(:first)
+ issue.init_journal(user, issue)
+ issue.status = IssueStatus.last
+
+ assert issue.save
+ assert_equal 1, ActionMailer::Base.deliveries.size
+ end
+
+ def test_create_should_not_send_email_notification_without_issue_status_updated
+ Setting.notified_events = []
+ issue = Issue.find(:first)
+ user = User.find(:first)
+ issue.init_journal(user, issue)
+ issue.status = IssueStatus.last
+
+ assert issue.save
+ assert_equal 0, ActionMailer::Base.deliveries.size
+ end
+
+ # context: issue_priority_updated notified_events
+ def test_create_should_send_email_notification_with_issue_priority_updated
+ Setting.notified_events = ['issue_priority_updated']
+ issue = Issue.find(:first)
+ user = User.find(:first)
+ issue.init_journal(user, issue)
+ issue.priority = IssuePriority.last
+
+ assert issue.save
+ assert_equal 1, ActionMailer::Base.deliveries.size
+ end
+
+ def test_create_should_not_send_email_notification_without_issue_priority_updated
+ Setting.notified_events = []
+ issue = Issue.find(:first)
+ user = User.find(:first)
+ issue.init_journal(user, issue)
+ issue.priority = IssuePriority.last
+
+ assert issue.save
+ assert_equal 0, ActionMailer::Base.deliveries.size
+ end
+
+end
diff -r 09b1d4349da3 -r 371eac10df0b test/unit/.svn/text-base/mail_handler_test.rb.svn-base
--- a/test/unit/.svn/text-base/mail_handler_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/unit/.svn/text-base/mail_handler_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -25,11 +25,13 @@
:roles,
:members,
:member_roles,
+ :users,
:issues,
:issue_statuses,
:workflows,
:trackers,
:projects_trackers,
+ :versions,
:enumerations,
:issue_categories,
:custom_fields,
@@ -41,6 +43,7 @@
def setup
ActionMailer::Base.deliveries.clear
+ Setting.notified_events = Redmine::Notifiable.all.collect(&:name)
end
def test_add_issue
@@ -58,6 +61,9 @@
assert_equal '2010-01-01', issue.start_date.to_s
assert_equal '2010-12-31', issue.due_date.to_s
assert_equal User.find_by_login('jsmith'), issue.assigned_to
+ assert_equal Version.find_by_name('alpha'), issue.fixed_version
+ assert_equal 2.5, issue.estimated_hours
+ assert_equal 30, issue.done_ratio
# keywords should be removed from the email body
assert !issue.description.match(/^Project:/i)
assert !issue.description.match(/^Status:/i)
@@ -152,7 +158,7 @@
assert !issue.new_record?
issue.reload
assert issue.watched_by?(User.find_by_mail('dlopper@somenet.foo'))
- assert_equal 1, issue.watchers.size
+ assert_equal 1, issue.watcher_user_ids.size
end
def test_add_issue_by_unknown_user
@@ -223,6 +229,34 @@
Role.anonymous.add_permission!(:add_issues)
assert_equal false, submit_email('ticket_without_from_header.eml')
end
+
+ def test_add_issue_with_invalid_attributes
+ issue = submit_email('ticket_with_invalid_attributes.eml', :allow_override => 'tracker,category,priority')
+ assert issue.is_a?(Issue)
+ assert !issue.new_record?
+ issue.reload
+ assert_nil issue.assigned_to
+ assert_nil issue.start_date
+ assert_nil issue.due_date
+ assert_equal 0, issue.done_ratio
+ assert_equal 'Normal', issue.priority.to_s
+ assert issue.description.include?('Lorem ipsum dolor sit amet, consectetuer adipiscing elit.')
+ end
+
+ def test_add_issue_with_localized_attributes
+ User.find_by_mail('jsmith@somenet.foo').update_attribute 'language', 'fr'
+ issue = submit_email('ticket_with_localized_attributes.eml', :allow_override => 'tracker,category,priority')
+ assert issue.is_a?(Issue)
+ assert !issue.new_record?
+ issue.reload
+ assert_equal 'New ticket on a given project', issue.subject
+ assert_equal User.find_by_login('jsmith'), issue.author
+ assert_equal Project.find(2), issue.project
+ assert_equal 'Feature request', issue.tracker.to_s
+ assert_equal 'Stock management', issue.category.to_s
+ assert_equal 'Urgent', issue.priority.to_s
+ assert issue.description.include?('Lorem ipsum dolor sit amet, consectetuer adipiscing elit.')
+ end
def test_add_issue_with_japanese_keywords
tracker = Tracker.create!(:name => '開発')
@@ -240,6 +274,7 @@
end
def test_add_issue_should_send_email_notification
+ Setting.notified_events = ['issue_added']
ActionMailer::Base.deliveries.clear
# This email contains: 'Project: onlinestore'
issue = submit_email('ticket_on_given_project.eml')
@@ -267,6 +302,7 @@
assert_equal '2010-01-01', issue.start_date.to_s
assert_equal '2010-12-31', issue.due_date.to_s
assert_equal User.find_by_login('jsmith'), issue.assigned_to
+ assert_equal 'Updated custom value', issue.custom_value_for(CustomField.find_by_name('Searchable field')).value
end
def test_add_issue_note_should_send_email_notification
@@ -333,6 +369,38 @@
end
end
+ context "with a single quoted reply (e.g. reply to a Redmine email notification)" do
+ setup do
+ Setting.mail_handler_body_delimiters = '--- Reply above. Do not remove this line. ---'
+ end
+
+ should "truncate the email at the delimiter with the quoted reply symbols (>)" do
+ journal = submit_email('issue_update_with_quoted_reply_above.eml')
+ assert journal.is_a?(Journal)
+ assert journal.notes.include?('An update to the issue by the sender.')
+ assert !journal.notes.match(Regexp.escape("--- Reply above. Do not remove this line. ---"))
+ assert !journal.notes.include?('Looks like the JSON api for projects was missed.')
+
+ end
+
+ end
+
+ context "with multiple quoted replies (e.g. reply to a reply of a Redmine email notification)" do
+ setup do
+ Setting.mail_handler_body_delimiters = '--- Reply above. Do not remove this line. ---'
+ end
+
+ should "truncate the email at the delimiter with the quoted reply symbols (>)" do
+ journal = submit_email('issue_update_with_multiple_quoted_reply_above.eml')
+ assert journal.is_a?(Journal)
+ assert journal.notes.include?('An update to the issue by the sender.')
+ assert !journal.notes.match(Regexp.escape("--- Reply above. Do not remove this line. ---"))
+ assert !journal.notes.include?('Looks like the JSON api for projects was missed.')
+
+ end
+
+ end
+
context "with multiple strings" do
setup do
Setting.mail_handler_body_delimiters = "---\nBREAK"
diff -r 09b1d4349da3 -r 371eac10df0b test/unit/.svn/text-base/mailer_test.rb.svn-base
--- a/test/unit/.svn/text-base/mailer_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/unit/.svn/text-base/mailer_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -393,4 +393,21 @@
# should restore perform_deliveries
assert ActionMailer::Base.perform_deliveries
end
+
+ context "layout" do
+ should "include the emails_header" do
+ with_settings(:emails_header => "*Header content*") do
+ assert Mailer.deliver_test(User.find(1))
+
+ assert_select_email do
+ assert_select ".header" do
+ assert_select "strong", :text => "Header content"
+ end
+ end
+ end
+
+ end
+
+ end
+
end
diff -r 09b1d4349da3 -r 371eac10df0b test/unit/.svn/text-base/project_test.rb.svn-base
--- a/test/unit/.svn/text-base/project_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/unit/.svn/text-base/project_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -29,7 +29,6 @@
should_validate_presence_of :name
should_validate_presence_of :identifier
- should_validate_uniqueness_of :name
should_validate_uniqueness_of :identifier
context "associations" do
@@ -102,6 +101,7 @@
@ecookbook.reload
assert !@ecookbook.active?
+ assert @ecookbook.archived?
assert !user.projects.include?(@ecookbook)
# Subproject are also archived
assert !@ecookbook.children.empty?
@@ -129,6 +129,7 @@
assert @ecookbook.unarchive
@ecookbook.reload
assert @ecookbook.active?
+ assert !@ecookbook.archived?
assert user.projects.include?(@ecookbook)
# Subproject can now be unarchived
@ecookbook_sub1.reload
@@ -860,6 +861,8 @@
assert_nil @project.start_date
end
+
+ should "be tested when issues have no start date"
should "be the earliest start date of it's issues" do
early = 7.days.ago.to_date
@@ -889,6 +892,8 @@
assert_nil @project.due_date
end
+
+ should "be tested when issues have no due date"
should "be the latest due date of it's issues" do
future = 7.days.from_now.to_date
@@ -960,4 +965,54 @@
end
end
+
+ context "#notified_users" do
+ setup do
+ @project = Project.generate!
+ @role = Role.generate!
+
+ @user_with_membership_notification = User.generate!(:mail_notification => 'selected')
+ Member.generate!(:project => @project, :roles => [@role], :principal => @user_with_membership_notification, :mail_notification => true)
+
+ @all_events_user = User.generate!(:mail_notification => 'all')
+ Member.generate!(:project => @project, :roles => [@role], :principal => @all_events_user)
+
+ @no_events_user = User.generate!(:mail_notification => 'none')
+ Member.generate!(:project => @project, :roles => [@role], :principal => @no_events_user)
+
+ @only_my_events_user = User.generate!(:mail_notification => 'only_my_events')
+ Member.generate!(:project => @project, :roles => [@role], :principal => @only_my_events_user)
+
+ @only_assigned_user = User.generate!(:mail_notification => 'only_assigned')
+ Member.generate!(:project => @project, :roles => [@role], :principal => @only_assigned_user)
+
+ @only_owned_user = User.generate!(:mail_notification => 'only_owner')
+ Member.generate!(:project => @project, :roles => [@role], :principal => @only_owned_user)
+ end
+
+ should "include members with a mail notification" do
+ assert @project.notified_users.include?(@user_with_membership_notification)
+ end
+
+ should "include users with the 'all' notification option" do
+ assert @project.notified_users.include?(@all_events_user)
+ end
+
+ should "not include users with the 'none' notification option" do
+ assert !@project.notified_users.include?(@no_events_user)
+ end
+
+ should "not include users with the 'only_my_events' notification option" do
+ assert !@project.notified_users.include?(@only_my_events_user)
+ end
+
+ should "not include users with the 'only_assigned' notification option" do
+ assert !@project.notified_users.include?(@only_assigned_user)
+ end
+
+ should "not include users with the 'only_owner' notification option" do
+ assert !@project.notified_users.include?(@only_owned_user)
+ end
+ end
+
end
diff -r 09b1d4349da3 -r 371eac10df0b test/unit/.svn/text-base/query_test.rb.svn-base
--- a/test/unit/.svn/text-base/query_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/unit/.svn/text-base/query_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -397,8 +397,8 @@
group2 = Group.generate!.reload
expected_group_list = [
- [group1.name, group1.id],
- [group2.name, group2.id]
+ [group1.name, group1.id.to_s],
+ [group2.name, group2.id.to_s]
]
assert_equal expected_group_list.sort, @query.available_filters["member_of_group"][:values].sort
end
@@ -415,14 +415,14 @@
end
should "have a list of the Roles as values" do
- assert @query.available_filters["assigned_to_role"][:values].include?(['Manager',1])
- assert @query.available_filters["assigned_to_role"][:values].include?(['Developer',2])
- assert @query.available_filters["assigned_to_role"][:values].include?(['Reporter',3])
+ assert @query.available_filters["assigned_to_role"][:values].include?(['Manager','1'])
+ assert @query.available_filters["assigned_to_role"][:values].include?(['Developer','2'])
+ assert @query.available_filters["assigned_to_role"][:values].include?(['Reporter','3'])
end
should "not include the built in Roles as values" do
- assert ! @query.available_filters["assigned_to_role"][:values].include?(['Non member',4])
- assert ! @query.available_filters["assigned_to_role"][:values].include?(['Anonymous',5])
+ assert ! @query.available_filters["assigned_to_role"][:values].include?(['Non member','4'])
+ assert ! @query.available_filters["assigned_to_role"][:values].include?(['Anonymous','5'])
end
end
diff -r 09b1d4349da3 -r 371eac10df0b test/unit/.svn/text-base/repository_git_test.rb.svn-base
--- a/test/unit/.svn/text-base/repository_git_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/unit/.svn/text-base/repository_git_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -34,8 +34,8 @@
@repository.fetch_changesets
@repository.reload
- assert_equal 13, @repository.changesets.count
- assert_equal 22, @repository.changes.count
+ assert_equal 15, @repository.changesets.count
+ assert_equal 24, @repository.changes.count
commit = @repository.changesets.find(:first, :order => 'committed_on ASC')
assert_equal "Initial import.\nThe repository contains 3 files.", commit.comments
@@ -57,10 +57,10 @@
# Remove the 3 latest changesets
@repository.changesets.find(:all, :order => 'committed_on DESC', :limit => 3).each(&:destroy)
@repository.reload
- assert_equal 10, @repository.changesets.count
+ assert_equal 12, @repository.changesets.count
@repository.fetch_changesets
- assert_equal 13, @repository.changesets.count
+ assert_equal 15, @repository.changesets.count
end
else
puts "Git test repository NOT FOUND. Skipping unit tests !!!"
diff -r 09b1d4349da3 -r 371eac10df0b test/unit/.svn/text-base/repository_test.rb.svn-base
--- a/test/unit/.svn/text-base/repository_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/unit/.svn/text-base/repository_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -67,6 +67,7 @@
def test_scan_changesets_for_issue_ids
Setting.default_language = 'en'
+ Setting.notified_events = ['issue_added','issue_updated']
# choosing a status to apply to fix issues
Setting.commit_fix_status_id = IssueStatus.find(:first, :conditions => ["is_closed = ?", true]).id
diff -r 09b1d4349da3 -r 371eac10df0b test/unit/.svn/text-base/user_test.rb.svn-base
--- a/test/unit/.svn/text-base/user_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/unit/.svn/text-base/user_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -60,6 +60,18 @@
user.password, user.password_confirmation = "password", "password"
assert user.save
end
+
+ context "User#before_create" do
+ should "set the mail_notification to the default Setting" do
+ @user1 = User.generate_with_protected!
+ assert_equal 'only_my_events', @user1.mail_notification
+
+ with_settings :default_notification_option => 'all' do
+ @user2 = User.generate_with_protected!
+ assert_equal 'all', @user2.mail_notification
+ end
+ end
+ end
context "User.login" do
should "be case-insensitive." do
@@ -285,7 +297,7 @@
end
def test_mail_notification_all
- @jsmith.mail_notification = true
+ @jsmith.mail_notification = 'all'
@jsmith.notified_project_ids = []
@jsmith.save
@jsmith.reload
@@ -293,15 +305,15 @@
end
def test_mail_notification_selected
- @jsmith.mail_notification = false
+ @jsmith.mail_notification = 'selected'
@jsmith.notified_project_ids = [1]
@jsmith.save
@jsmith.reload
assert Project.find(1).recipients.include?(@jsmith.mail)
end
- def test_mail_notification_none
- @jsmith.mail_notification = false
+ def test_mail_notification_only_my_events
+ @jsmith.mail_notification = 'only_my_events'
@jsmith.notified_project_ids = []
@jsmith.save
@jsmith.reload
@@ -384,6 +396,23 @@
assert ! @dlopper.allowed_to?(:delete_messages, project) #Developper
end
end
+
+ context "with multiple projects" do
+ should "return false if array is empty" do
+ assert ! @admin.allowed_to?(:view_project, [])
+ end
+
+ should "return true only if user has permission on all these projects" do
+ assert @admin.allowed_to?(:view_project, Project.all)
+ assert ! @dlopper.allowed_to?(:view_project, Project.all) #cannot see Project(2)
+ assert @jsmith.allowed_to?(:edit_issues, @jsmith.projects) #Manager or Developer everywhere
+ assert ! @jsmith.allowed_to?(:delete_issue_watchers, @jsmith.projects) #Dev cannot delete_issue_watchers
+ end
+
+ should "behave correctly with arrays of 1 project" do
+ assert ! User.anonymous.allowed_to?(:delete_issues, [Project.first])
+ end
+ end
context "with options[:global]" do
should "authorize if user has at least one role that has this permission" do
@@ -398,6 +427,72 @@
end
end
+ context "User#notify_about?" do
+ context "Issues" do
+ setup do
+ @project = Project.find(1)
+ @author = User.generate_with_protected!
+ @assignee = User.generate_with_protected!
+ @issue = Issue.generate_for_project!(@project, :assigned_to => @assignee, :author => @author)
+ end
+
+ should "be true for a user with :all" do
+ @author.update_attribute(:mail_notification, :all)
+ assert @author.notify_about?(@issue)
+ end
+
+ should "be false for a user with :none" do
+ @author.update_attribute(:mail_notification, :none)
+ assert ! @author.notify_about?(@issue)
+ end
+
+ should "be false for a user with :only_my_events and isn't an author, creator, or assignee" do
+ @user = User.generate_with_protected!(:mail_notification => :only_my_events)
+ assert ! @user.notify_about?(@issue)
+ end
+
+ should "be true for a user with :only_my_events and is the author" do
+ @author.update_attribute(:mail_notification, :only_my_events)
+ assert @author.notify_about?(@issue)
+ end
+
+ should "be true for a user with :only_my_events and is the assignee" do
+ @assignee.update_attribute(:mail_notification, :only_my_events)
+ assert @assignee.notify_about?(@issue)
+ end
+
+ should "be true for a user with :only_assigned and is the assignee" do
+ @assignee.update_attribute(:mail_notification, :only_assigned)
+ assert @assignee.notify_about?(@issue)
+ end
+
+ should "be false for a user with :only_assigned and is not the assignee" do
+ @author.update_attribute(:mail_notification, :only_assigned)
+ assert ! @author.notify_about?(@issue)
+ end
+
+ should "be true for a user with :only_owner and is the author" do
+ @author.update_attribute(:mail_notification, :only_owner)
+ assert @author.notify_about?(@issue)
+ end
+
+ should "be false for a user with :only_owner and is not the author" do
+ @assignee.update_attribute(:mail_notification, :only_owner)
+ assert ! @assignee.notify_about?(@issue)
+ end
+
+ should "be false if the mail_notification is anything else" do
+ @assignee.update_attribute(:mail_notification, :somthing_else)
+ assert ! @assignee.notify_about?(@issue)
+ end
+
+ end
+
+ context "other events" do
+ should 'be added and tested'
+ end
+ end
+
if Object.const_defined?(:OpenID)
def test_setting_identity_url
diff -r 09b1d4349da3 -r 371eac10df0b test/unit/helpers/.svn/all-wcprops
--- a/test/unit/helpers/.svn/all-wcprops Thu Oct 21 11:19:14 2010 +0100
+++ b/test/unit/helpers/.svn/all-wcprops Wed Nov 24 12:20:08 2010 +0000
@@ -1,7 +1,7 @@
K 25
svn:wc:ra_dav:version-url
V 42
-/svn/!svn/ver/4072/trunk/test/unit/helpers
+/svn/!svn/ver/4377/trunk/test/unit/helpers
END
custom_fields_helper_test.rb
K 25
@@ -25,7 +25,7 @@
K 25
svn:wc:ra_dav:version-url
V 69
-/svn/!svn/ver/4072/trunk/test/unit/helpers/application_helper_test.rb
+/svn/!svn/ver/4377/trunk/test/unit/helpers/application_helper_test.rb
END
search_helper_test.rb
K 25
diff -r 09b1d4349da3 -r 371eac10df0b test/unit/helpers/.svn/entries
--- a/test/unit/helpers/.svn/entries Thu Oct 21 11:19:14 2010 +0100
+++ b/test/unit/helpers/.svn/entries Wed Nov 24 12:20:08 2010 +0000
@@ -1,15 +1,15 @@
10
dir
-4173
+4411
http://redmine.rubyforge.org/svn/trunk/test/unit/helpers
http://redmine.rubyforge.org/svn
-2010-09-10T03:09:02.311267Z
-4072
-edavis10
+2010-11-06T18:52:07.556711Z
+4377
+jplang
@@ -134,11 +134,11 @@
-2010-09-24T12:48:25.635718Z
-7f682835f4e55f0f74513fb50a363168
-2010-09-10T03:09:02.311267Z
-4072
-edavis10
+2010-11-19T13:04:41.233647Z
+93e1fbbe347fd0b1526df779b0244489
+2010-11-06T18:52:07.556711Z
+4377
+jplang
has-props
@@ -160,7 +160,7 @@
-29071
+29154
search_helper_test.rb
file
diff -r 09b1d4349da3 -r 371eac10df0b test/unit/helpers/.svn/text-base/application_helper_test.rb.svn-base
--- a/test/unit/helpers/.svn/text-base/application_helper_test.rb.svn-base Thu Oct 21 11:19:14 2010 +0100
+++ b/test/unit/helpers/.svn/text-base/application_helper_test.rb.svn-base Wed Nov 24 12:20:08 2010 +0000
@@ -1,5 +1,5 @@
# Redmine - project management software
-# Copyright (C) 2006-2009 Jean-Philippe Lang
+# Copyright (C) 2006-2010 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -49,15 +49,6 @@
assert_match /href/, response
end
- should "allow using the url for the target link" do
- User.current = User.find_by_login('admin')
-
- @project = Issue.first.project # Used by helper
- response = link_to_if_authorized("By url",
- new_issue_move_path(:id => Issue.first.id))
- assert_match /href/, response
- end
-
end
def test_auto_links
@@ -88,6 +79,8 @@
'http://example.net/path!602815048C7B5C20!302.html' => 'http://example.net/path!602815048C7B5C20!302.html',
# escaping
'http://foo"bar' => 'http://foo"bar',
+ # wrap in angle brackets
+ '' => '<http://foo.bar>'
}
to_test.each { |text, result| assert_equal "
#{result}
", textilizable(text) }
end
@@ -123,15 +116,6 @@
assert textilizable(raw).include?('')
end
- def test_acronyms
- to_test = {
- 'this is an acronym: GPL(General Public License)' => 'this is an acronym: GPL',
- 'GPL(This is a double-quoted "title")' => 'GPL',
- }
- to_test.each { |text, result| assert_equal "
', textilizable('Dashes: ---')
end
- def test_acronym
- assert_equal '
This is an acronym: ACLU.
',
- textilizable('This is an acronym: ACLU(American Civil Liberties Union).')
- end
-
def test_footnotes
raw = <<-RAW
This is some text[1].
@@ -443,25 +422,60 @@
h2. Subtitle with [[Wiki|another Wiki]] link
h2. Subtitle with %{color:red}red text%
+
+h3. Subtitle with *some* _modifiers_
h1. Another title
-h2. An "Internet link":http://www.redmine.org/ inside subtitle
+h3. An "Internet link":http://www.redmine.org/ inside subtitle
h2. "Project Name !/attachments/1234/logo_small.gif! !/attachments/5678/logo_2.png!":/projects/projectname/issues
RAW
- expected = '
', textilizable('Dashes: ---')
end
- def test_acronym
- assert_equal '
This is an acronym: ACLU.
',
- textilizable('This is an acronym: ACLU(American Civil Liberties Union).')
- end
-
def test_footnotes
raw = <<-RAW
This is some text[1].
@@ -443,25 +422,60 @@
h2. Subtitle with [[Wiki|another Wiki]] link
h2. Subtitle with %{color:red}red text%
+
+h3. Subtitle with *some* _modifiers_
h1. Another title
-h2. An "Internet link":http://www.redmine.org/ inside subtitle
+h3. An "Internet link":http://www.redmine.org/ inside subtitle
h2. "Project Name !/attachments/1234/logo_small.gif! !/attachments/5678/logo_2.png!":/projects/projectname/issues
RAW
- expected = '