Displaying 11 results from an estimated 11 matches for "linojon".
Did you mean:
lincon
2008 Mar 19
2
rescue
Hi, whats the correct way to spec a rescue? This will raise it but
doesnt test my code''s response
# controller
def edit
@foo = Foo.find(params[:id])
rescue
flash[:notice] = "Unknown foo #{params[:id]}"
redirect_to foos_path
end
# spec
it "should flash error if not found" do
Foo.should_receive(:find).and_raise
get :edit, :id
2007 Jul 31
11
helper spec not finding rails core helpers
Hi,
My helper specs were going ok until I added a call to a rails
DateHelper method in one of my helpers
http://api.rubyonrails.com/classes/ActionView/Helpers/
DateHelper.html#M000574
The helper runs fine from my view templates, just dies in the spec test.
I boiled my question down to a simple (not too useful) example. I''m
not sure what I''m missing.
#
2007 Nov 28
3
overriding rest show route but not delete
hi, lets say routes.rb has
map.resources :foo
and I want the show action to have a diffent url, so I add (after the
above line)
map.foo ''/bar/:id'', :controller => ''foo'', :action => ''show''
this works fine, including foo_path( :id => "1") => /bar/1
and <%= link_to ''Show'', foo %>
2007 Jun 11
2
not response
(rails)
I was making a model called Survey and another called Response
hehe, don''t use a model named Response...
it really messes up the mocks and stubs
:)
2007 Jun 12
1
should_change
Hi,
I''m wondering if I''m using should_change correctly.
Here''s what I''m doing
http://pastie.caboo.se/69704
thanks
2007 May 29
0
specs for ActionMailer
...rset" =>
CHARSET }
#@expected.set_content_type "multipart", "alternative",
{ "charset" => CHARSET }
@expected.mime_version = ''1.0''
@expected.from = ''jonathan at linowes.com''
@expected.to = ''linojon at gmail.com''
end
it "should generate correct ''create notify'' message" do
@expected.subject = ''ReviewRamp: itemcreated''
@expected.body = read_fixture(''itemcreated'')
@expected.date = Time.now
#...
2007 Oct 10
1
form builder
hi,
I''m creating a custom form_builder and
i''m trying to figure out how would helpers like text_field know if
the field has an error message so I can highlight it and show the
message text
thanks
linoj
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To
2008 Nov 05
1
ambiguous nested conditions on find
Hi, i''m trying to figure out how to do a query with an ambiguous
condition
Lets say Comment belongs_to :article and :user,
and Article :belongs_to :user
How can I find the comments by one user on articles by another user
in one query?
This doesnt work, but is kind of the idea:
Comment.find :all, :conditions => {''users.name'' =>
2007 Jun 05
0
Fwd: testing - test/spec and rspec
are you guys aware of this??
:)
Begin forwarded message:
> From: topfunky <topfunkycorporation at gmail.com>
> Date: June 4, 2007 8:35:24 PM EDT
> To: PeepCode <peepcode at googlegroups.com>
> Subject: Re: testing - test/spec and rspec
> Reply-To: peepcode at googlegroups.com
>
>
> On 5/28/07, Neil <neilrahilly at gmail.com> wrote:
>> Just
2007 Oct 09
0
model data templates
hi,
i''m looking for suggestions how to setup and manage relatively small
default data sets to be used as templates.
lets say a user can have a default set of objects involving several
models, and there might be several default sets to pick from
(template objects).
Would you suggest I create the ''templates'' in the db as specially
named records, and copy them to
2007 May 28
2
helper with block compile error
HI,
i''m trying to write a helper that replaces link_to_remote that
accepts a block but it gets a compile error in the template:
I don''t know what I''m doing wrong... TIA
# application_helper.rb
def link_block_to_remote( options = {}, html_options = {}, &block)
concat(link_to_remote(capture(&block), options, html_options),
block.binding)
end
# in