Displaying 20 results from an estimated 400 matches similar to: "operator overload on views"
2006 May 04
2
Testing associations
I have a pretty simple model, articles and users.
class Article
belongs_to :user
end
class User
has_many :articles
end
In my unit tests I want to ensure that the associations work properly.
What''s the best way to do this? The obvious thing to do is a test in
each model.
# user_test.rb
def test_add_post
u = users(:first)
before_articles = u.articles.count
u.articles
2006 May 04
3
@products["car"] is not being recognized in my tests!! help
@products["car"] is not being recognized in my tests:
class ProductsControllerTest < Test::Unit::TestCase
fixtures :products
def test_view_product
post :view_product, :id=>@products["car"].id
assert_template "view_product"
...
end
end
products.yml :
car:
id:1
name:test
Does anyone have any idea why its not working?
Im having to do
2006 May 03
3
create test methods from Controller methods?
Can you somehow create a test that contains methods that relate to the
methods in the controller that is being tested?
Thanks
Chris
--
Posted via http://www.ruby-forum.com/.
2006 May 03
1
Nubee Fixtures + Tests problem
According to the book, @timesheets["first_timesheet"] should be
accesible from within my functional test, but its not!
Timesheets.yml :
first_timesheet:
status: 2
start_date: 2006-04-24
cost: 10
employee: 444
id: 10683
charge: 20
My Test :
class AdminTimesheetsControllerTest < Test::Unit::TestCase
fixtures :timesheets
def test_viewTimesheet
get
2006 May 10
1
model mixin module madness
If I have several models which exhibit the same functionality, it seems
makes sense to create a mixin, ''include'' it in each model and save
myself some work and repeated code.
Where can I define a module which will be available to all models? I
can''t seem to find a documented place for them.
Alternatively, is there a Rails-standard way of achieving the effect?
Ben
2006 Apr 28
1
how do I test links in templates?
Hello everyone!
Sorry, if it''s stupid question, but I can''t figure out how to do this.
I have a set of statements, for example, ''login page should have a
link to register new user'' and ''login page should have a link to
password recovery''. How do I transform it into tests? Where it should
go? It does not look like functional tests or
2006 May 03
2
Conditional statement style
This is a bit of a nuby question methinks but i''ve had a play/search
around and it''s just bugging me now :0)
Say I have a conditional statement, testing a variable against a number
of values. The first way i did this is like so:
if myvar != "" and myvar != 0 and myvar != nil
# .. code
end
This seems a bit messy - is there neater way of doing this? I thought of:
2006 Mar 19
1
How to access atributes from a join table?
I have a table "domains", "users" and a join table of "domains_users"
which has the domain_id, user_id as well as a userlevel_id attribute.
I know that in the model User class I can set the value of this
attribute with a function that calls:
domains.push_with_attributes(domain, :userlevel => 1)
but how do I access the userlevel field so that I can use it later
2011 Feb 15
2
Probe that fires on incoming IP and/or UDP (Solaris 10)
On Solaris 10, is there a probe that fires on receipt of an IP/UDP
packet? I''ve spent some time looking for one but can''t seem to find
what I want. (It''s unfortunate that its not running OpenSolaris as
otherwise we''d use the ip provider.)
What I''m trying to do is collect data on the latency between a packet
being received and it making its way into a
2006 May 15
2
[PATCH 10/12 bugfix: openssh-4.3p2: memory leak
The variable local_user was allocated by xstrdup and is not freed or
pointed to in this branch. This patch adds the xfree. This entire set
of patches passed the regression tests on my system. Bug found by
Coverity.
Signed-off-by: Kylene Hall <kjhall at us.ibm.com>
---
sshconnect.c | 1 +
1 files changed, 1 insertion(+)
diff -uprN openssh-4.3p2/sshconnect.c
2007 May 03
1
Mac - Filesystem Size Limit?
Let me preface by saying I am not a samba expert. I've messed around
with the smb.conf file a few times, and mount to the shares regularly.
We are on 10.4.x on brand new Intel macs. We are mounting a samba
share that is approx 4.8TB, but only 1.9TB shows as the size of the
disk.
Is this a known limitation of samba on the Mac, or can it be fixed by
upgrading to a newer version of the
2009 May 24
1
Problems with ioloop on MacOS
I've been using the macports version of dovecot, which is 1.1.11, on
MacOS 10.5.6
$ /opt/local/sbin/dovecot --exec-mail imap
Fatal: kevent(EV_ADD, 0) failed: Operation not supported
This version is configured --with-ioloop=kqueue
The problem seems to be known, if not understood:
http://lists.apple.com/archives/Darwin-userlevel/2008/Dec/msg00010.html
However, if I use
2003 Feb 17
2
how to define share for sharing lmhosts?
Hi All,
Probably simple question: I want to make a share for sharing an lmhosts
file which gets included by the clients. This share has to be very
public and accept nullsessions (whatever that me be (no username and
password?)).
I want this because I need to generate aliases on the fly for for our
fileserver for some clients (terminalservers specifically). So I thought
that having an server
2016 Nov 16
2
Exim still accepting emails to nonexistent users
After adding the configuration bit:
deny
message = invalid recipient
domains = +local_domains
!verify = recipient/callout=no_cache
from: http://wiki2.dovecot.org/LMTP/Exim <http://wiki2.dovecot.org/LMTP/Exim> running update-exim4.conf and service exim4 restart
the server is still accepting emails to recipients that do not exist in dovecot.
Any ideas?
2010 Mar 04
1
ADS integration and local users...
Hello,
I have a Debian server with Samba. I've put this server in AD. Everything
is ok for domain users, but I can't connect with a local user !!!
I've created this local user :
# adduser local_user
# smbpasswd -a local_user
Then :
# smbclient \\\\192.0.0.1\\ressource -U local_user
Enter local_user's password:
Domain=[MY_DOMAIN] OS=[Unix] Server=[Samba 3.2.5]
tree connect failed:
2011 Jan 16
5
Smart IMAP proxying with imapc storage
I just committed a very early initial implementation of "imapc" storage
backend to v2.1 hg: http://hg.dovecot.org/dovecot-2.1
You can't really do anything except open INBOX and read mails from it,
so it's currently only intended for initial testing. It sucks in many
ways right now, but I'll be improving it.
The idea is that you could set for example:
mail_location =
2016 Nov 21
2
Exim still accepting emails to nonexistent users
Hi,
Heiko Schlittermann <hs at schlittermann.de> (Mo 21 Nov 2016 11:50:13 CET):
> a) Routing stage
> You need to interact with the user database dovecot uses.
> Either you access the user database directory (flat file, LDAP,
> whatever) or you use the ${readsocket?} feature of Exim to talk to
> dovecot.
The readsocket trick doesn't seem to work anymore.
Using
$
2016 Nov 21
2
Exim still accepting emails to nonexistent users
Hi Heiko,
Here is the router:
virtual_aliases:
driver = redirect
debug_print = "R: Check address using virtual_aliases for $local_part@$domain"
allow_fail
allow_defer
hide data = CHECK_VIRTUAL_ALIASES
user = vmail
group = mail
local_user:
debug_print = "R: local_user for $local_part@$domain"
driver = accept
2006 Mar 19
1
How to access attributes from a join table?
I have a table "domains", "users" and a join table of "domains_users"
which has the domain_id, user_id as well as a userlevel_id attribute.
I know that in the model User class I can set the value of this
attribute with a function that calls:
domains.push_with_attributes(domain, :userlevel => 1)
but how do I access the userlevel field so that I can use it later
2010 Apr 01
4
Printer Admin Difficulties
I have been trying to setup a new print server on Fedora 12 based around
samba-3.4.7-58.fc12.x86_64 and cups-1.4.2-28.fc12.x86_64. All looks
good except for the ability for printer administrators to manage
printers. Whether I specify users in a system group using the
deprecated printer admin option, or specifically using net rpc rights
and the SePrinterOperatorPrivilege, it does not matter.