Displaying 20 results from an estimated 2000 matches similar to: "Navigation between DB Items with active Record"
2006 May 19
1
Need help with a test
Hi,
I have this controller method that I need to test:
def link_concept_to_client
concept_to_link = Concept.find(params[:concept_id])
# take all the variations for the concept
for variation in concept_to_link.variations
new_client_variation = ClientVariation.new
new_client_variation.client = session[:active_client]
new_client_variation.variation = variation
2006 May 17
0
teardown not cleaning the BD?
Hi,
I am a bit confused, I have a few functionnal tests were I add/delete
records on top of the ones provided in the fixture and it seems like the
records are surviving the teardown. Isnt teardown supposed to be ran
after each test? So if I have something like:
def teardown
Client.delete_all
Concept.delete_all
Variation.delete_all
ClientVariation.delete_all
end
All the
2006 May 06
6
assert_raises --> how does it work?
Hi,
I have this code fragment:
def test_delete_concept
assert_not_nil Concept.find(concepts(:entreprise).id)
get :delete_concept, {:concept_id => concepts(:entreprise).id}
assert_raises :RecordNotFound,
Concept.find(concepts(:entreprise).id)
end
basicaly, on the first line, I make sure that the concept exist in the
DB. On the second line I delete the concept fron the DB.
2013 Jul 04
1
simple-navigation items from database
Hello, i would like to ask how can i generate menu items from database
using simple-navigation ? i was looking in documentation
https://github.com/andi/simple-navigation/wiki/Dynamic-Navigation-Items
but i dont get it.
i have default config/navigation.rb
SimpleNavigation::Configuration.run do |navigation|
...
end
and i have database
categories
id
category_id
name
how can i generate a
2006 May 29
8
Rails and user authentification
I am a the point now where I have to add user authentification to my
application.
Anyone can point me toward an easy to use / secure library? I know about
ActiveRBAC and was wondering if there is anything else that I should
consider.
Thanks!
--
Posted via http://www.ruby-forum.com/.
2004 Apr 28
9
chan_sip.c max number of retries?
Still getting the same error.
Apr 29 11:57:49 WARNING[1125329600]: chan_sip.c:503 retrans_pkt: Maximum retries exceeded on call 6b8b4567327b23c6643c986966334873@211.28.255.135 for seqno 102 (Critical Request)
please advise anyone!!!!!someone!!!
jai
2006 Jun 01
4
how to: update a select from another select
Hi all,
I woke up at 4AM this morning to find a solution for this and it is
still not working.. grrr! lost sleep for nothing!
Anyways, I have 2 select list and I want the content of the second list
to be updated according to what is selected in the first list.
I did this in the past by having my application generate all the
possible content of the second list and make some Javascript to do
2006 Jul 19
5
weird result for a custom attr reader!
Hi all,
I am having a weird problem reading a value from my model. basicaly, I
have these two models:
class Category < ActiveRecord::Base
acts_as_tree :order => "name"
belongs_to :item_type
has_many :specific_category_names
end
and
class SpecificCategoryName < ActiveRecord::Base
set_table_name "Specific_category_names"
has_many :products
belongs_to
2006 Jun 27
2
testing - how to get access to an instance variable
inside controller
def foo
@city = City.find(@params[:id])
@city.bar = 1234
end
While writing functional tests how do I ensure that the @city.bar is 1234?
def test_edit
get :edit, :id => 1
assert_not_nil assigns(:city)
#?? how to assert that city.bar is 1234
end
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2014 Jan 13
3
[PATCH 1/3] ruby: Fix tests for out-of-tree build, simplify test scripts
---
configure.ac | 1 +
ruby/run-ruby-tests | 27 ---------------------------
ruby/run-ruby-tests.in | 27 +++++++++++++++++++++++++++
ruby/tests/tc_010_load.rb | 2 --
ruby/tests/tc_021_close.rb | 2 --
ruby/tests/tc_120_rlenvalue.rb | 4 +---
ruby/tests/tc_200_write.rb | 2 --
ruby/tests/tc_210_setvalue.rb | 2 --
run.in
2006 Nov 15
1
PAM authentication to Active Directory
Hello list,
I want to authenticate (only authenticate) through active directory with PAM. I googled around and everything I found, wheter it is forum posts or howtos, it always talks about winbind and joining the linux machine to the windows domain. I do not which to do this, I only want to get PAM to authenticate with the AD and then everything else is local.
Should I use pam_winbind ?
2006 Jul 17
5
Functional Tests misbehaving with Globalize
Howdy all
Apologies to the folks subscribed to the globalize list for dual
posting this message...
I''ve got a project running globalize and rails 1.1.4, and I''ve only
recently adopted a strong love for testing. Now my models are 100%
tested (I must note that I do not make use of any translations in the
database yet), and I''ve now started with functional tests before
2006 May 22
6
how HTML_Option works?
Hi all,
all the form helpers can take a serie for options but I cant find any
documentation about them. Any one can point me toward one?
Or at least tell me how I can for example add a function that would be
call with the onblur event from a input box?
Thanks!
--
Posted via http://www.ruby-forum.com/.
2006 Jan 03
3
Rails Noob Question
Apparently the first time I posted this, it was tacked onto the end of
another thread. Please pardon my repost. Won''t happen again.
--------
Howdy. I''m just getting into Rails, and really enjoying it! I''m coming
from the .NET world, so I''ll embarrassedly admit that I''m running it on
winXP and even using SQLServer (for now, may switch to mysql
2008 Feb 08
2
update_Attributes stale Object error
Hi,
IN one of my unit tests I get an ActiveRecord::StaleObjectError:
Attempted to update a stale object
object.save!
in object I have apart from other stuff an after_save method, which
calls
object.assosication.update_attributes(...)
If I remove that line from my code my tests succeeds.
Unfortunetly, I do not understand why an update_attributes call can
generate an StaleObjectError.
Maybe
2009 Jul 08
1
[PATCH: host-browser replacement 0/3] replacement of host-browser on ovirt-server
The purpose of this patch is to replace the identify function in
host-browser.rb with a new script, host-register.rb.
host-register.rb is a qmf ruby console that interfaces with the newly
added matahari qmf agent on the ovirt node. While it stores node data
in the database with the same behavior as the original host-browser
implementation, it acquires the data using the amqp protocol (and
2007 Jan 04
10
Intermittent "can''t convert Float into Hash" and results.rb
Hi,
I''m using backgroundrb 0.2.1 in a production environment and for most
parts I''m very happy. We are using it to do some heavy video editing on
the server side and it works great except that under, what seems heavy
load the below problem happens intermittently.
The problem has only happened 5 times out of over 500 runs by our
backgroundrb worker.
This is the code in our
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
2006 Jan 05
4
testing file uploads
Hi all,
I was wondering about the class used when rails receives file uploads.
Sometimes it appears to be a File, and other times it is a StringIO.
Also it has methods such as original_filename that don''t appear to
belong to either of these classes. I ask because I''m trying to work out
how to test my fil upload related models and controllers.
Is there some standardised way of
2006 Oct 19
1
Question about variable assignments/scoping after render call
I''ve got a question about how variables are made available to templates. We
have a test that looks something like this:
def test_variable_assigned
xhr :get, :do_stuff, :id => 1
assert_not_nil assigns(:thing)
end
And our app code looks like this:
class SuperClass < ActionController
def do_stuff
@parent_model = ParentModel.find(params[:id])
render :template