Displaying 6 results from an estimated 6 matches for "somehelper".
2007 Mar 09
6
AssertSelect for strings?
Hi,
Is there a way to use the have_tag matcher on a string instead of the
response body from a view? I have a helper in a method rails project
that returns an html fragment which I would like to test.
Like this:
module SomeHelper
def some_helper_method
"<p>foo</p>"
end
end
context "The SomeHelper"
helper_name :some
specify do
some_helper_method.should have_tag("p", "foo")
end
end
Til
ps: the new have_tag / with_tag stuff for testing views and rspec...
2006 Sep 29
2
ApplicationHelper is not a parent of SomeHelper?
i have:
# file application_helper.rb
module ApplicationHelper
def load_components
@right_sidebar = ''some stuffs''
end
end
# file user_public/blog_helper.rb
module UserPublic::BlogHelper
def load_components
ApplicationHelper.load_components
@right_sidebar += ''{blog archive}''
end
end
the problem is, i want to load the
2008 May 23
12
Modules will no longer be automatically included in RSpec version 1.1.4
Can anyone (David?) shed some light on what exactly this warning is
complaining about? I started seeing it when I upgraded to Rails 2.1
RC1 and the latest RSpec from git.
I''m getting it in some helper specs that I''m writing. And yes, I am
including a module there, to reuse some utility methods I originally
wrote for my controller tests (I''m switching to specs
2006 Aug 13
2
Writing a Helper function
I''ve finally gotten to the point where I want to write my own helper
function to call from my views. I used the script/generate to create my
Controller so I also got the helper file.
I defined the method I wanted to use in the helper rb file, but when I
try to call them from the view I get a NoMethodError raised.
Is there anything else I have to do besides creating the method in the
2006 May 10
2
accessing uploaded file on filesystem question.
Hi,
I''m able to upload files onto my webserver filesystem but I had a question
regarding how I''d go about accessing them using the <img src="..." > tag.
If my files, i.e pictures, are being uploaded to
public/images/<dir>/filename.jpg, then should I store the entire path, or
just the picture name in my database table? I would imagine storing just
the
2008 Nov 10
3
to_xml and helper methods
Hi,
I have an array with objects and I want to generate an XML like:
<objects>
<object>
<category_id>1</category_id>
<helper-method>result 1</helper-method>
</object>
<object>
<category_id>2</category_id>
<helper-method>result 2</helper-method>
</object>
</objects>
The helper