Displaying 20 results from an estimated 300 matches similar to: "problem with cookies in tests (TDD)"
2008 Jan 12
0
Can't test application controller methods in functional tests?
I have two methods in application controller that I want to test from
ForumController:
-----------------------
class ApplicationController < ActionController::Base
...
def logout
session[:username] = nil
session[:admin] = nil
redirect_to(request.request_uri)
end
...
def home
redirect_to(:controller => ''forum'', :action =>
2005 Jul 13
0
Testing failing
So I''m trying to be a good agile programmer and write unit tests for
my objects, but I''ve got a test I just can''t keep from failing.
I have a profile object that I just added username and
hashed_password to. I used the method in the Rails book to handle
hashing the password. My code is strait out of the book. The whole
object is at the end of this email.
I want
2006 Jun 05
2
When adding a record in console, a parameter comes in as null even when I set it
In console, I am trying to create a User but the :account_id does not come
in. Console just gives me back :account_id => nil. Obviously I''m trying to
set it though. Silly console...
But, I can set the account_id column in my controller like so:
@user = User.new(params[:user])
@user.account_id = account.id
@user.save
Here''s what I give to the controller:
User.create :name
2005 Dec 17
1
lost in an ActiveRecord::StatementInvalid
I have an error I don''t know how to debug. I am adding the login
suport in Depot (the example in the RoR book) and
LoginController#add_user throws ActiveRecord::StatementInvalid in an
innocent /login/add_user GET request.
The trace goes down to a call to SQLiteAdapter#table_structure, and
the source code suggests what''s happening is that "PRAGMA
2006 Apr 03
7
Getters and setters problem?
Hi list,
first evening of playing with rails, so please forgive me if I ask
something stupid. ;-)
I created a User model and tried to use ActiveRecord callbacks to
convert the password to sha1 just before saving it. For some reason
postgresql gives me a error because the given password is null. To
test even further I tried to change :login too, same error happens,
:login is empty too.
I am sure
2007 Dec 07
1
CentOP 5.1 Problem with smbldap-passwd
Hi List,
Yesterday i have upgraded from 5.0 to 5.1 and now i have a problem
with smbldap-tools.
I use smbldap-tools-0.9.4-1.el5.rf from rpmforge.
Then i use smbldap-passwd <user> i get an error:
smbldap-passwd test
Changing UNIX and samba passwords for test
New password:
Retype new password:
Use of uninitialized value in string at /usr/sbin/smbldap-passwd line
277, <STDIN> line 2.
2006 Feb 15
8
Agile book - getting confusing error
Working through the beginning phase from the Agile book on
''Administration''
undefined method `hashed_password='' for #<User:0xb7911324>
...
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/base.rb:1498:in `method_missing''
#{RAILS_ROOT}/app/models/user.rb:12:in `before_create''
2006 Aug 07
2
NoMethod Error: Modifying Location of support modules
I''m trying to follow along with the Agile Development with Ruby on Rails
book and have encountered a problem with code having the following
syntax (partial class provided):
require "digest/sha1"
class User < ActiveRecord::Base
private
def self.hash_password(password)
Digest:SHA1.hexdigest(password)
end
end
I''m getting an error as:
undefined method
2006 Feb 08
1
functional test problem
I am trying to write a test for my delete method.
I find a User in the db by its id, do the delete action, then I want to
see if it is still in the db.
How do I check that the User IS Deleted without causing errors?
** My Test ********************************
def test_delete_user
login
user = User.find(2)
post :delete_user, {:id => user.id}
assert_equal "User
2006 Jun 16
2
Problem with User Login from Agile Web Development
I am trying to use an expanded version of the User Login from the Agile
Web Development with Rails book. It takes the user name and password
but then says "Invalid user/password combination". Looking at the log
everything seems to be fine until it sends the query to MySQL. The
query shows that the name is '''' instead of the name that was passed to
the self.login
2006 Sep 22
2
foo.expects(:blah).returns(10).then(11) syntax
I recently needed the behavior of my object to change on subsequent
method calls so I added the syntax above.
Here''s the diff of changes I made:
Index: test/mocha/expectation_test.rb
===================================================================
--- test/mocha/expectation_test.rb (revision 854)
+++ test/mocha/expectation_test.rb (working copy)
@@ -95,6 +95,12 @@
2006 Mar 13
7
Problem with params
I''ve got a User model, which holds the following (excerpt):
def try_to_authenticate
User.authenticate(self.username, self.password)
end
..
private
def self.hash_password(password)
Digest::SHA1.hexdigest(password)
end
def self.authenticate(username, password)
@user = User.find(:all, :conditions => ["username = ? AND
password = ?",
2006 Jun 29
0
@response.body accumulating in functional tests?
I have two functional tests for my user controller:
def test_bad_registration
post :register, :email => "tester1@foo.com"
assert_response :success
assert_not_nil @response.body =~ /^\<error/
assert_nil assigns[''user'']
end
def test_good_registration
@response.body = nil
post :register, :username => "tester",
2008 Mar 27
0
handling post-remove URL / uninstall of application
Hi there,
I''ve configured my post-remove URL (which has to be directly to my
site, not an apps.facebook.com URL) and now I''m trying to figure out
how to handle this. It''s poorly documented here:
http://wiki.developers.facebook.com/index.php/Post-Remove_URL
It seems as though support for this is currently not yet in
Facebooker. In order to get it to work, it
2005 Oct 27
0
has_one with Single Table Inheritance - NameError : uninitialized constant
I am having a problem with using SIngle Table Inheritance with a has_one
relationship, and I am at a loss of what could be causing it. Below is the
related code and the error message.
class User < ActiveRecord::Base
has_one :wishlist
end
class List < ActiveRecord::Base
belongs_to :user
end
class Wishlist < List
has_and_belongs_to_many :items, :class_name =>
2006 Jul 24
6
error_messages_for not working
I have the following code and I am not able to get it working. The error
message is not coming on the top, it is just getting displayed on a
different page if I dont have the rescue block commented at the bottom.
Model: user.rb
require "digest/sha1"
class User < ActiveRecord::Base
validates_presence_of :eaddress, :fname, :passwd, :pcode, :country,
:day, :year, :month, :gender,
2006 Jul 16
0
Problems with validates_lenght_of
I''m building a login system, and I want users to be able to update their
password, first name and last name after signing up. So, when signing up
password can''t be nil, and it must be between 6..20 characters long. However,
on update, the user can choose to leave the password field empty (but fill in
other stuff, like first name) and then I want the User model to not update
2008 Jan 17
6
how to control self.method access
i think self.method just like class method,so if i want to define it
as a private method,i should use
private_class_method :my_method
but i found follow code in < <Agile Web Development with Rails>>
private
def self.hash_password(password)
Digest::SHA1.hexdigest(password)
end
just a mistake or there have some thing which i cannot get?
2006 Dec 01
0
[766] trunk/wxruby2: Added item_data aliases for client_data functions, update doc & tests;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding:
2016 Apr 13
0
Problems with scsi-target-utils when hosted on dom0 centos 7 xen box
On 2016-04-12 09:43 AM, Nathan Coulson wrote:
> By natively, I take it using
> kernel /vmlinuz (vs kernel /xen)
>
> Not yet, but working on setting up such an environment.
>
> (At this time, I was using virt-install to reproduce the problem, and
> the original server we are testing on did not support kvm but the 2nd
> server does).
>
> On 2016-04-12 03:26 AM, George