Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made tests pass with Ruby 1.8.7 and 1.9.2

  • Loading branch information...
commit 4f611b0983075f5a7c9baf2fb3cea7191e213122 1 parent e1a57b5
@dbloete dbloete authored
View
5 .infinity_test
@@ -1,4 +1,5 @@
infinity_test do
- use :rubies => %w(1.8.7 1.9.2)
- use :app_framework => :rails
+ use :rubies => %w(1.8.7 1.9.2),
+ :gemset => 'masquerade',
+ :app_framework => :rails
end
View
2  app/controllers/server_controller.rb
@@ -200,7 +200,7 @@ def transform_ax_data(parameters)
# Renders the exception message as text output
def render_openid_error(exception)
error = case exception
- when OpenID::Server::MalformedTrustRoot: "Malformed trust root '#{exception.to_s}'"
+ when OpenID::Server::MalformedTrustRoot then "Malformed trust root '#{exception.to_s}'"
else exception.to_s
end
render :text => h("Invalid OpenID request: #{error}"), :status => 500
View
2  test/functional/accounts_controller_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require 'test_helper'
class AccountsControllerTest < ActionController::TestCase
View
2  test/functional/info_controller_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require 'test_helper'
class InfoControllerTest < ActionController::TestCase
View
2  test/functional/passwords_controller_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require 'test_helper'
class PasswordsControllerTest < ActionController::TestCase
View
2  test/functional/personas_controller_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require 'test_helper'
class PersonasControllerTest < ActionController::TestCase
View
2  test/functional/server_controller_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require 'test_helper'
class ServerControllerTest < ActionController::TestCase
View
2  test/functional/sessions_controller_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require 'test_helper'
class SessionsControllerTest < ActionController::TestCase
View
2  test/functional/sites_controller_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require 'test_helper'
class SitesControllerTest < ActionController::TestCase
View
3  test/functional/yubikey_associations_controller_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require 'test_helper'
class YubikeyAssociationsControllerTest < ActionController::TestCase
@@ -23,4 +23,5 @@ def test_should_remove_an_association
assert_nil @account.yubico_identity
assert_redirected_to edit_account_url
end
+
end
View
4 test/integration/openid_user_stories_test.rb
@@ -1,6 +1,7 @@
-require "#{File.dirname(__FILE__)}/../test_helper"
+require 'test_helper'
class OpenidUserStoriesTest < ActionController::IntegrationTest
+
fixtures :all
def test_verifying_identifier_ownership
@@ -248,4 +249,5 @@ def test_responding_to_pape_requests
assert_match "openid.pape.auth_time=", @response.redirect_url, "Response was expected to have PAPE Auth Age: #{@response.redirect_url}"
assert_match "openid.pape.nist_auth_level=", @response.redirect_url, "Response was expected to have PAPE NIST Auth Level: #{@response.redirect_url}"
end
+
end
View
9 test/performance/browsing_test.rb
@@ -1,9 +0,0 @@
-require 'test_helper'
-require 'rails/performance_test_help'
-
-# Profiling results for each test method are written to tmp/performance.
-class BrowsingTest < ActionController::PerformanceTest
- def test_homepage
- get '/'
- end
-end
View
4 test/test_helper.rb
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
@@ -121,7 +123,7 @@ def assert_valid(object) # just for work with Rails 2.3.4.
assert object.valid?
end
- def assert_invalid(object, attribute, message = nil)
+ def assert_invalid(object, attribute, message = "")
assert_equal false, object.valid?
assert object.errors[attribute], message
end
View
10 test/unit/account_mailer_test.rb
@@ -1,10 +1,8 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require 'test_helper'
require 'account_mailer'
class AccountMailerTest < ActiveSupport::TestCase
- FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures'
- CHARSET = "utf-8"
-
+
def setup
@account = Account.create valid_account_attributes
end
@@ -13,7 +11,7 @@ def test_should_send_signup_notification
response = AccountMailer.signup_notification(@account)
assert_equal @account.email, response.to[0]
assert response.parts.size == 2
- response.parts.each { |part| assert_match @account.activation_code, part.body }
+ response.parts.each { |part| assert part.body.match(@account.activation_code) }
end
def test_should_send_forgot_password
@@ -21,7 +19,7 @@ def test_should_send_forgot_password
response = AccountMailer.forgot_password(@account)
assert_equal @account.email, response.to[0]
assert response.parts.size == 2
- response.parts.each { |part| assert_match @account.password_reset_code, part.body }
+ response.parts.each { |part| assert part.body.match(@account.password_reset_code) }
end
end
View
5 test/unit/account_test.rb
@@ -1,6 +1,9 @@
-require File.dirname(__FILE__) + '/../test_helper'
+# encoding: utf-8
+
+require 'test_helper'
class AccountTest < ActiveSupport::TestCase
+
fixtures :accounts
def setup
View
2  test/unit/country_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require 'test_helper'
class CountryTest < ActiveSupport::TestCase
View
2  test/unit/language_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require 'test_helper'
class LanguageTest < ActiveSupport::TestCase
View
2  test/unit/open_id_request_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require 'test_helper'
class OpenIdRequestTest < ActiveSupport::TestCase
View
2  test/unit/persona_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require 'test_helper'
class PersonaTest < ActiveSupport::TestCase
View
2  test/unit/release_policy_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require 'test_helper'
class ReleasePolicyTest < ActiveSupport::TestCase
View
2  test/unit/site_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require 'test_helper'
class SiteTest < ActiveSupport::TestCase
View
2  test/unit/timezone_test.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require 'test_helper'
class TimezoneTest < ActiveSupport::TestCase
Please sign in to comment.
Something went wrong with that request. Please try again.