Skip to content

Commit

Permalink
Fix functional tests to work with Authlogic
Browse files Browse the repository at this point in the history
* Update fixtures to include persistence_token and setup authlogic test
  helpers correctly.

Signed-off-by: Alex Coles <alex@alexcolesportfolio.com>
  • Loading branch information
myabc committed Mar 17, 2010
1 parent bacb704 commit 21d94fa
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
4 changes: 3 additions & 1 deletion test/fixtures/users.yml
Expand Up @@ -4,10 +4,12 @@ quentin:
password_salt: 7e3041ebc2fc05a40c60028e2c4901a81035d3cd
crypted_password: 00742970dc9e6319f8019fd54864d3ea740f04b1 # test
created_at: <%%= 5.days.ago.to_s :db %>
persistence_token: <%%= Authlogic::Random.hex_token %>

aaron:
login: aaron
email: aaron@example.com
password_salt: 7e3041ebc2fc05a40c60028e2c4901a81035d3cd
crypted_password: 00742970dc9e6319f8019fd54864d3ea740f04b1 # test
created_at: <%%= 1.days.ago.to_s :db %>
created_at: <%%= 1.days.ago.to_s :db %>
persistence_token: <%%= Authlogic::Random.hex_token %>
3 changes: 0 additions & 3 deletions test/functional/dashboard_controller_test.rb
Expand Up @@ -9,9 +9,6 @@ class DashboardControllerTest < ActionController::TestCase

def setup
@controller = Admin::DashboardController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new

login_as(:quentin)
end

Expand Down
3 changes: 0 additions & 3 deletions test/functional/images_controller_test.rb
Expand Up @@ -9,9 +9,6 @@ class ImagesControllerTest < ActionController::TestCase

def setup
@controller = Admin::ImagesController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new

login_as(:quentin)
end

Expand Down
5 changes: 4 additions & 1 deletion test/test_helper.rb
Expand Up @@ -39,7 +39,6 @@ class ActiveSupport::TestCase

# Add more helper methods to be used by all tests here...
def login_as(user)
activate_authlogic
UserSession.create(users(user)) # logs a user in
end

Expand All @@ -48,3 +47,7 @@ def logout
end

end

class ActionController::TestCase
setup :activate_authlogic
end

0 comments on commit 21d94fa

Please sign in to comment.