similar to: Tests creating output?

Displaying 20 results from an estimated 800 matches similar to: "Tests creating output?"

2006 Jan 25
2
Testing a model method - private method?
Hi everyone, I''m trying to test a method in my model: def html_email return "<a href=''mailto:" + self.email + "''>" + self.email + "</a>" end The method works ok. But when I try to test it: assert_equal ("<a href=''mailto:" + people(:staff1_person).email + "''>" +
2010 Jan 18
3
The role of self and :: within a method of a model
Hey all, I understand that a def self.abc, for example, is a class method, which allows you to call its contents by just referencing model.abc (rather than model.new.abc). However, what is its role when located in a method inside a model like in the code below. Also in the code below, you see :: located in the method. Isn''t that used for modules and namespaces? If so, why is it located
2003 Feb 22
1
SIP register= bug?
I am seeing some very peculiar things in the routines that REGISTER my * server with several accounts. I saw this on my console: . . . NOTICE[5126]: File chan_sip.c, Line 1878 (sip_reg_timeout): Registration timed out, trying again NOTICE[5126]: File chan_sip.c, Line 1878 (sip_reg_timeout): Registration timed out, trying again NOTICE[5126]: File chan_sip.c, Line 1878 (sip_reg_timeout):
2000 Nov 22
1
Configuration Trouble
I have succeeded in getting two tinc1.0pre3 hosts to connect, but I can't ping one from the other. I can ping the local tap interfaces. tcpdump shows that icmp echo requests are received by the other host, but no replies are sent. The two hosts are North and South. It is the same pinging North to South and South to North. The hosts are configured as follows: South: Debian 2.2
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 Apr 21
2
destory Test Case Messes up all tests
I am trying to create unit tests for my users model but when I add a test that destroys a user, that user is not available in any of the other test. If I remove the test that destroys the user all my other tests work again. All the fixtures are suppose be reloaded between tests right? Here is my testcase : require File.dirname(__FILE__) + ''/../test_helper'' class UserTest
2015 May 06
2
Using ldap to check last password modification date
Thanks Rowland. That makes sense :-) BTW, Is the following code enough to change the password with python-ldap? con.sasl_interactive_bind_s("", sasl_auth) mod_attrs = [ (ldap.MOD_REPLACE, 'unicodePwd', new_password), (ldap.MOD_REPLACE, 'unicodePwd', new_password) ] con.modify_s('CN=%s,CN=Users,DC=lxc,DC=com % username, mod_attrs) Thanks! Regards, Norberto
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
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
2010 Aug 17
2
[Form] Method POST & PUT problem
Hello, I have a form that should be a POST method, but Rails insist to put a hidden field "_method" that has the value "put" does anyone knows why? Thanks, David Sousa Controller: ------------------------------- def new @user = @current_user end ------------------------------------------- View: ------------------------------------- <% semantic_form_for @user,
2015 May 07
0
Using ldap to check last password modification date
On 06/05/15 15:59, ?? wrote: > Thanks Rowland. That makes sense :-) > > BTW, Is the following code enough to change the password with python-ldap? > > con.sasl_interactive_bind_s("", sasl_auth) > mod_attrs = [ > (ldap.MOD_REPLACE, 'unicodePwd', new_password), > (ldap.MOD_REPLACE, 'unicodePwd', new_password) > ] >
2006 Mar 04
4
Two quick newbie questions
2 quick questions regarding authentication ... 1) the flash[:notice] on successful login looks completely wrong to me. How should it be done? def index if request.post? @user = User.new(params[:user]) authentic_user = @user.attempt_login if authentic_user session[:user_id] = authentic_user.id flash[:notice] = ''Login successful! Welcome
2006 Apr 04
3
model validates twice in tests, produces duplicate errors
In my unit tests for my User model, I''m testing some validation cases. What is really strange, and driving me crazy, is that in the unit tests, it seems like the save method is causing my validations to execute twice, and produce duplicate error messages. This is making my tests fail (because I''m checking for the number of errors that I expect). In the web browser, only one error
2006 Jan 24
3
AJAX Preview & Edit Page Problem
I''m new to RoR and have started building my first application. I''m building an account sign-up controller and I have two questions: 1. What is the best way to pass form params between methods in my sign-up controller? The solution I''m using seems too hacky and there''s got to be a something more elegant. I''m instantiating User.new to capture the
2006 Jul 06
1
Form not inserting data into database
I have a form to register a user. The issue I am having is the fact that it only populates login, hashed_password and created_at fields. DB table: create table users ( id int not null auto_increment, login varchar(100) default null, hashed_password char(40) default null, email varchar(255) default null, salt varchar(255) default
2010 Sep 07
0
Spoke too soon - problems with logons using new PDC
Hi - Linux: Ubuntu 9.10 all updates applied as of 9/5/2010. Samba: 3.4.0 smb.conf global section: [global] netbios name=blahblahblah sever string=Domain Master workgroup=blahblahblah encrypt passwords=true wins support=yes domain master=yes local master=yes preferred master=yes os level=255 security=user domain logons=yes passdb backend=smbpasswd logon script=%U.bat add machine script=sudo
2003 Nov 07
0
sipdtmfmode problem
Greetings. I'm having a bit of a problem using the sipdtmfmode app. I have two incoming paths to * from pstn via FWD that use differing dtmfmode. IPKall wants rfc2833, libretel wants inband. If I set dtmfmode= in the fwd peer config in sip.conf each works seperately, and I'm trying to use gotoif and sipdtmfmode to switch based on the CID calling. Output seems to indicate sipdtmfmode
2007 Jul 09
3
NoMethodError when using find_by_sql
I''m try to verify users on login. Here is my code: def self.authenticate(username,password,account_code) employee = self.find(:all, :select => "e.id, e.first_name, e.last_name, e.username, e.account_id, e.department_id, o.pay_type_id, o.admin_yn, o.payroll_yn, o.files_yn, o.dept_report_yn,e.salt, e.hashed_password", :conditions => ["e.deleted_yn=0 and
2006 Jul 06
1
Problem implementing password and password confirmation
Hi, I''m trying to implement password confirmation, based on the Agile example, but just can''t make any progress. User DB has these fields: ========================= t.column :name, :string, :limit => 40 t.column :hashed_password, :string t.column :salt, :string User model has: =============== attr_accessor :password_confirmation
2005 Mar 23
1
OT Anybody any comments?
List, from the Dutch "Computable" paper ICT tabloid and daily ICT subscribable mailing-list and so-called verwittigingsbrief/ad hoc news letter, partly translated into English by me ;) Dutch readers only: http://www.computable.nl/nieuws.htm?id=524000 "Manage Windows clients from Linux servers" blahblahblah Zenworks 7, the latest release of Novell's sysadmin suite".