@@ -141,7 +141,7 class Setting < ActiveRecord::Base | |||||
141 | end |
|
141 | end | |
142 |
|
142 | |||
143 | def self.openid? |
|
143 | def self.openid? | |
144 |
Object.const_defined?(:OpenID) && self[ |
|
144 | Object.const_defined?(:OpenID) && self[:openid].to_i > 0 | |
145 | end |
|
145 | end | |
146 |
|
146 | |||
147 | # Checks if settings have changed since the values were read |
|
147 | # Checks if settings have changed since the values were read |
@@ -136,6 +136,11 class AccountControllerTest < Test::Unit::TestCase | |||||
136 | assert_equal 'http://openid.example.com/good_user', assigns(:user)[:identity_url] |
|
136 | assert_equal 'http://openid.example.com/good_user', assigns(:user)[:identity_url] | |
137 | end |
|
137 | end | |
138 |
|
138 | |||
|
139 | def test_setting_openid_should_return_true_when_set_to_true | |||
|
140 | Setting.openid = '1' | |||
|
141 | assert_equal true, Setting.openid? | |||
|
142 | end | |||
|
143 | ||||
139 | else |
|
144 | else | |
140 | puts "Skipping openid tests." |
|
145 | puts "Skipping openid tests." | |
141 | end |
|
146 | end |
General Comments 0
You need to be logged in to leave comments.
Login now