Displaying 20 results from an estimated 4000 matches similar to: "test_create gets 200 instead of :success"
2006 Aug 18
2
How do I sort the drop-down list?
I''ve added a drop-down list of first and last names of borrowers to a
form. How do I sort them by LastName, FirstName in the drop-down?
I''m using code based on the cookbook example:
<select name="borrower[borrower_id]">
<% @borrowers.each do |borrower| %>
<option value="<%= borrower.id %>">
<%= borrower.FirstName <<
2006 May 05
3
posting xml in functional test
Hello,
I''m trying to write a functional test for a simple CRUD controller which
accepts / emits xml in a REST- like fashion. However the following code
won''t work for me - an exception is generated
def test_create
post :create, ''<person><name>john</name></person>'',
2006 Jul 06
6
Functional tsts
Hi all,
I have created projects module in my application using scaffold,
and it created me everything, and all the modules are working except the
functional test. This is the error
1) Failure:
test_create(ProjectsControllerTest)
[test/functional/projects_controller_test.rb
:55]:
Expected response to be a <:redirect>, but was <200>
8 tests, 25 assertions, 1 failures, 0
2006 May 16
3
Testing How To Question
I''m using the functional test for a method like this:
def test_create
post :create, :phase => ''copynew'', :id => 1
assert_response :success
assert_template ''create''
assert_tag :content => ''New Item''
assert_not_nil @item
end
This posts a request to the create method in the controller. Is there
any way to look
2010 Sep 04
3
its easy but i forgot all
my models
borrower ----- has_many :loans
loan ----- belongs_to :borrower
my loans _controller
def new
@borrower = Borrower.find(params[:borrower_id])
logger.debug '' @borrower.id''
logger.debug @borrower.id
@loan = Loan.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @loan }
end
2009 May 18
0
[PATCH server] fixed functional tests after recent controller refactoring and managed node controller fixes.
Signed-off-by: Scott Seago <sseago at redhat.com>
---
src/test/functional/host_controller_test.rb | 41 --------------------
.../functional/managed_node_configuration_test.rb | 14 ++++---
src/test/functional/nic_controller_test.rb | 8 ----
src/test/functional/permission_controller_test.rb | 15 ++++---
src/test/functional/quota_controller_test.rb | 2 +-
2005 May 31
2
Form Dates and MultiparameterAssignmentErrors
I''m using the date_select form helper for a date_of_birth field on an
ActiveRecord object. When I try to save a date earlier than 1 Jan 1970,
ActionController punts with
ActiveRecord::MultiparameterAssignmentErrors. The message it gives is
"1 error(s) on assignment of multiparameter attributes". I was able to
catch the exception and look at it, and it is certainly complaining
2011 Dec 13
1
[LLVMdev] Issues in converting C++ code to C using llvm and llc
Hello All,
I came to know from a friend that using LLVM insfrastucture one can convert
C++ programs to C. I needed this for my cross-compiler because we don't
have support for C++ compilation in our cross-compiler.
I tried following:
http://llvm.org/docs/FAQ.html#translatecxx
While I can generate .bc its llc which gives error. Then I also tried
"clang" as oppose to llvm-g++.
Here
2007 Jun 13
14
Do delegates work properly in Drb mode?
Hi folks,
I have several models that index well in Drb mode.
However, I have one scenario where it works in normal mode, but not in
Drb mode.
model A
field :one
end
model B
belongs_to :a
field :two
delegate :one, :to => :a
acts_as_ferret :fields => { :one => {}, :two => {} }, :remote => true
end
If I leave off the :remote parameter, it works. Or, if I don''t
2006 Sep 26
0
some help with functional testing of nested routes
I have the following functional test in test/functional for testing my
products_controller:
require File.dirname(__FILE__) + ''/../test_helper''
require ''products_controller''
# Re-raise errors caught by the controller.
class ProductsController
def rescue_action(e)
raise e
end
end
class ProductsControllerTest < Test::Unit::TestCase
fixtures
2006 Aug 17
2
validates_length_of with char field
I am new to ruby/rails and am having a problem with validates_length_of.
It seems to work fine on a varchar field, but when I try it on a char
field the extra characters are silently truncated and the message
appears that the record was successfully updated.
How can I get my app to produce my error message instead? I''ve tried
various variations, but here''s one of my tries:
2006 Aug 18
3
Can I run multiple apps simultaneously?
I would like to compare and contrast code and effects from various
different tutorials and sample applications. Can I run, say, a mongrel
server from more than one app location? I know I can''t do that if
they''re both using port 3000 (I tried), but is it possible to configure
some apps to use a different port? Where would I do that? Most of the
apps are using mysql databases.
2005 Nov 23
15
:conditions => ... formatting
With code like:
if @params[:pnumber] =~ /\s*p?(\d+)\s*/
if student = Student.find_first(:conditions => ["pnumber like \":pnumber%\"",
{:pnumber => $1}])
@borrower = student
elsif emp = Employee.find_first(:condiwions => ["pnumber like \"?\"",
{:pnumber => $1}])
@borrower = emp
else
2006 Aug 11
5
Unit tests - NilClass problem
Hi!
Yesterday I started to write my unit tests for the fist time using
rails. I''m using this method:
http://blog.codahale.com/2005/12/23/a-rails-howto-simplify-your-unit-tests/
My customer_test.rb looks like this:
require File.dirname(__FILE__) + ''/../test_helper''
class CustomerTest < Test::Unit::TestCase
fixtures :customers
# Replace this with your real
2006 Nov 29
6
How do I create an array to represent an empty record?
Here''s something that''s a snap to do in desktop database management
systems (like Paradox or Access) but I haven''t figured out how to do it
in RoR, and can''t seem to find any examples by googling, etc.
My overall goal is to create a temporary space in which to create and
process a single new record (representating a payment transaction), and
when I''m
2006 Apr 16
5
Newbie Problems with pluralization
Hi,
I have a many to many relationship incorporating the following tables:
taxes --> taxes_tax_groups --> tax_groups
I have a model named tax with the following declaration:
has_and_belongs_to_many :tax_groups
and I have a model named tax_group with the following declaration:
has_and_belongs_to_many :taxes
I am attempting to run the following unit test:
require
2006 Mar 19
2
Unit test confusion
Hey all,
I''m following along with AWDWR, specifically the unit testing.
On page 148, it shows you how Test::Unit::TestCase will automatically
define instance variables based on your fixtures.
It doesn''t seem to actually work, though. It seems that both @artists
["beatles"]["name"] and @beatles.name are nil objects in my test,
where as
2006 Oct 12
2
How do I test a unique index?
I have a loans table and a payments table. Each loan has_many payments.
So far no problem.
Now, the payments table has a payment_number field, and each payment has
a payment_number unique within that loan. For example, Loan A can have
payment_numbers 0, 1, and 2 and Loan B can have payment_numbers 0, 1, 2,
and 3 (but only one of each payment_number). I can enforce this with a
unique index in
2003 Jun 04
2
rsync and cygwin
Hi, I'm having some trouble using rsync on W2K under Cygwin. We are using it
to back up the W2K machine to a Linux machine. We are using the patched
version of rsync 2.5.6 that allows it to run faster on NT/2K when
calculating the changes. We can backup a directory without a problem, but
in this case, we want to backup everything, so the directory we are backing
up is \. We do not run rsync
2010 Aug 30
2
Band-wise Conditional Sum - Actual problem
Dear R helpers,
Thanks a lot for your earlier guidance esp. Mr Davind Winsemius Sir. However, there seems to be mis-communication from my end corresponding to my requirement. As I had mentioned in my earlier mail, I am dealing with a very large database of borrowers and I had given a part of it in my earlier mail as given below. For a given rating say "A", I needed to have the bad-wise