Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 183 lines (158 sloc) 5.288 kb
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
1 require "test/unit"
2 require "rubygems"
3 require "ruby-debug"
4 require "active_record"
55ccfa20 »
2009-03-29 Add a mock_logger for testing
5 require "active_record/fixtures"
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
6
bcb0d4af »
2009-06-10 * Stop using errors.on(key) since that is now deprecated in Rails. Us…
7 # A temporary fix to bring active record errors up to speed with rails edge.
8 # I need to remove this once the new gem is released. This is only here so my tests pass.
f8cd29c3 »
2009-09-09 Change gemspec dependency from activesupport to activerecord (which d…
9 unless defined?(::ActiveModel)
10 class ActiveRecord::Errors
11 def [](key)
12 value = on(key)
13 value.is_a?(Array) ? value : [value].compact
14 end
bcb0d4af »
2009-06-10 * Stop using errors.on(key) since that is now deprecated in Rails. Us…
15 end
16 end
17
18
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
19 ActiveRecord::Schema.verbose = false
f8cd29c3 »
2009-09-09 Change gemspec dependency from activesupport to activerecord (which d…
20
21 begin
22 ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
23 rescue ArgumentError
24 ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :dbfile => ":memory:")
25 end
26
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
27 ActiveRecord::Base.configurations = true
28 ActiveRecord::Schema.define(:version => 1) do
29 create_table :companies do |t|
30 t.datetime :created_at
31 t.datetime :updated_at
32 t.string :name
33 t.boolean :active
34 end
35
36 create_table :projects do |t|
37 t.datetime :created_at
38 t.datetime :updated_at
39 t.string :name
40 end
41
42 create_table :projects_users, :id => false do |t|
43 t.integer :project_id
44 t.integer :user_id
45 end
46
47 create_table :users do |t|
48 t.datetime :created_at
49 t.datetime :updated_at
70ca165d »
2009-02-19 Think we may have fixed the problem.
50 t.integer :lock_version, :default => 0
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
51 t.integer :company_id
52 t.string :login
53 t.string :crypted_password
54 t.string :password_salt
4caccd0b »
2008-11-19 Released 1.2.1
55 t.string :persistence_token
ebdebfa9 »
2008-11-13 Released v1.1.1
56 t.string :single_access_token
4caccd0b »
2008-11-19 Released 1.2.1
57 t.string :perishable_token
dbd8b8f5 »
2008-11-16 Release v1.2.0
58 t.string :email
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
59 t.string :first_name
60 t.string :last_name
605162d3 »
2009-03-20 Release v2.0 RC1
61 t.integer :login_count, :default => 0, :null => false
62 t.integer :failed_login_count, :default => 0, :null => false
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
63 t.datetime :last_request_at
64 t.datetime :current_login_at
65 t.datetime :last_login_at
66 t.string :current_login_ip
67 t.string :last_login_ip
1f74ab91 »
2008-12-24 Added disable_magic_states option for sessions
68 t.boolean :active, :default => true
69 t.boolean :approved, :default => true
70 t.boolean :confirmed, :default => true
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
71 end
72
73 create_table :employees do |t|
74 t.datetime :created_at
75 t.datetime :updated_at
76 t.integer :company_id
77 t.string :email
78 t.string :crypted_password
79 t.string :password_salt
4caccd0b »
2008-11-19 Released 1.2.1
80 t.string :persistence_token
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
81 t.string :first_name
82 t.string :last_name
605162d3 »
2009-03-20 Release v2.0 RC1
83 t.integer :login_count, :default => 0, :null => false
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
84 t.datetime :last_request_at
85 t.datetime :current_login_at
86 t.datetime :last_login_at
87 t.string :current_login_ip
88 t.string :last_login_ip
89 end
1ffbc668 »
2009-04-11 * Fixed bug where the find_with_login method was not being aliased if…
90
91 create_table :affiliates do |t|
92 t.datetime :created_at
93 t.datetime :updated_at
94 t.integer :company_id
95 t.string :username
96 t.string :pw_hash
97 t.string :pw_salt
98 t.string :persistence_token
99 end
43360a3b »
2009-04-21 * Fix bug when password is turned off and the SingleAccessToken modul…
100
101 create_table :ldapers do |t|
102 t.datetime :created_at
103 t.datetime :updated_at
104 t.string :ldap_login
105 t.string :persistence_token
106 end
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
107 end
108
78f5befa »
2009-03-23 Restructure configuration for acts_as_authentic
109 require File.dirname(__FILE__) + '/../lib/authlogic' unless defined?(Authlogic)
26e57e6b »
2009-03-26 Completely rewrote Authlogic::Testing, it's now called Authlogic::Tes…
110 require File.dirname(__FILE__) + '/../lib/authlogic/test_case'
605162d3 »
2009-03-20 Release v2.0 RC1
111 require File.dirname(__FILE__) + '/libs/project'
1ffbc668 »
2009-04-11 * Fixed bug where the find_with_login method was not being aliased if…
112 require File.dirname(__FILE__) + '/libs/affiliate'
605162d3 »
2009-03-20 Release v2.0 RC1
113 require File.dirname(__FILE__) + '/libs/employee'
114 require File.dirname(__FILE__) + '/libs/employee_session'
43360a3b »
2009-04-21 * Fix bug when password is turned off and the SingleAccessToken modul…
115 require File.dirname(__FILE__) + '/libs/ldaper'
605162d3 »
2009-03-20 Release v2.0 RC1
116 require File.dirname(__FILE__) + '/libs/user'
117 require File.dirname(__FILE__) + '/libs/user_session'
118 require File.dirname(__FILE__) + '/libs/company'
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
119
72f3a213 »
2008-11-26 Added AES256 as an option for crypto_providers
120 Authlogic::CryptoProviders::AES256.key = "myafdsfddddddddddddddddddddddddddddddddddddddddddddddd"
121
605162d3 »
2009-03-20 Release v2.0 RC1
122 class ActiveSupport::TestCase
2a8e080e »
2009-03-23 Validate length of password
123 include ActiveRecord::TestFixtures
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
124 self.fixture_path = File.dirname(__FILE__) + "/fixtures"
2a8e080e »
2009-03-23 Validate length of password
125 self.use_transactional_fixtures = false
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
126 self.use_instantiated_fixtures = false
2a8e080e »
2009-03-23 Validate length of password
127 self.pre_loaded_fixtures = false
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
128 fixtures :all
129 setup :activate_authlogic
130
131 private
a623f67e »
2008-11-23 Release v1.3.3
132 def password_for(user)
133 case user
134 when users(:ben)
135 "benrocks"
136 when users(:zack)
137 "zackrocks"
138 end
139 end
140
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
141 def http_basic_auth_for(user = nil, &block)
142 unless user.blank?
26e57e6b »
2009-03-26 Completely rewrote Authlogic::Testing, it's now called Authlogic::Tes…
143 controller.http_user = user.login
144 controller.http_password = password_for(user)
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
145 end
146 yield
26e57e6b »
2009-03-26 Completely rewrote Authlogic::Testing, it's now called Authlogic::Tes…
147 controller.http_user = controller.http_password = nil
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
148 end
149
150 def set_cookie_for(user, id = nil)
26e57e6b »
2009-03-26 Completely rewrote Authlogic::Testing, it's now called Authlogic::Tes…
151 controller.cookies["user_credentials"] = {:value => user.persistence_token, :expires => nil}
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
152 end
153
154 def unset_cookie
26e57e6b »
2009-03-26 Completely rewrote Authlogic::Testing, it's now called Authlogic::Tes…
155 controller.cookies["user_credentials"] = nil
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
156 end
157
b83abcac »
2008-11-12 Added in authentication by params / token
158 def set_params_for(user, id = nil)
26e57e6b »
2009-03-26 Completely rewrote Authlogic::Testing, it's now called Authlogic::Tes…
159 controller.params["user_credentials"] = user.single_access_token
b83abcac »
2008-11-12 Added in authentication by params / token
160 end
161
162 def unset_params
26e57e6b »
2009-03-26 Completely rewrote Authlogic::Testing, it's now called Authlogic::Tes…
163 controller.params["user_credentials"] = nil
b83abcac »
2008-11-12 Added in authentication by params / token
164 end
165
ebdebfa9 »
2008-11-13 Released v1.1.1
166 def set_request_content_type(type)
26e57e6b »
2009-03-26 Completely rewrote Authlogic::Testing, it's now called Authlogic::Tes…
167 controller.request_content_type = type
ebdebfa9 »
2008-11-13 Released v1.1.1
168 end
169
170 def unset_request_content_type
26e57e6b »
2009-03-26 Completely rewrote Authlogic::Testing, it's now called Authlogic::Tes…
171 controller.request_content_type = nil
ebdebfa9 »
2008-11-13 Released v1.1.1
172 end
173
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
174 def set_session_for(user, id = nil)
26e57e6b »
2009-03-26 Completely rewrote Authlogic::Testing, it's now called Authlogic::Tes…
175 controller.session["user_credentials"] = user.persistence_token
176 controller.session["user_credentials_id"] = user.id
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
177 end
178
179 def unset_session
26e57e6b »
2009-03-26 Completely rewrote Authlogic::Testing, it's now called Authlogic::Tes…
180 controller.session["user_credentials"] = controller.session["user_credentials_id"] = nil
6862f609 »
2008-11-05 Released v1.0.0 (see changelog)
181 end
f8cd29c3 »
2009-09-09 Change gemspec dependency from activesupport to activerecord (which d…
182 end
Something went wrong with that request. Please try again.