Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 13ec81598b | |||
| a677817003 | |||
| abaeecbaa9 | |||
| 75d652d9e5 | |||
| 7e9dd78de8 | |||
| bd7542cf98 | |||
| a2c18b2037 | |||
| eb86e5e7e1 | |||
| fc26668cd9 | |||
| 2b42e3fc50 |
@@ -30,7 +30,7 @@ class AccountController < ApplicationController
|
|||||||
|
|
||||||
# show only public projects and private projects that the logged in user is also a member of
|
# show only public projects and private projects that the logged in user is also a member of
|
||||||
@memberships = @user.memberships.select do |membership|
|
@memberships = @user.memberships.select do |membership|
|
||||||
membership.project.is_public? || (User.current.role_for_project(membership.project))
|
membership.project.is_public? || (User.current.member_of?(membership.project))
|
||||||
end
|
end
|
||||||
rescue ActiveRecord::RecordNotFound
|
rescue ActiveRecord::RecordNotFound
|
||||||
render_404
|
render_404
|
||||||
|
|||||||
@@ -339,7 +339,7 @@ class ProjectsController < ApplicationController
|
|||||||
def add_file
|
def add_file
|
||||||
if request.post?
|
if request.post?
|
||||||
@version = @project.versions.find_by_id(params[:version_id])
|
@version = @project.versions.find_by_id(params[:version_id])
|
||||||
attachments = attach_files(@issue, params[:attachments])
|
attachments = attach_files(@version, params[:attachments])
|
||||||
Mailer.deliver_attachments_added(attachments) if !attachments.empty? && Setting.notified_events.include?('file_added')
|
Mailer.deliver_attachments_added(attachments) if !attachments.empty? && Setting.notified_events.include?('file_added')
|
||||||
redirect_to :controller => 'projects', :action => 'list_files', :id => @project
|
redirect_to :controller => 'projects', :action => 'list_files', :id => @project
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ class AuthSourceLdap < AuthSource
|
|||||||
end
|
end
|
||||||
|
|
||||||
def authenticate(login, password)
|
def authenticate(login, password)
|
||||||
|
return nil if login.blank? || password.blank?
|
||||||
attrs = []
|
attrs = []
|
||||||
# get user's DN
|
# get user's DN
|
||||||
ldap_con = initialize_ldap_con(self.account, self.account_password)
|
ldap_con = initialize_ldap_con(self.account, self.account_password)
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ class User < ActiveRecord::Base
|
|||||||
|
|
||||||
# Returns the user that matches provided login and password, or nil
|
# Returns the user that matches provided login and password, or nil
|
||||||
def self.try_to_login(login, password)
|
def self.try_to_login(login, password)
|
||||||
|
# Make sure no one can sign in with an empty password
|
||||||
|
return nil if password.to_s.empty?
|
||||||
user = find(:first, :conditions => ["login=?", login])
|
user = find(:first, :conditions => ["login=?", login])
|
||||||
if user
|
if user
|
||||||
# user is already in local database
|
# user is already in local database
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<% user_projects_by_root = User.current.projects.find(:all, :include => :parent).group_by(&:root) %>
|
<% user_projects_by_root = User.current.projects.find(:all, :include => :parent).group_by(&:root) %>
|
||||||
<select onchange="if (this.value != '') { window.location = this.value; }">
|
<select onchange="if (this.value != '') { window.location = this.value; }">
|
||||||
<option selected><%= l(:label_jump_to_a_project) %></option>
|
<option selected="selected"><%= l(:label_jump_to_a_project) %></option>
|
||||||
<option disabled>---</option>
|
<option disabled="disabled">---</option>
|
||||||
<% user_projects_by_root.keys.sort.each do |root| %>
|
<% user_projects_by_root.keys.sort.each do |root| %>
|
||||||
<%= content_tag('option', h(root.name), :value => url_for(:controller => 'projects', :action => 'show', :id => root)) %>
|
<%= content_tag('option', h(root.name), :value => url_for(:controller => 'projects', :action => 'show', :id => root)) %>
|
||||||
<% user_projects_by_root[root].sort.each do |project| %>
|
<% user_projects_by_root[root].sort.each do |project| %>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title><%=h html_title %></title>
|
<title><%=h html_title %></title>
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
<div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
|
<div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
|
||||||
|
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
Powered by <%= link_to Redmine::Info.app_name, Redmine::Info.url %> <%= Redmine::VERSION %> © 2006-2007 Jean-Philippe Lang
|
Powered by <%= link_to Redmine::Info.app_name, Redmine::Info.url %> <%= Redmine::VERSION %> © 2006-2007 Jean-Philippe Lang
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<p><%= link_to(h(news.project.name), :controller => 'projects', :action => 'show', :id => news.project) + ': ' unless @project %>
|
<p><%= link_to(h(news.project.name), :controller => 'projects', :action => 'show', :id => news.project) + ': ' unless @project %>
|
||||||
<%= link_to h(news.title), :controller => 'news', :action => 'show', :id => news %>
|
<%= link_to h(news.title), :controller => 'news', :action => 'show', :id => news %>
|
||||||
<%= "(#{news.comments_count} #{lwr(:label_comment, news.comments_count).downcase})" if news.comments_count > 0 %></span>
|
<%= "(#{news.comments_count} #{lwr(:label_comment, news.comments_count).downcase})" if news.comments_count > 0 %>
|
||||||
<br />
|
<br />
|
||||||
<% unless news.summary.blank? %><span class="summary"><%=h news.summary %></span><br /><% end %>
|
<% unless news.summary.blank? %><span class="summary"><%=h news.summary %></span><br /><% end %>
|
||||||
<span class="author"><%= authoring news.created_on, news.author %></p>
|
<span class="author"><%= authoring news.created_on, news.author %></span></p>
|
||||||
|
|||||||
@@ -11,9 +11,9 @@
|
|||||||
<%= select_tag 'type', options_for_select([[l(:label_diff_inline), "inline"], [l(:label_diff_side_by_side), "sbs"]], @diff_type), :onchange => "if (this.value != '') {this.form.submit()}" %></p>
|
<%= select_tag 'type', options_for_select([[l(:label_diff_inline), "inline"], [l(:label_diff_side_by_side), "sbs"]], @diff_type), :onchange => "if (this.value != '') {this.form.submit()}" %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<div class="autoscroll">
|
|
||||||
<% cache(@cache_key) do %>
|
<% cache(@cache_key) do %>
|
||||||
<% @diff.each do |table_file| %>
|
<% @diff.each do |table_file| %>
|
||||||
|
<div class="autoscroll">
|
||||||
<% if @diff_type == 'sbs' %>
|
<% if @diff_type == 'sbs' %>
|
||||||
<table class="filecontent CodeRay">
|
<table class="filecontent CodeRay">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -84,9 +84,9 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% content_for :header_tags do %>
|
<% content_for :header_tags do %>
|
||||||
<%= stylesheet_link_tag "scm" %>
|
<%= stylesheet_link_tag "scm" %>
|
||||||
|
|||||||
@@ -24,12 +24,6 @@
|
|||||||
|
|
||||||
<%= link_to_attachments @page.attachments, :delete_url => (authorize_for('wiki', 'destroy_attachment') ? {:controller => 'wiki', :action => 'destroy_attachment', :page => @page.title} : nil) %>
|
<%= link_to_attachments @page.attachments, :delete_url => (authorize_for('wiki', 'destroy_attachment') ? {:controller => 'wiki', :action => 'destroy_attachment', :page => @page.title} : nil) %>
|
||||||
|
|
||||||
<div class="contextual">
|
|
||||||
<%= l(:label_export_to) %>
|
|
||||||
<%= link_to 'HTML', {:page => @page.title, :export => 'html', :version => @content.version}, :class => 'icon icon-html' %>,
|
|
||||||
<%= link_to 'TXT', {:page => @page.title, :export => 'txt', :version => @content.version}, :class => 'icon icon-txt' %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<% if authorize_for('wiki', 'add_attachment') %>
|
<% if authorize_for('wiki', 'add_attachment') %>
|
||||||
<p><%= toggle_link l(:label_attachment_new), "add_attachment_form" %></p>
|
<p><%= toggle_link l(:label_attachment_new), "add_attachment_form" %></p>
|
||||||
<% form_tag({ :controller => 'wiki', :action => 'add_attachment', :page => @page.title }, :multipart => true, :class => "tabular", :id => "add_attachment_form", :style => "display:none;") do %>
|
<% form_tag({ :controller => 'wiki', :action => 'add_attachment', :page => @page.title }, :multipart => true, :class => "tabular", :id => "add_attachment_form", :style => "display:none;") do %>
|
||||||
@@ -38,6 +32,13 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<div class="contextual">
|
||||||
|
<%= l(:label_export_to) %>
|
||||||
|
<%= link_to 'HTML', {:page => @page.title, :export => 'html', :version => @content.version}, :class => 'icon icon-html' %>,
|
||||||
|
<%= link_to 'TXT', {:page => @page.title, :export => 'txt', :version => @content.version}, :class => 'icon icon-txt' %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<% content_for :header_tags do %>
|
<% content_for :header_tags do %>
|
||||||
<%= stylesheet_link_tag 'scm' %>
|
<%= stylesheet_link_tag 'scm' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class AllowNullVersionEffectiveDate < ActiveRecord::Migration
|
class AllowNullVersionEffectiveDate < ActiveRecord::Migration
|
||||||
def self.up
|
def self.up
|
||||||
change_column :versions, :effective_date, :date, :default => nil
|
change_column :versions, :effective_date, :date, :default => nil, :null => true
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.down
|
def self.down
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
class AllowNullPosition < ActiveRecord::Migration
|
class AllowNullPosition < ActiveRecord::Migration
|
||||||
def self.up
|
def self.up
|
||||||
# removes the 'not null' constraint on position fields
|
# removes the 'not null' constraint on position fields
|
||||||
change_column :issue_statuses, :position, :integer, :default => 1
|
change_column :issue_statuses, :position, :integer, :default => 1, :null => true
|
||||||
change_column :roles, :position, :integer, :default => 1
|
change_column :roles, :position, :integer, :default => 1, :null => true
|
||||||
change_column :trackers, :position, :integer, :default => 1
|
change_column :trackers, :position, :integer, :default => 1, :null => true
|
||||||
change_column :boards, :position, :integer, :default => 1
|
change_column :boards, :position, :integer, :default => 1, :null => true
|
||||||
change_column :enumerations, :position, :integer, :default => 1
|
change_column :enumerations, :position, :integer, :default => 1, :null => true
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.down
|
def self.down
|
||||||
|
|||||||
+19
-1
@@ -1,10 +1,28 @@
|
|||||||
== Redmine changelog
|
== Redmine changelog
|
||||||
|
|
||||||
Redmine - project management software
|
Redmine - project management software
|
||||||
Copyright (C) 2006-2007 Jean-Philippe Lang
|
Copyright (C) 2006-2008 Jean-Philippe Lang
|
||||||
http://www.redmine.org/
|
http://www.redmine.org/
|
||||||
|
|
||||||
|
|
||||||
|
== 2007-03-12 v0.6.4
|
||||||
|
|
||||||
|
* Fixed: private projects name are displayed on account/show even if the current user doesn't have access to these private projects
|
||||||
|
* Fixed: potential LDAP authentication security flaw
|
||||||
|
* Fixed: context submenus on the issue list don't show up with IE6.
|
||||||
|
* Fixed: Themes are not applied with Rails 2.0
|
||||||
|
* Fixed: crash when fetching Mercurial changesets if changeset[:files] is nil
|
||||||
|
* Fixed: Mercurial repository browsing
|
||||||
|
* Fixed: undefined local variable or method 'log' in CvsAdapter when a cvs command fails
|
||||||
|
* Fixed: not null constraints not removed with Postgresql
|
||||||
|
* Doctype set to transitional
|
||||||
|
|
||||||
|
|
||||||
|
== 2007-12-18 v0.6.3
|
||||||
|
|
||||||
|
* Fixed: upload doesn't work in 'Files' section
|
||||||
|
|
||||||
|
|
||||||
== 2007-12-16 v0.6.2
|
== 2007-12-16 v0.6.2
|
||||||
|
|
||||||
* Search engine: issue custom fields can now be searched
|
* Search engine: issue custom fields can now be searched
|
||||||
|
|||||||
+2
-2
@@ -1,13 +1,13 @@
|
|||||||
== Redmine installation
|
== Redmine installation
|
||||||
|
|
||||||
Redmine - project management software
|
Redmine - project management software
|
||||||
Copyright (C) 2006-2007 Jean-Philippe Lang
|
Copyright (C) 2006-2008 Jean-Philippe Lang
|
||||||
http://www.redmine.org/
|
http://www.redmine.org/
|
||||||
|
|
||||||
|
|
||||||
== Requirements
|
== Requirements
|
||||||
|
|
||||||
* Ruby on Rails 1.2.5 or 2.0.1
|
* Ruby on Rails 1.2.6 or 2.0.2
|
||||||
* A database (see compatibility below)
|
* A database (see compatibility below)
|
||||||
|
|
||||||
Optional:
|
Optional:
|
||||||
|
|||||||
+2
-8
@@ -1,7 +1,7 @@
|
|||||||
== Redmine upgrade procedure
|
== Redmine upgrade procedure
|
||||||
|
|
||||||
Redmine - project management software
|
Redmine - project management software
|
||||||
Copyright (C) 2006-2007 Jean-Philippe Lang
|
Copyright (C) 2006-2008 Jean-Philippe Lang
|
||||||
http://www.redmine.org/
|
http://www.redmine.org/
|
||||||
|
|
||||||
|
|
||||||
@@ -20,16 +20,10 @@ http://www.redmine.org/
|
|||||||
|
|
||||||
6. Copy the RAILS_ROOT/files directory content into your new installation
|
6. Copy the RAILS_ROOT/files directory content into your new installation
|
||||||
|
|
||||||
Note 1: Rails 1.2.2 or higher is required for version 0.4.2 and later.
|
Note 1: Rails 1.2.6 or higher is required
|
||||||
|
|
||||||
Note 2: when upgrading your code with svn update, don't forget to clear
|
Note 2: when upgrading your code with svn update, don't forget to clear
|
||||||
the application cache (RAILS_ROOT/tmp/cache) before restarting.
|
the application cache (RAILS_ROOT/tmp/cache) before restarting.
|
||||||
|
|
||||||
Note 3: settings previously defined in custom_config.rb are now stored
|
Note 3: settings previously defined in custom_config.rb are now stored
|
||||||
in database, as of version 0.4.2. Go to "Admin -> Settings" to edit them.
|
in database, as of version 0.4.2. Go to "Admin -> Settings" to edit them.
|
||||||
|
|
||||||
|
|
||||||
== From 0.2.x and below
|
|
||||||
|
|
||||||
Due to major database changes since 0.2.x, there is no migration support
|
|
||||||
from 0.2.x and previous versions.
|
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ module Redmine
|
|||||||
end
|
end
|
||||||
rescue Errno::ENOENT => e
|
rescue Errno::ENOENT => e
|
||||||
# The command failed, log it and re-raise
|
# The command failed, log it and re-raise
|
||||||
log.error("SCM command failed: #{cmd}\n with: #{e.message}")
|
logger.error("SCM command failed: #{cmd}\n with: #{e.message}")
|
||||||
raise CommandFailed
|
raise CommandFailed
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -43,12 +43,12 @@ module Redmine
|
|||||||
def entries(path=nil, identifier=nil)
|
def entries(path=nil, identifier=nil)
|
||||||
path ||= ''
|
path ||= ''
|
||||||
entries = Entries.new
|
entries = Entries.new
|
||||||
cmd = "#{HG_BIN} -R #{target('')} --cwd #{target(path)} locate -X */*/*"
|
cmd = "#{HG_BIN} -R #{target('')} --cwd #{target(path)} locate"
|
||||||
cmd << " -r #{identifier.to_i}" if identifier
|
cmd << " -r #{identifier.to_i}" if identifier
|
||||||
cmd << " * */*"
|
cmd << " " + shell_quote('glob:**')
|
||||||
shellout(cmd) do |io|
|
shellout(cmd) do |io|
|
||||||
io.each_line do |line|
|
io.each_line do |line|
|
||||||
e = line.chomp.split('\\')
|
e = line.chomp.split(%r{[\/\\]})
|
||||||
entries << Entry.new({:name => e.first,
|
entries << Entry.new({:name => e.first,
|
||||||
:path => (path.empty? ? e.first : "#{path}/#{e.first}"),
|
:path => (path.empty? ? e.first : "#{path}/#{e.first}"),
|
||||||
:kind => (e.size > 1 ? 'dir' : 'file'),
|
:kind => (e.size > 1 ? 'dir' : 'file'),
|
||||||
@@ -112,7 +112,7 @@ module Redmine
|
|||||||
:author => changeset[:user],
|
:author => changeset[:user],
|
||||||
:time => Time.parse(changeset[:date]),
|
:time => Time.parse(changeset[:date]),
|
||||||
:message => changeset[:description],
|
:message => changeset[:description],
|
||||||
:paths => changeset[:files].split.collect{|path| {:action => 'X', :path => "/#{path}"}}
|
:paths => changeset[:files].to_s.split.collect{|path| {:action => 'X', :path => "/#{path}"}}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
return nil if $? && $?.exitstatus != 0
|
return nil if $? && $?.exitstatus != 0
|
||||||
|
|||||||
@@ -69,4 +69,8 @@ module ApplicationHelper
|
|||||||
super((@current_theme && @current_theme.stylesheets.include?(source)) ?
|
super((@current_theme && @current_theme.stylesheets.include?(source)) ?
|
||||||
"/themes/#{@current_theme.dir}/stylesheets/#{source}" : source)
|
"/themes/#{@current_theme.dir}/stylesheets/#{source}" : source)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def path_to_stylesheet(source)
|
||||||
|
stylesheet_path source
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ module Redmine
|
|||||||
module VERSION #:nodoc:
|
module VERSION #:nodoc:
|
||||||
MAJOR = 0
|
MAJOR = 0
|
||||||
MINOR = 6
|
MINOR = 6
|
||||||
TINY = 2
|
TINY = 4
|
||||||
|
|
||||||
def self.revision
|
def self.revision
|
||||||
revision = nil
|
revision = nil
|
||||||
|
|||||||
@@ -39,6 +39,9 @@ ContextMenu.prototype = {
|
|||||||
this.selection = tr;
|
this.selection = tr;
|
||||||
var id = tr.id.substring(6, tr.id.length);
|
var id = tr.id.substring(6, tr.id.length);
|
||||||
/* TODO: do not hard code path */
|
/* TODO: do not hard code path */
|
||||||
new Ajax.Updater({success:'context-menu'}, '../../issues/context_menu/' + id, {asynchronous:true, evalScripts:true, onComplete:function(request){Effect.Appear('context-menu', {duration: 0.20})}})
|
new Ajax.Updater({success:'context-menu'}, '../../issues/context_menu/' + id, {asynchronous:true, evalScripts:true, onComplete:function(request){
|
||||||
|
Effect.Appear('context-menu', {duration: 0.20});
|
||||||
|
if (window.parseStylesheets) { window.parseStylesheets(); }
|
||||||
|
}})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ hr { width: 100%; height: 1px; background: #ccc; border: 0;}
|
|||||||
textarea.wiki-edit { width: 99%; }
|
textarea.wiki-edit { width: 99%; }
|
||||||
li p {margin-top: 0;}
|
li p {margin-top: 0;}
|
||||||
div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;}
|
div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;}
|
||||||
.autoscroll {overflow-x: auto; padding:1px; width:100%;}
|
.autoscroll {overflow-x: auto; padding:1px; width:100%; margin-bottom: 1.2em;}
|
||||||
#user_firstname, #user_lastname, #user_mail, #my_account_form select { width: 90%; }
|
#user_firstname, #user_lastname, #user_mail, #my_account_form select { width: 90%; }
|
||||||
|
|
||||||
/***** Tabular forms ******/
|
/***** Tabular forms ******/
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
}
|
}
|
||||||
#context-menu li.folder ul {
|
#context-menu li.folder ul {
|
||||||
position:absolute;
|
position:absolute;
|
||||||
left:128px; /* IE */
|
left:168px; /* IE6 */
|
||||||
top:-2px;
|
top:-2px;
|
||||||
}
|
}
|
||||||
#context-menu li.folder>ul { left:148px; }
|
#context-menu li.folder>ul { left:148px; }
|
||||||
|
|||||||
@@ -117,4 +117,6 @@ function getElementsBySelect(rule) {
|
|||||||
|
|
||||||
return nodes;
|
return nodes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.parseStylesheets = parseStylesheets;
|
||||||
</script>
|
</script>
|
||||||
@@ -35,83 +35,88 @@ class RepositoriesMercurialControllerTest < Test::Unit::TestCase
|
|||||||
Repository::Mercurial.create(:project => Project.find(3), :url => REPOSITORY_PATH)
|
Repository::Mercurial.create(:project => Project.find(3), :url => REPOSITORY_PATH)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_show
|
if File.directory?(REPOSITORY_PATH)
|
||||||
get :show, :id => 3
|
def test_show
|
||||||
assert_response :success
|
get :show, :id => 3
|
||||||
assert_template 'show'
|
assert_response :success
|
||||||
assert_not_nil assigns(:entries)
|
assert_template 'show'
|
||||||
assert_not_nil assigns(:changesets)
|
assert_not_nil assigns(:entries)
|
||||||
end
|
assert_not_nil assigns(:changesets)
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_browse_root
|
||||||
|
get :browse, :id => 3
|
||||||
|
assert_response :success
|
||||||
|
assert_template 'browse'
|
||||||
|
assert_not_nil assigns(:entries)
|
||||||
|
assert_equal 3, assigns(:entries).size
|
||||||
|
assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'}
|
||||||
|
assert assigns(:entries).detect {|e| e.name == 'sources' && e.kind == 'dir'}
|
||||||
|
assert assigns(:entries).detect {|e| e.name == 'README' && e.kind == 'file'}
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_browse_directory
|
||||||
|
get :browse, :id => 3, :path => ['images']
|
||||||
|
assert_response :success
|
||||||
|
assert_template 'browse'
|
||||||
|
assert_not_nil assigns(:entries)
|
||||||
|
assert_equal 2, assigns(:entries).size
|
||||||
|
entry = assigns(:entries).detect {|e| e.name == 'edit.png'}
|
||||||
|
assert_not_nil entry
|
||||||
|
assert_equal 'file', entry.kind
|
||||||
|
assert_equal 'images/edit.png', entry.path
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_changes
|
||||||
|
get :changes, :id => 3, :path => ['images', 'edit.png']
|
||||||
|
assert_response :success
|
||||||
|
assert_template 'changes'
|
||||||
|
assert_tag :tag => 'h2', :content => 'edit.png'
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_entry_show
|
||||||
|
get :entry, :id => 3, :path => ['sources', 'watchers_controller.rb']
|
||||||
|
assert_response :success
|
||||||
|
assert_template 'entry'
|
||||||
|
# Line 19
|
||||||
|
assert_tag :tag => 'th',
|
||||||
|
:content => /10/,
|
||||||
|
:attributes => { :class => /line-num/ },
|
||||||
|
:sibling => { :tag => 'td', :content => /WITHOUT ANY WARRANTY/ }
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_entry_download
|
||||||
|
get :entry, :id => 3, :path => ['sources', 'watchers_controller.rb'], :format => 'raw'
|
||||||
|
assert_response :success
|
||||||
|
# File content
|
||||||
|
assert @response.body.include?('WITHOUT ANY WARRANTY')
|
||||||
|
end
|
||||||
|
|
||||||
def test_browse_root
|
def test_diff
|
||||||
get :browse, :id => 3
|
# Full diff of changeset 4
|
||||||
assert_response :success
|
get :diff, :id => 3, :rev => 4
|
||||||
assert_template 'browse'
|
assert_response :success
|
||||||
assert_not_nil assigns(:entries)
|
assert_template 'diff'
|
||||||
assert_equal 3, assigns(:entries).size
|
# Line 22 removed
|
||||||
assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'}
|
assert_tag :tag => 'th',
|
||||||
assert assigns(:entries).detect {|e| e.name == 'sources' && e.kind == 'dir'}
|
:content => /22/,
|
||||||
assert assigns(:entries).detect {|e| e.name == 'README' && e.kind == 'file'}
|
:sibling => { :tag => 'td',
|
||||||
end
|
:attributes => { :class => /diff_out/ },
|
||||||
|
:content => /def remove/ }
|
||||||
def test_browse_directory
|
end
|
||||||
get :browse, :id => 3, :path => ['images']
|
|
||||||
assert_response :success
|
def test_annotate
|
||||||
assert_template 'browse'
|
get :annotate, :id => 3, :path => ['sources', 'watchers_controller.rb']
|
||||||
assert_not_nil assigns(:entries)
|
assert_response :success
|
||||||
assert_equal 2, assigns(:entries).size
|
assert_template 'annotate'
|
||||||
entry = assigns(:entries).detect {|e| e.name == 'edit.png'}
|
# Line 23, revision 4
|
||||||
assert_not_nil entry
|
assert_tag :tag => 'th', :content => /23/,
|
||||||
assert_equal 'file', entry.kind
|
:sibling => { :tag => 'td', :child => { :tag => 'a', :content => /4/ } },
|
||||||
assert_equal 'images/edit.png', entry.path
|
:sibling => { :tag => 'td', :content => /jsmith/ },
|
||||||
end
|
:sibling => { :tag => 'td', :content => /watcher =/ }
|
||||||
|
end
|
||||||
def test_changes
|
else
|
||||||
get :changes, :id => 3, :path => ['images', 'edit.png']
|
puts "Mercurial test repository NOT FOUND. Skipping functional tests !!!"
|
||||||
assert_response :success
|
def test_fake; assert true end
|
||||||
assert_template 'changes'
|
|
||||||
assert_tag :tag => 'h2', :content => 'edit.png'
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_entry_show
|
|
||||||
get :entry, :id => 3, :path => ['sources', 'watchers_controller.rb']
|
|
||||||
assert_response :success
|
|
||||||
assert_template 'entry'
|
|
||||||
# Line 19
|
|
||||||
assert_tag :tag => 'th',
|
|
||||||
:content => /10/,
|
|
||||||
:attributes => { :class => /line-num/ },
|
|
||||||
:sibling => { :tag => 'td', :content => /WITHOUT ANY WARRANTY/ }
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_entry_download
|
|
||||||
get :entry, :id => 3, :path => ['sources', 'watchers_controller.rb'], :format => 'raw'
|
|
||||||
assert_response :success
|
|
||||||
# File content
|
|
||||||
assert @response.body.include?('WITHOUT ANY WARRANTY')
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_diff
|
|
||||||
# Full diff of changeset 4
|
|
||||||
get :diff, :id => 3, :rev => 4
|
|
||||||
assert_response :success
|
|
||||||
assert_template 'diff'
|
|
||||||
# Line 22 removed
|
|
||||||
assert_tag :tag => 'th',
|
|
||||||
:content => /22/,
|
|
||||||
:sibling => { :tag => 'td',
|
|
||||||
:attributes => { :class => /diff_out/ },
|
|
||||||
:content => /def remove/ }
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_annotate
|
|
||||||
get :annotate, :id => 3, :path => ['sources', 'watchers_controller.rb']
|
|
||||||
assert_response :success
|
|
||||||
assert_template 'annotate'
|
|
||||||
# Line 23, revision 4
|
|
||||||
assert_tag :tag => 'th', :content => /23/,
|
|
||||||
:sibling => { :tag => 'td', :child => { :tag => 'a', :content => /4/ } },
|
|
||||||
:sibling => { :tag => 'td', :content => /jsmith/ },
|
|
||||||
:sibling => { :tag => 'td', :content => /watcher =/ }
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user