Displaying 20 results from an estimated 10000 matches similar to: "Setting and testing session data within a test."
2008 Dec 05
3
"singleton can't be dumped," but not using singleton
An action handler (select_person_by_name) in my controller class assigns
into session, and then does a redirect_to. I get the error "TypeError
(singleton can''t be dumped):" followed by a stack trace that doesn''t
cross my code.
Google tells me this is ordinarily caused by assigning a singleton
instance into session, but what I''m assigning is an ordinary String.
2019 Jul 16
2
Unexpected result from LIST EXTENDED command
I am executing this command below to dovecot-2.3.5-6.cp1178.x86_64 server
Notice that some status responses are missing (For folders INBOX.Archive, INBOX.spam.&-BD0EOQQ9BDkEPQ-). I wonder If this is a bug or working as expected
In rfc5819 there is this:
If the server runs into unexpected problems while trying to look up
the STATUS information, it MAY drop the corresponding STATUS reply.
In
2006 Feb 28
1
Oracle OraNumber problem with Authentication. Please help!
I have added an authenticator using the instructions here:
http://wiki.rubyonrails.org/rails/pages/HowtoAuthenticate
The LoginController sets session["employee"] to an employee.
When i try to access the session["employee"] from another controller i
get this error :
"
TypeError (no marshal_dump is defined for class OraNumber):
c:/ruby/lib/ruby/1.8/pstore.rb:159:in
2006 Jul 21
1
RJS Failing
This code was working before I created the update_link_list method in
the helper below (everything was in the controller). I can successfully
create a new link but I get a TypeError when I leave all form fields
blank -- I expect to see validation error messages.
---
#link_controller.rb:
def create
link = Link.new(params[:link])
saved = link.save
num_links = Link.find(:all).size
2008 Jun 13
1
TypeError (can't modify frozen hash) - Production Mode Only
Well, I''ve been testing out my code in production mode, in anticipation
of being able to show off my site soon. Unfortunately, all is not going
as expected. Production mode... well, its behaving differently than
development did. I''ve already had login validation issues, and now it
seems that my PM system is broken.
If a user enters a non-existent username as a recipient of a
2013 Aug 26
2
linkedin login using omniauth
Hi,
I am trying to add linkedin login feature in my rails application using
omniauth gem..I used omniauth gem for Fb login and it''s working fine..but
it''s not working for linkedin login
this is my code
/model/user.rb
class User < ActiveRecord::Base
attr_accessible :name, :oauth_expires_at, :oauth_token, :provider, :uid
def self.from_omniauth(auth)
2006 Feb 10
0
Functional testing - why can you use session[:key] but not session[:key]= ?
Question''s all in the title..
def test_foo
assert_equal ''foo'', session[:bar] # Perfectly valid
end
def test_blowup
session[:bar] = foo # TypeError: Symbol as array index
...
end
I always create a @session variable in the setup method. Just curious
as to why you can get session values but not set them using session[]
Pat
2013 Jan 18
1
redirect_to(session[:return_to]) vs session.delete
Hey all,
Recently I''ve been looking into on how to return back to a previous
referring URL and and the most common approach is:
redirect_to session[:return_to]
But some recommend:
redirect_to(session.delete(:return_to) || default)
How I understand it, in the second example we call session.delete so it
will clear the return path since we will no longer need it, and we also use
2007 Nov 02
4
Login Redirect - Hacking the session[original_uri]
Hi There,
I have several ajax elements that require authorization, but for various
reasons, they can''t pass session[original_uri] to the redirect on user
log in. I''m trying to hack in a uri by passing a param to the login
page.
I can see that the param is passing into the login page, but for
whatever reason, no matter what I do, the user is redirected to the
homepage after
2006 Aug 09
4
checking session -newbie
hello!
i have a problem checking a session. i want to check if the session
exists, and then redirect somewhere, but in the if-loop, if the session
doesnt exist, i become an error
im trying to do something like:
if @session[''user''] == nil
redirect_to ...
else
redirect_to ...
end
but as i said, the loop doesnt work, because i become the error before
it checks.
how can i
2008 Jan 16
2
redirecto_to within helpers
Hi all,
In one of my helpers I would like to call a redirect_to(url) action. I
know the helpers are supposed almost only for formatting the view
purposes but it''s the best way I have found to do what I want. If I call
the redirect_to action in a helper I get the error:
undefined method `redirect_to'' for #<#<Class:0x23aaedc>:0x23aaeb4>
any solution for this?
2006 Apr 22
3
Creating a select dropdown box with links to methods
What would be the best way to create a form select dropdown box and upon
"submit" have it directly go to a controller method view?
I have something that somewhat works, but I think there is probably a
much easier way to do it. As of now, I have the dropdown list which
when the form is submitted is handed to a controller method which
basically
I have my dropdown box:
<%=
2006 Aug 03
1
Why doesn''t redirect_to handle rjs?
Is there a good reason why redirect_to doesn''t check responds_to, so
it can handle redirects in rjs calls? I''ve done something like this
in my app controller, seems to work ok...
alias_method :redirect_to_orig, :redirect_to;
def redirect_to(options = {}, *parameters_for_method_reference)
respond_to do |accepts|
accepts.html do
redirect_to_orig
2006 Jan 11
0
error_messages_for >> Cannot convert Array into String
Hi all
I have the following Model:
Member(id, username, first_name, last_name, hashed_password,
password_salt)
Now I want to allow users to register for an account using the following
form:
---
<%= form_tag %>
<%= error_messages_for ''member'' %>
<p><%= _(''Username'') %>: <%= text_field(''member'',
2006 May 05
3
exception_notification plugin not sending mails in development on localhost
Hi everyone,
So, I''ve got exception_notification working now, but not in
development mode on localhost. In my ApplicationController, I''ve
added:
local_addresses.clear
Shouldn''t that be enough?
Thank you!
Sean
2006 Apr 08
2
respond_to causes DoubleRenderError?
I have a custom authentication plugin that redirects users to a login
site if they aren''t already authenticated and their session hasn''t
timed out. I had things working fine with straight http requests, but
wanted to add support for ajax requests. I thought this would be a
simple matter of replacing all of my "redirect_to <blah> and return
false" calls with
2007 Feb 21
1
setting session data from a post
I''m using acts_as_authenticated, and I''m trying to run some tests where
the user must be registered. In the past, I''ve just included a user id
in the session data.
def test_login_loads_from_post_session
post :new, nil, { :user => 7 }
session = assigns(:session)
assert_equal 7, session[:user]
end
My assert statement seems to be failing because my session is
2006 Aug 07
5
Store SOAP::RPC::Driver in user session throws TypeError
Hi All
I have a
requirement to consume a 3rd party web service from my Rails
application. I am doing this
in my action
require ''soap/wsdlDriver''
factory = SOAP::WSDLDriverFactory.new(TRANSIDIOM_WSDL_URL)
soap = factory.create_rpc_driver
soap.wiredump_file_base="#{RAILS_ROOT}/log/transidiom.log"
param = %(<Request
2006 Mar 30
3
Model.find(:all) where Model.association has more then 0 items?
Hi everyone,
I have a Department model that has_many people. How do I go about
finding all departments with more than 0 people?
Department.find(:all, :conditions => Department.people.size > 0)
That, of course, doesn''t work, but it was as close as I could come.
Thanks!
Sean
2006 Jun 18
2
Why can''t I use a session? (Symbol as array index)
Hi All
I can''t for the life of me see what is wrong with this. Maybe it''s cause
it''s midnight...
I want to put some data in a session and I have some code like this:
class ApplicationController < ActionController::Base
model :mything
def ApplicationController.chosen_thing
session[:chosen_thing] ||= MyThing.defaultThing
end
end
So whenever I try to