Displaying 8 results from an estimated 8 matches for "fooscontroller".
Did you mean:
foocontroller
2007 Dec 04
1
spec''ing shared controller methods
...ot;)) unless
@account
end
...
end
## application_controller_spec.rb
require File.dirname(__FILE__) + ''/../spec_helper''
ActionController::Routing::Routes.draw do |map|
map.connect ''foos/:action'', :controller => ''foos''
end
class FoosController < ApplicationController
end
describe FoosController, "account authorization" do
before do
FoosController.class_eval do
define_method(:foo) {
find_account # this is the method being tested
}
end
end
it "should find_account from params&...
2009 Mar 11
3
[rspec, rails] Restful Routes in controller specs
Hi,
how is it possible that I can use the restful routes helpers (e.g.
new_user_path) in controller specs? I browsed the source code but I
couldn''t find the magic. I''m just curious and would appreciate any
hint...
thanks
Andi
2007 Dec 16
3
how do I spec my Rails routes?
Once again, here''s something I haven''t figured out. Apologies if this
is too newb-ish, but, how do I spec my routes using RSpec-Rails?
In particular, I''ve got a catch-all route that needs to catch a wide
variety of URLs:
map.document ''*url'', :controller => ''documents'', :action => ''show''
Is there a way to
2007 Aug 17
0
map.with_options :path_prefix => ''
...;new''
foos.create_foo ''/foos'',
:action => ''create'',
:conditions => {:method => :post}
end
And in the foos_controller_spec.rb file is something like...
describe FoosController, ''on a GET to new'' do
it "should make a baby foo" do
# some stuff
get ''new'', :owner_type => ''client'', :owner_id => ''1''
# shoulda''s woulda''s and coulda''...
2011 Dec 17
7
How to fire Ajax call from Form_for
...w hours and could not figure out how to do this.
So far what I have done is the follows:
Step 1. Add :remote => true to the form_for method. This form_for method
lives in a partial which is called in app/views/foos/home.html.erb
Step 2. Add
respond_to do |format|
format.html
format.js
end
to FoosController''s corresponding Home action.
Step 3.create home.js.erb under app/views/foos/
But I do not know how to add something so when a letter is typed in a
textarea inside the form generated by form_for method that home.js.erb
will process.
Could someone help me out here?
--
Posted via http://...
2010 Sep 16
3
Resyful authenticatio current_user in model
Hi,
I am using Restful authentication for user authentication.
I want the current logged in user object in my model property.rb
Problem is current_user is not working on model.
How can I fix this I need that?
Please help me out.
Thanks,
Mike
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"
2008 Jan 21
9
DRY act_as_authenticated functional testing
I''m using the acts_as_authenticated plug-in for my app. Now I need to
get my functional tests to work properly. I have not written functional
tests before so I''m unsure how to utilize setup so that all of my tests
can use the login. My tests pass if I put login_as :user inside of each
test, but that''s clearly not DRY. Can I add something to my
test_helper.rb file or
2006 May 31
7
How do you create a controller & view to create a list of objects?
I''m trying to figure out how to design a view and controller to work with a
simple collection. I have a Foo that has many Bars, so here''s what I did:
$ ruby script/generate model Foo
$ ruby script/generate model Bar
(Uncomment t.column, :name: :string in foo and bar migrations)
(Edit Foo.rb and Bar.rb, add has_many :bars to Foo, belongs_to :foo to Bar)
$ rake db:migrate
$ ruby