Displaying 20 results from an estimated 5000 matches similar to: "Login systems : stubbing accounts and AR association proxies"
2006 Aug 07
8
Login form question
I''m using Rails Recipes to create a login form but instead of username
and password, my setup is firstname, lastname, password.
I seemed to be gramatically challenged and not sure how to set up the
parameter list.  Can anyone offer up a suggestion.
The book shows the method starting like:
if request.post?
user = User.find(:first, :conditions => [''username = ?'' ,
2011 Dec 08
5
Master repeatedly killing workers due to timeouts
Hi,
We''re using unicorn as a Rails server on Solaris, and it''s been
running great for several months.  We''ve recently been having a few
problems and I''m at a loss what might cause it.  A number of times in
the past few days, our unicorn slaves keep timing out & the master
keeps restarting them.  unicorn.log looks something like :
E,
2006 Aug 16
1
Stale object errors
I''m running into a couple of stale object problems with methods that  
at first glance appear fairly atomic - eg Message.update(params[:id],  
{:body => params[:value]})
Of course, Rails has to instantiate the object & validate it before  
it updates the database, so it''s not actually atomic, hence the  
occasional staleobject error.
So I''ve been wondering about
2006 Jul 20
5
Why don''t I get 404s?
When I go to a missing page in my rails app, I get the 500.html page,  
and this in my log output:
no route found to match "/asdasd" with {:method=>:get}
./script/../config/../vendor/rails/actionpack/lib/action_controller/ 
routing.rb:1057:in `recognize_path''
./script/../config/../vendor/rails/actionpack/lib/action_controller/ 
routing.rb:1047:in `recognize''
2006 Sep 28
1
upload_progress and DRb.start_service crashes
Whenever I tried to start mongrel_rails with the upload progress  
script, it would die with the following error:
/usr/local/lib/ruby/1.8/drb/drb.rb:837:in `getaddrinfo'': getaddrinfo:  
No address associated with nodename (SocketError)
         from /usr/local/lib/ruby/1.8/drb/drb.rb:837:in  
`open_server_inaddr_any''
         from /usr/local/lib/ruby/1.8/drb/drb.rb:860:in
2008 Jun 28
19
Stopping example execution?
Hello, I''m wondering If I am missing something here when creating an example that sets an expecation at the top or beginning of an action but requires you to stub / mock everything that follows.
Example:
I want to test that a certain controller is running a before_filter...thats easy:
- controller.should_receive(:require_user)
- do_get
But now i''ve got to mock / stub
2006 Jul 27
4
How To Test For W3C compliance locally and possibly to include it in to Continuous integraition process
Hi Everyone,
As many of you out there I''m "protected" by the firewall which prevents 
me from checking my code for W3C compliance, I am able to check the 
production
code but i would like to test my code before it goes to production.
So if anyone was able to have that check done locally, possibly 
including some sort of tests in to the integration process, I would 
truly
2007 Oct 05
7
Easy AR association stubbing
I''ve added a method to the mock class that makes it pretty easy to
stub associations in rails. I''ve been using it for awhile and it seems
to cut down on a lot of setup code for the controller and model specs
that use associations.
#before
@person = mock_model(Person)
posts = mock(''post_proxy'')
posts.stub!(:build).and_return(mock_model(Post, :save => true))
2007 Feb 01
3
with-arguments block is executed regardless of method?
I have a test case where I''m stubbing one method (''jobs''), and  
mocking another (''new_worker'')
MiddleMan.stubs(:jobs)
MiddleMan.expects(:new_worker).with{|args| args[:class] 
==:download_worker}
MiddleMan.jobs()
The above code results in an error ("The error occurred while  
evaluating nil.[]") - calling ''jobs'' results in
2007 Feb 07
1
Repeatedly dying with "failed to find slave socket"
I''m struggling to keep backgroundrb v2 running for more than 24  
hours.  It appears to be running fine for a while, then tries to fire  
off a worker (exactly the same worker it''s been running for the past  
few hours), and it suddenly dies.  I haven''t found any pattern for the  
cause of this.
In backgroundrb_server.log, the final entry is this :
20070206-10:41:45
2013 Feb 04
2
reshape help
Dear R users -
I have a list of patient identifiers and diagnoses from inpatient
admissions.  I would like to reorganize the list, presently in a long
format to a wide format in reshape, but in the absence of a "time" element,
I am uncertain how to do this - any help greatly appreciated.
ID   Dx
A    nausea
A    diabetes
A    kidney failure
A    heart attack
A    fever
B    fever
B   
2006 Jul 07
3
Mongrel & irbrc
Why does mongrel_rails insist on loading ~/.irbrc with each request?
a) I''m curious why it loads it at all (I assume there''s no way of  
getting an inline breakpointer??)
b) Why re-load it?  It causes problems with any constants that are  
used in .irbrc...  (alternatively, how do I avoid re-assigning to a  
constant?)
Jon
-------------- next part --------------
A non-text
2006 Aug 10
4
Speeding up ActiveRecord creation?
My completely empty model (no validation callbacks etc etc) takes an  
average of 0.05 seconds to create, at least according to
Benchmark.realtime{200.times{Message.create(:from =>  
"me@here.com", :message_type => ''email'',
:subject => "hello", :body => "goodbye", :sent_at => Time.now)}}/200
That''s a little slower than
2006 Dec 20
6
Mongrel 1.0 RC1 Full Win32 Build
Hello Minions!
It''s *finally* here.  Mongrel 1.0 RC1 for everyone to test, even the win32 folks.  I managed to get everything to build on windows, including fastthread, and even cleaned up the "releases source":http://mongrel.rubyforge.org/releases/ so that it should install cleaner.  Win32 will have to try and report problems, as it seems rubygems is real finicky on win32.
2019 Aug 29
4
I broke "yum update" - C7
Am 2019-08-29 16:51, schrieb Gary Stainburn:
> On Thursday 29 August 2019 15:45:44 Gordon Messmer wrote:
>> On 8/29/19 3:03 AM, Gary Stainburn wrote:
>> > https://us-east.repo.webtatic.com/yum/el7/x86_64/repodata/repomd.xml: [Errno 14] curl#60 - "Peer's Certificate issuer is not recognized."
>> 
>> 
>> What do you see when you run:
>> 
2006 Jul 10
3
Receiving mail - "No such file to load -- pathname"
I''m using postfix in OS X to receive mail and forward it to my rails  
app.  When it tries to feed the email into rails, it fails with the  
following error:
"/Users/jon/Developer/OneMod/script/runner ''MailMan.receive 
(STDIN.read)''".
     Command output: /Users/jon/Developer/OneMod/script/../config/ 
boot.rb:7:in `require'': No such file to load --
2006 Jul 21
3
Re-formatting email line breaks
I''m trying to re-flow email messages, removing the line breaks that  
get added by mail programs so that the lines don''t exceed 72 characters.
Mail.app and Thunderbird seem to insert a space character before each  
added line break.
Outlook replaces new lines in the email with double \n''s, then uses  
single \n''s for the ''soft'' line breaks.
2006 Aug 07
2
Getting an array of ids from form checkboxes?
Is it possible to set up a list of checkboxes so that the form  
parameters are given in an array  (eg  {"delete_list" => [3,6,7]}) ?
At the moment I''m using
<%= check_box_tag "delete_list[#{post.id}]" %>
...which gives parameters looking like {"delete_list" => {"3" => "1",  
"6" => "1",
2006 Aug 12
2
Mongrel 0.3.13.4 headers seem a bit broken...
I''m running a Rails (r4720) app on OS X 10.4.6.  Mongrel 0.3.13.3  
works perfectly for me.  Mongrel 0.3.13.4, not so much.
Redirects don''t work, for one thing.  This rails code :
redirect_to :action => ''login''
correctly redirects me on 0.3.13.3.  Here''s the header I get back :
HTTP/1.1 302 Moved Temporarily
Content-Length: 93
Connection: close
2008 Jan 10
4
Mocking and stubbing Rails'' association extensions
I''m having a lot of trouble stubbing out an association extension for  
some view tests. Example rails code modeling a music album:
class Album < ActiveRecord::Base
   has_many :songs do
     def streamable
       find(:all, :conditions => ''streamable = 1'')
     end
   end
end
So for a given Album instance (say @album), I need to be able to stub  
both