mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-23 10:40:13 +01:00
A few tweaks to get tests running
This commit is contained in:
parent
ac0ff3feaf
commit
6181d42072
3 changed files with 4 additions and 4 deletions
|
|
@ -24,7 +24,7 @@ config.action_controller.allow_forgery_protection = false
|
||||||
# See http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/5519ca7fd4dde3c1
|
# See http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/5519ca7fd4dde3c1
|
||||||
class ActionController::RackRequest
|
class ActionController::RackRequest
|
||||||
DEFAULT_SESSION_OPTIONS = {
|
DEFAULT_SESSION_OPTIONS = {
|
||||||
:database_manager => CGI::Session::MemoryStore, # store data in memory
|
#:database_manager => CGI::Session::MemoryStore, # store data in memory
|
||||||
:prefix => "ruby_sess.", # prefix session file names
|
:prefix => "ruby_sess.", # prefix session file names
|
||||||
:session_path => "/", # available to all paths in app
|
:session_path => "/", # available to all paths in app
|
||||||
:session_key => "_session_id",
|
:session_key => "_session_id",
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ class LoginControllerTest < ActionController::TestCase
|
||||||
|
|
||||||
def test_should_fail_cookie_login
|
def test_should_fail_cookie_login
|
||||||
users(:other_user).remember_me
|
users(:other_user).remember_me
|
||||||
@request.cookies["auth_token"] = CGI::Cookie.new('name' => 'auth_token', 'value' => 'invalid_auth_token')
|
@request.cookies["auth_token"] = 'invalid_auth_token'
|
||||||
get :login
|
get :login
|
||||||
assert !@controller.send(:logged_in?)
|
assert !@controller.send(:logged_in?)
|
||||||
end
|
end
|
||||||
|
|
@ -139,7 +139,7 @@ class LoginControllerTest < ActionController::TestCase
|
||||||
private
|
private
|
||||||
|
|
||||||
def auth_token_cookie_for(user)
|
def auth_token_cookie_for(user)
|
||||||
CGI::Cookie.new('name' => 'auth_token', 'value' => users(user).remember_token)
|
users(user).remember_token
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
ENV["RAILS_ENV"] = "test"
|
ENV["RAILS_ENV"] = "test"
|
||||||
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
|
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
|
||||||
require File.expand_path(File.dirname(__FILE__) + "/../app/controllers/application")
|
require File.expand_path(File.dirname(__FILE__) + "/../app/controllers/application_controller")
|
||||||
require 'test_help'
|
require 'test_help'
|
||||||
require 'flexmock/test_unit' #and the flexmock gem, too!
|
require 'flexmock/test_unit' #and the flexmock gem, too!
|
||||||
require 'action_web_service/test_invoke'
|
require 'action_web_service/test_invoke'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue