Displaying 20 results from an estimated 800 matches similar to: "`test': wrong number of arguments (1 for 2) (ArgumentError)"
2005 Dec 17
2
Subfolders in Rails applications (newbie)
After about a week playing with Rails, I have built a couple of apps but
am still unable to get one thing to work: subfolders. (I am probably
using the wrong term here, but oh well...)
I would like my rails application to have controllers logically grouped
into folders. So for instance:
http://domain.com/accounting/accounts
http://domain.com/hr/employees
Here''s how I have tried to
2009 Jun 01
0
ArgumentError (interning empty string)
Hello,
I am trying to send an email out on registration for confirming and I
am thrown this error. I am unable to understand as nothing is nil in
the class which I am passing to the Mailer. Please do help me. The
stack trace follows:
ArgumentError (interning empty string):
app/controllers/accounts_controller.rb:103:in `register''
app/controllers/accounts_controller.rb:43:in
2008 Oct 14
4
replace_html not working
hallo, everyone
can anybody help me? i did add my code under ENGINES as a module in a
project. before the change , all worked . and the differenz between
both is only about application''s environment,
before is
Ruby version 1.8.6 (i486-linux)
RubyGems version 1.1.1
Rails version 2.0.2
Active Record version 2.0.2
Action Pack version 2.0.2
2010 Jun 15
11
mysql gem install not happening on Mac OS Leopard - any inputs at all??
Hello all,
Ive got Mac OS X Leopard (10.5.8), ruby 1.8.6 (2009-06-08 patchlevel
369) [universal-darwin9.0] and mysql 5.0.67 installed and working fine
with Rails 2.1.0.
"which ruby" outputs /usr/bin/ruby. I can see the mysql symlink in /
usr/local/mysql. I can also see the mysql-5.0.67-osx10.5-x86 folder
in /usr/local .
Im trying to upgrade my Rails apps to 2.3.5 but when i try to
2008 Oct 11
8
Observing few fields in a form - Best Practise?
Hi,
im looking to build a page similar to a shopping cart page. When you
change the ''price'' or ''quantity'' fields, the total is calculated and
displayed.
There are other fields in the form which have no relation to this
action. So i guess observe_form is not required. Can someone tell me
what the best practise is for this?
2009 Apr 30
1
error with test:functionals
Hello there,
I working on my tests but I getting this strange errror:
I can see on the database that the object was created but I still got
an failure on my test.
this is my test code:
test "should create artist" do
assert_difference(''Artist.count'', difference = 1) do
post :create, :artist => { }
end
assert_redirected_to
2006 Mar 10
1
Problem rendering components
I have an AccountsController that inherits from ApplicationController.
In ApplicationController I define a generic layout. In this layout I
render @title that is actually assigned in the AccountsController but
has a default value in ApplicationController.
In the layout template, I also have the standard contents_for_layout and
lastly, I have a render_component. The component called from the
2007 May 08
3
assert_difference eval magic in [6693]
I just saw Marcel''s change to assert_difference that changes the
method API to take a string param that is evaled in a lambda.
http://dev.rubyonrails.org/changeset/6693
I much preferred the old API, since it''s simple enough to pass a
lambda. Passing a string means the lambda is in the wrong scope and
doesn''t have access to objects in the test case scope.
For an
2009 Mar 17
4
Preventing a submitted hash from ActiveRecord DB store
Hi all,
I have a multi model form (Project with many tasks) and I want to
prevent a task from being saved to the DB if it is empty ie. if there
is no i/p for that task from the user. I tried the following
class Task < ActiveRecord::Base
before_save :check_if_empty
...
def check_if_empty
self.destroy if description.blank?
end
but i get this
TypeError in ProjectsController#create
2009 Aug 07
2
calling a jQuery function from RJS/onclick
Hi,
I have the following jQuery function on the head of my page.
<script type="text/javascript">
jQuery.noConflict();
/* calling jNice on document ready */
jQuery(document).ready(function($)
{
$(''div.jNice'').jNice();
});
.....
</script>
On page load, this gets called correctly.
Now there''s a link on the page that lets me add more
2009 May 11
3
daemons load activesupport 2.2.2 instead of 2.1.0, causing failure
Hi,
I have a couple of daemons that im trying to setup to be run for my
app. The environment load is as follows..
ENV["RAILS_ENV"] ||= "development"
require File.join(File.dirname(__FILE__), "/../../config/environment")
And the error I get is
#<LoadError: no such file to load -- active_support>
#<Gem::Exception: can''t activate activesupport (=
2008 Feb 04
1
Error on nil.build
I can''t figure out why I am getting an error for one of the tests below:
========================
describe AccountsController, "POST" do
before :each do
@user = mock_model(User)
@account = mock_model(Account, :id => 1, :valid => true, :save =>
true, :users => mock("users", :build => @user))
Account.should_receive(:new).and_return(@account)
2011 Aug 25
0
Rails 3.0 Fleximage Error Errno::EACCES
Hi,
I''m using Fleximage on my website so users can upload avatars. I
recently upgraded to Rails 3.0 and switched host to slicehost.com. I
successfully installed imagemagick and the gems rmagick and fleximage.
Everything seems to be working fine except when I try to edit my account
and upload an avatar. After selecting an avatar and click the update
account button I get the following
2006 Aug 06
2
assert_difference gives undefined method error in unit tests
Hi there
Am hitting undefined method errors for ''assert_difference'' in my unit
tests under Rails 1.1.4
What could I be missing?
Richard Sandilands
2007 Oct 17
1
Problem with assert_difference
Hello Friends,
I have problem with assert_difference, I want its syntax and
explantion in detail, Please help me, plz give me solution.
Regards,
Kiran Polawar
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2010 Mar 17
3
ActiveRecord::StatementInvalid: Mysql::Error: Lock wait timeout exceeded
Hi all,
Ive been getting this error on one particular query repeatedly for the
past few days.
ActiveRecord::StatementInvalid: Mysql::Error: Lock wait timeout
exceeded; try restarting transaction: UPDATE `posts` SET `updated_at`
= ''2010-03-17 05:35:00'', `view_count` = 54 WHERE `id` = 158
Googling around, I found that this is basically because the
transaction times out after
2012 May 22
0
functional tests assert_difference with array
given a new partner instance and a new admin instance are created,
what should be the difference number : +1 or +2
the doc is not so clear on it....
assert_difference [ ''Partner.count'', ''Admin.count'' ], +1 do...
thanks for feedback
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to
2006 Dec 04
5
should_be_different -- possible implementation
There is an assert_difference helper for Test::Unit (you can read
about it at http://blog.caboo.se/articles/2006/06/13/a-better-
assert_difference and to some it should look familiar -- you know who
you are :), so I took a shot at one for rSpec on Rails.
class Object
def should_be_different(method = nil, difference = nil)
return self.should_not_eql(yield) if method.nil?
2009 Sep 14
2
RMagick Installation woes
Hi,
I need to install Rmagick to get re-sizing working with Paperclip. My
dev machine is on Mac OSX Leopard and the server is on Ubuntu Intrepid
8.1
I dint have Macports or wget at first. I was following this article -
http://onrails.org/articles/2007/11/03/installing-rmagick-on-leopard-without-macports-or-fink.
Ive done this before too. But some dependency always failed.
I want to start with a
2008 Oct 25
2
Script/Server working but Script/Console not working
Hi all,
I have been having a very weird problem for a few weeks. I am able to
start up the server using "script/server" for my application and run
it successfully but "script/console" is not working. I have been
managing without it but somethings not right and i need to fix it.
This is the error that it throws and the trace.
Loading development environment (Rails 2.1.0)