similar to: Cookies and functional tests

Displaying 20 results from an estimated 40000 matches similar to: "Cookies and functional tests"

2006 Jan 10
0
problem with cookies in tests (TDD)
The problem I''m having is that I can''t seem to destroy the cookies and assert that they were indeed destroyed inside the test. The code to do this does work - the cookies are created, and are destroyed when this is done in a browser, but I can''t seem to make the test pass. account_signup_test.rb def test_should_pass_if_logout_destroys_cookie_data post :login,
2006 Jul 08
0
Testing cookies - integration tests
Hello, I''m trying to test some cookie code with some integration tests, but I''m not sure if this is possible. Currently I''m creating a session (using open_session) running some code that sets my cookie and this works fine, the cookie is being set. Now cookies are supposed to exist across different sessions, so I try to create a new session (again with
2009 Jul 01
1
[PATCH server] fixed expected status messages that were failing unit/functional tests.
--- .../functional/cloud/instance_controller_test.rb | 2 +- src/test/unit/vm_service_test.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/functional/cloud/instance_controller_test.rb b/src/test/functional/cloud/instance_controller_test.rb index 71d132b..0d713d4 100644 --- a/src/test/functional/cloud/instance_controller_test.rb +++
2006 Jun 29
1
Problems getting past authentication using functional tests
Hi, I''m having a problem getting past the authentication mechanism in rails using my controller functional tests. my functional tests look like this def test_4 $stdout.puts ''TEST 4: cookies is '' + cookies.to_s # :user => {:id => users(:testuser).id} cookies[:user_id] = ''2222'' $stdout.puts ''1. cookies is ''
2006 Jan 11
0
Cookies, models and nil objects
Still new in my ROR walk, been busily coding on a game application as a fruitful exercise in becoming proficient in Ruby/ROR. However, I seem to have hit a speed bump and am befuddled over some exhibited behavior in ROR. 1. **Cookies** - on page 312 of the AWDwR book by DT and DHH, it states that if you create a cookie by assigning a value to cookies[name], you get a "default set of
2006 Nov 24
0
Maybe a bug in Cookie:cookies
Hi man, Thank you very much for your good work. I think there may be a bug in Mechanize 0.6.3. Cookie:cookies (cookie.rb:L83 ) @jar[domain].each_key do |name| => if url.path =~ /^#{@jar[domain][name].path}/ if @jar[domain][name].expires.nil? cookies << @jar[domain][name] elsif Time.now <
2006 Apr 18
1
''depot''app, trouble with session / cookies
Many of you probably know the ''depot'' app from the ''Agile Rails development'' book. When the view changes from ''Store'' to ''display_cart,'' a session containing the shopping-cart (:cart) is supposed maintain the ''cart'' between calls, but when the display_cart stub view shows up, I have always ZERO elements
2006 Feb 15
0
Reading cookies - weird problem
Hello All, I set a cookie with the following code - cookies[:test1] = "abc" ..and when I try to read it with @cookies[:test1] in one of my views, I get a nil string. The only thing that seems to work is @cookies["test1"].value Has anyone run into similar issue? Thanks - Sree -- Posted via http://www.ruby-forum.com/.
2006 Feb 19
0
Re: can store array or hash in cookies?
Not a bug. A cookie is just a string. You can turn anything into a string and store it in a cookie. Something very simple like the following might work for you: array_for_cookie = [1,4,5,7] cookies[:foo] = array_for_cookie .to_s array_from_cookie = cookies[:foo][1..-2].split('','') (And if you are just storing a single integer in a cookie be sure to turn it into a
2003 Oct 12
0
idea (and patch): connection cookies
I have an idea for a protocol extension to limit the exposure of the complex crypto code in ssh servers. It's like tcp-wrappers, but based on a secret token rather than IP address. Patch against openssh-3.7.1p2: http://nick.cleaton.net/openssh-cc-0.03.patch Details ======= The "Connection Cookies" mechanism is an unofficial ssh protocol extension designed to prevent attackers
2010 Nov 14
1
RCurl and cookies in POST requests
Hello. I know that it's usually possible to write cookies to a cookie file by removing the curl handle and doing a gc() call. I can do this with getURL(), but I just can't obtain the same results with postForm(). If I use: curlHandle <- getCurlHandle(cookiefile=FILE, cookiejar=FILE) and then do: getURL(http://example.com/script.cgi, curl=curlHandle) rm(curlHandle) gc() it's
2008 Jun 06
7
Attention Judofyr: Broken cookies in 2.0
Hey Judofyr! Fix this! When someone sets a cookie using @cookies.something = ''data'' it should be set with the path going to the camping app''s root, not with no path, otherwise only that controller with the same parameters will ever see the cookie again! Please change this code: > @cookies.each do |k, v| > @response.set_cookie(k, v) if o[k] != v > end
2007 Jan 29
2
rspec and cookies
Hello can anyone tell me how to test cookies using rspec? specifically, I''d like to be able to set a cookie before a get/post request and also to test the cookies which have been set by a get/post request I know I can use cookies[:name] = ''value'' to set a cookie but how would I set expiry information on such a cookie? when i try to pass a hash {:value =>
2006 Mar 09
4
cross domain cookies
Does anybody know how to access the domain of a cookie from inside rails? I am try to integrate phpbb forums into my site and one of the things phpbb does is store a cookie. The forums are at forums.domain.com and the site is www.domain.com so i needed to set the cookie domain in phpbb to just be ".domain.com" so both sites can access it. The trouble is when using cookies[] in rails,
2001 Nov 15
2
X11 cookies and forwarding
I'm guess I wasn't following the whole cookies discussion completely (putting cookies in /tmp to avoid putting them on NFS, etc.), but I noticed today that with 2.9.9p2, if I use "ssh -X" to start a shell on the server, in that shell XAUTHORITY is set to /tmp/ssh-XXXXXXXX/cookies and there are cookies placed there there. These are the "fake" cookies for the
2007 Mar 19
0
cookies
How do I set cookies in a spec so I can see them in my controller, please? Conversely, why doesn''t this work... require File.dirname(__FILE__) + ''/../spec_helper'' class TestApplicationController < ApplicationController def index @seen = cookies[''auth_token''] || ''NOT seen!'' puts cookies.inspect #
2008 May 17
4
Setting cookies in service overloader thingo
I''m implementing a simpler version of the Cookie Session Store in Rails 2.0. If you know what that is, skip the next paragraph. A cookie session store stores the session data inside cookies, on the client, and signs them using a secret string, hashed together. The user can decode the cookie easily if they know much about computers and see what''s inside, but they
2012 Mar 08
0
Safari Version 5.1.3 (7534.53.10) Browser problem --- removing cookie on OS X Lion 10.7.3 (11D50b) when still valid
Hi All, Hope this note helps the newbies to Rails As I''m new to Rails, I''d like to share how I tracked down Safari''s dropping of my cookie. My Applebug no: 11003492 registered 7 March/2012 My development platform: MacPro running rails 3.1.1 on OS X Lion 10.7.3 (11D50b) Problem: Firefox worked as programmed but switching to Safari my current_user_token kept in the
2006 Dec 01
2
Mongrel 0.3.18, rails 1.1.6 and cookies
I''ve run into an issue with my rails application being unable to properly set cookies on Mongrel 0.3.18. If I run the simplified code below in Mongrel 3.14.4, both cookies are properly sent to and saved by the browser. With the same code in 0.3.18, only the auth_token cookie is created (if I switch them, only the userid as it will only properly create the first cookie in the list.)
2006 Jan 07
2
can store array or hash in cookies?
Hi According to rdoc: value - the cookie''s value or list of values (as an array). So, I can use arrays, briliant. But.... It does not work (at least on webrick) I wrote a controller: def check_cookies_first cookies[:chef] = {:value => ["first", "second"], :expires => Time.local (2020)} render_text ":)" end def