Revision 912:5e80956cc792 .svn/pristine/0d

View differences:

.svn/pristine/0d/0d106c8ee2a99b8daf9a6d87887284bdd099fa19.svn-base
1
# Redmine - project management software
2
# Copyright (C) 2006-2011  Jean-Philippe Lang
3
#
4
# This program is free software; you can redistribute it and/or
5
# modify it under the terms of the GNU General Public License
6
# as published by the Free Software Foundation; either version 2
7
# of the License, or (at your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
# GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17

  
18
require File.expand_path('../../test_helper', __FILE__)
19

  
20
class SettingTest < ActiveSupport::TestCase
21

  
22
  def test_read_default
23
    assert_equal "Redmine", Setting.app_title
24
    assert Setting.self_registration?
25
    assert !Setting.login_required?
26
  end
27

  
28
  def test_update
29
    Setting.app_title = "My title"
30
    assert_equal "My title", Setting.app_title
31
    # make sure db has been updated (INSERT)
32
    assert_equal "My title", Setting.find_by_name('app_title').value
33

  
34
    Setting.app_title = "My other title"
35
    assert_equal "My other title", Setting.app_title
36
    # make sure db has been updated (UPDATE)
37
    assert_equal "My other title", Setting.find_by_name('app_title').value
38
  end
39

  
40
  def test_serialized_setting
41
    Setting.notified_events = ['issue_added', 'issue_updated', 'news_added']
42
    assert_equal ['issue_added', 'issue_updated', 'news_added'], Setting.notified_events
43
    assert_equal ['issue_added', 'issue_updated', 'news_added'], Setting.find_by_name('notified_events').value
44
  end
45
  
46
  def test_setting_should_be_reloaded_after_clear_cache
47
    Setting.app_title = "My title"
48
    assert_equal "My title", Setting.app_title
49
    
50
    s = Setting.find_by_name("app_title")
51
    s.value = 'New title'
52
    s.save!
53
    assert_equal "My title", Setting.app_title
54
    
55
    Setting.clear_cache
56
    assert_equal "New title", Setting.app_title
57
  end
58
end
.svn/pristine/0d/0d2311ec4452abd2d98cbb99aaf512d8571b9e28.svn-base
1
class IssuePriority < Enumeration
2
  generator_for :name, :start => 'IssuePriority0'
3
  generator_for :type => 'IssuePriority'
4

  
5
end
.svn/pristine/0d/0d581e597497e894acf26342b5cf129e84f325db.svn-base
1
module Redmine
2
  module Info
3
    class << self
4
      def app_name; 'Redmine' end
5
      def url; 'http://www.redmine.org/' end
6
      def help_url; 'http://www.redmine.org/guide' end
7
      def versioned_name; "#{app_name} #{Redmine::VERSION}" end
8

  
9
      # Creates the url string to a specific Redmine issue
10
      def issue(issue_id)
11
        url + 'issues/' + issue_id.to_s
12
      end
13
    end
14
  end
15
end
.svn/pristine/0d/0d6663388ad2e1df81d9f7719fa0c144a5b76d99.svn-base
1
#!/usr/bin/env ruby
2
require File.expand_path('../../config/boot',  __FILE__)
3
require 'commands/runner'
.svn/pristine/0d/0da01fc24e804fb2e15e93cbb542b0add78e1cbc.svn-base
1
<%= "#{issue.tracker.name} ##{issue.id}: #{issue.subject}" %>
2
<%= issue_url %>
3

  
4
<%=l(:field_author)%>: <%= issue.author %>
5
<%=l(:field_status)%>: <%= issue.status %>
6
<%=l(:field_priority)%>: <%= issue.priority %>
7
<%=l(:field_assigned_to)%>: <%= issue.assigned_to %>
8
<%=l(:field_category)%>: <%= issue.category %>
9
<%=l(:field_fixed_version)%>: <%= issue.fixed_version %>
10
<% issue.custom_field_values.each do |c| %><%= c.custom_field.name %>: <%= show_value(c) %>
11
<% end %>
12

  
13
<%= issue.description %>
.svn/pristine/0d/0dc6f2999aebfb473b433b9a22bddd8917c60616.svn-base
1
# $Id: ldif.rb 78 2006-04-26 02:57:34Z blackhedd $
2
#
3
# Net::LDIF for Ruby
4
#
5
#
6
#
7
# Copyright (C) 2006 by Francis Cianfrocca. All Rights Reserved.
8
#
9
# Gmail: garbagecat10
10
#
11
# This program is free software; you can redistribute it and/or modify
12
# it under the terms of the GNU General Public License as published by
13
# the Free Software Foundation; either version 2 of the License, or
14
# (at your option) any later version.
15
#
16
# This program is distributed in the hope that it will be useful,
17
# but WITHOUT ANY WARRANTY; without even the implied warranty of
18
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
# GNU General Public License for more details.
20
#
21
# You should have received a copy of the GNU General Public License
22
# along with this program; if not, write to the Free Software
23
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
24
#
25
#
26

  
27
# THIS FILE IS A STUB.
28

  
29
module Net
30

  
31
  class LDIF
32

  
33

  
34
  end # class LDIF
35

  
36

  
37
end # module Net
38

  
39

  
.svn/pristine/0d/0dec78f36b0f6507c2aa4e50dcd86ca0850c844a.svn-base
1
require File.dirname(__FILE__) + '/test_helper'
2

  
3
class OpenIdAuthenticationTest < Test::Unit::TestCase
4
  def setup
5
    @controller = Class.new do
6
      include OpenIdAuthentication
7
      def params() {} end
8
    end.new
9
  end
10

  
11
  def test_authentication_should_fail_when_the_identity_server_is_missing
12
    open_id_consumer = mock()
13
    open_id_consumer.expects(:begin).raises(OpenID::OpenIDError)
14
    @controller.expects(:open_id_consumer).returns(open_id_consumer)
15
    @controller.expects(:logger).returns(mock(:error => true))
16

  
17
    @controller.send(:authenticate_with_open_id, "http://someone.example.com") do |result, identity_url|
18
      assert result.missing?
19
      assert_equal "Sorry, the OpenID server couldn't be found", result.message
20
    end
21
  end
22

  
23
  def test_authentication_should_be_invalid_when_the_identity_url_is_invalid
24
    @controller.send(:authenticate_with_open_id, "!") do |result, identity_url|
25
      assert result.invalid?, "Result expected to be invalid but was not"
26
      assert_equal "Sorry, but this does not appear to be a valid OpenID", result.message
27
    end
28
  end
29

  
30
  def test_authentication_should_fail_when_the_identity_server_times_out
31
    open_id_consumer = mock()
32
    open_id_consumer.expects(:begin).raises(Timeout::Error, "Identity Server took too long.")
33
    @controller.expects(:open_id_consumer).returns(open_id_consumer)
34
    @controller.expects(:logger).returns(mock(:error => true))
35

  
36
    @controller.send(:authenticate_with_open_id, "http://someone.example.com") do |result, identity_url|
37
      assert result.missing?
38
      assert_equal "Sorry, the OpenID server couldn't be found", result.message
39
    end
40
  end
41

  
42
  def test_authentication_should_begin_when_the_identity_server_is_present
43
    @controller.expects(:begin_open_id_authentication)
44
    @controller.send(:authenticate_with_open_id, "http://someone.example.com")
45
  end
46
end

Also available in: Unified diff