Displaying 20 results from an estimated 1000 matches similar to: "Function Testing Reloading Fixtures before assertion"
2010 Jan 30
2
passing multiple objects with remote_function
Hey,
I can successfully pass a single object from any form field to my
controller via:
Select Year: <%= collection_select("vehicle", "year", @availableYears,
"year", "year",
{:prompt => "Select a year"},
{:onchange => "#{remote_function(:url => {:action
=>
2007 Mar 03
5
url_for and arrays parameters (diffs between rails 1.1.6 and 1.2.2)
Hello,
I posted this to the main rails list
(http://www.ruby-forum.com/topic/99845), but haven''t received any
replies yet, so maybe this question is better suited here. Sorry if
this has been brought up before, I couldn''t find any previous
discussion on this.
To summarize the post...
When using the latest Rails (1.2.2)
I''m passing an array to url_for like so...
2013 Oct 06
8
[Bug 70212] New: glxinfo triggers assert in cso_release_all after 3f0627c2ad6
https://bugs.freedesktop.org/show_bug.cgi?id=70212
Priority: medium
Bug ID: 70212
Assignee: nouveau at lists.freedesktop.org
Summary: glxinfo triggers assert in cso_release_all after
3f0627c2ad6
Severity: normal
Classification: Unclassified
OS: All
Reporter: awatry at gmail.com
2010 Aug 06
4
Object/Record foreign key IDs set to zero
Hello,
Hope no one minds me just jumping in here with a question.
I''m completely new to Ruby on Rails. I''ve been reading "Simply Rails
2", and following their examples. I reached a point where the unit
tests were unexpectedly failing. Upon investigation, I discovered that
when Rails loads the fixtures, the foreign keys aren''t being populated
with the foreign
2012 Mar 09
4
php-pear problem on yum update
Hello list
I have centos-release-5-7.el5.centos and today I noticed that there are
some updates with yum.
I try to update but something hapend with php-pear:
file /usr/share/pear/.channels/__uri.reg from install of
php-pear-1.4.9-8.el5.noarch conflicts with file from
pa ckage
php-pear-ole-0.5-2.el5.rf.noarch
file
2009 Jul 21
2
Machinist - having problems stubbing an after_create filter
Hi all
I''m moving to using Machinist in my rspec tests and am having a problem
with an after_create callback method that i need to stub out. It seems
like calling ClassName.make will trigger this callback before i''ve had
the chance to stub it.
Can i stub it in my blueprint for that class? Or, can i stub the method
for all instances of the class before i call ClassName.make?
2010 Jan 29
4
requiring records in the DB before testing
Is there any way I can require a small set of data be in the test
database before any tests are run? (unit, functional, integration,
cucumber, etc)
Any way besides using fixtures, that is.
Overload a rake task?
Modify test_helper?
Any ideas?
(Simple Case: I have to have a minimal set of user roles defined
before any users can be created)
--
You received this message because you are subscribed to
2006 Jul 07
5
link_to: link is missing id
I''m using a legacy table, where the unique id is not ''id''
I have a Model class like the following:
class Article < ActiveRecord::Base
set_primary_key "ARTICLE_ID"
end
however, using a link_to like the following (modified scaffolding),
the link has no id value:
<% for article in @articles %>
<tr>
<% for column in
2013 Apr 12
1
What is the meaning of the method to_param?
Hey!
Foe example i have next code:
test "should update user" do
put :update, id: @user.to_param, user: @input_attributes
assert_redirected_to users_path
end
What return id: @user.to_param?
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group
2010 Dec 12
5
Fixtures and unit tests - no such file to load
Hello all,
I''m having some issues with my test fixtures and unit tests and am
hoping somebody has an idea about how to fix it.
Background:
I have a table in my legacy database called tp_approval_step.
For this table I have a fixture called tp_approval_step.yml
I have a model called ApprovalProcessStep that uses set_table_name
''tp_approval_step''
In my test file,
2007 Jan 24
2
A spec where interaction-based testing breaks down... (at least for now)
Here are the specs:
context "Finding all the stylesheets available to a company" do
setup do
@mock_company = mock("company")
@mock_company.stub!(:to_param).and_return "1"
Stylesheet.stub!(:find)
end
def do_find
Stylesheet.find_available_to @mock_company
end
specify "should convert the company into a parameter" do
2010 Jun 03
2
creating fixtures for has_many :through
I''m stymied at how to create a fixture that establishes a has_many
:through relationship.
I''ve watched the railscast at:
http://media.railscasts.com/videos/081_fixtures_in_rails_2.mov
... but that''s for HABTM relationships. I''ve read:
http://www.ruby-forum.com/topic/145676
but that ultimately doesn''t answer any question. So with no further
ado:
2007 Jan 30
5
errors while testing resource controller using rpec
I am testing a resource called venue in this piece of code (generated
using script/rspec_resource)
====================
context "Requesting /venues using POST" do
controller_name :venues
setup do
@mock_venue = mock(''Venue'')
@mock_venue.stub!(:save).and_return(true)
@mock_venue.stub!(:to_param).and_return(1)
Venue.stub!(:new).and_return(@mock_venue)
2010 Feb 01
3
validating both sides of a has_one relationship breaks pickle/machinist tests
A lot has been posted about validation issues with associations,
however, I don''t see this issue addressed specifically.
ex:
class Foo
has_one :schedule, :dependent => :destroy
validates_presence_of :schedule
class Schedule
belongs_to :foo
validates_presence_of :foo_id
this creates a circular dependency that breaks test frameworks like
pickle and machinist.
At first I was
2007 Sep 18
2
rSpec / Nested Routes / Mocks
I''m having a terrible time trying to test a nested route with rSpec.
I can''t seem to tell rSpec to expect the call @item.user. The
following error message plagues me not matter how I try to fuss with
the mock:
Spec::Mocks::MockExpectationError in ''ItemsController handling POST /
items should redirect to the new course on successful save''
Mock
2010 Jan 04
2
to_parm and how it can be used in a helper
is there a way to pass the data returned by the to_parm function in a
helper?
i followed the info provided at
http://www.jroller.com/obie/entry/seo_optimization_of_urls_in and am
able to successfully get the correct urls, now i want to be able to get
the same (id-whatever) text and pass it to a helper function for further
processing.
Any ideas as to how this can be achieved?
--
Posted via
2007 May 30
4
aaf and dynamic attrs: a bug?
Hi!
I faced some issue while using it for dynamic attrs indexing/search.
Maybe I made something wrong. Here is test method. Everything works just
fine until last line http://pastie.caboo.se/66274 . Tested on both
stable and trunk of aaf and ferret 0.11.4.
the short version of code below:
Contact.acts_as_ferret :fields => [ :first_name ]
assert
2007 Sep 28
2
form action url example
Hi,
I have the following example:
it ''should have a form with an action attribute'' do
response.should have_tag( "form[action=?]",
''/users/1/machines/1/trouble_tickets'')
end
for a form like so:
<% form_for( :trouble_ticket,
:url => { :action => ''create'',
:user_id => @machine.current_owner,
2007 Feb 09
2
Re: customizing map.resources for REST
Yeah... I''m totally struggling to grok resource routes too... seems like
they''ve totally blown the beautiful simplicity of the old url pattern
stuff out of the water.
Would love to hear an answer to this question!!!
b
Andy Triboletti wrote:
> I want to customize map.resources so it uses a uid in the URL instead
> of the database id. The uid is a field on my object.