Revision 442:753f1380d6bc test/.svn/text-base

View differences:

test/.svn/text-base/test_helper.rb.svn-base
1
# redMine - project management software
2
# Copyright (C) 2006  Jean-Philippe Lang
1
# Redmine - project management software
2
# Copyright (C) 2006-2011  Jean-Philippe Lang
3 3
#
4 4
# This program is free software; you can redistribute it and/or
5 5
# modify it under the terms of the GNU General Public License
......
87 87
    saved_settings = options.keys.inject({}) {|h, k| h[k] = Setting[k].dup; h}
88 88
    options.each {|k, v| Setting[k] = v}
89 89
    yield
90
  ensure
90 91
    saved_settings.each {|k, v| Setting[k] = v}
91 92
  end
92 93

  
......
109 110
    File.join(RAILS_ROOT.gsub(%r{config\/\.\.}, ''), "/tmp/test/#{vendor.downcase}_repository")
110 111
  end
111 112
  
113
  # Returns the url of the subversion test repository
114
  def self.subversion_repository_url
115
    path = repository_path('subversion')
116
    path = '/' + path unless path.starts_with?('/')
117
    "file://#{path}"
118
  end
119
  
112 120
  # Returns true if the +vendor+ test repository is configured
113 121
  def self.repository_configured?(vendor)
114 122
    File.directory?(repository_path(vendor))
......
416 424
  # Checks that the response is a valid JSON string
417 425
  def self.should_be_a_valid_json_string
418 426
    should "be a valid JSON string (or empty)" do
419
      assert (response.body.blank? || ActiveSupport::JSON.decode(response.body))
427
      assert(response.body.blank? || ActiveSupport::JSON.decode(response.body))
420 428
    end
421 429
  end
422 430

  

Also available in: Unified diff