> In the spec, the method being spec'd should be invoked through the helper:
>
> it "does something" do
> helper.method_being_specified
> end
>
> I did not mean to reference a helper object inside the implementation.
>
> Make sense?
Ah, now I got it ... you meant the template helper method
On Mar 21, 2011, at 12:52 PM, Kai Schlamp wrote:
>>> Failure/Error: order_link(:name)
>>> NoMethodError:
>>> undefined method `fetch_param' for #<#:
>>> 0xb63be118>
>>
>> That's not the same error message you posted earlier:
>>
>> NoMethodError:
>> undefined method `sort_directio
> > undefined local variable or method `helper' for #<#:
> > 0xb665532c>
>
> What's the full backtrace?
1) ApplicationHelper order link should create html link
Failure/Error: order_link(:name)
NoMethodError:
undefined method `fetch_param' for #<#:
0xb64a1ef4>
# ./app/helper
> > Failure/Error: order_link(:name)
> > NoMethodError:
> > undefined method `fetch_param' for #<#:
> > 0xb63be118>
>
> That's not the same error message you posted earlier:
>
> NoMethodError:
> undefined method `sort_direction' for
> #" error shows up when using
helper.check_param
This thread has been dead for awhile, but I'm having the same issue. I
don't have a bash variable set. I'm also having this issue with
Cucumber. It always runs in development mode.
If I put "p Rails.env" in spec_helper.rb:8 (after spec_helper already
declares ENV["RAILS_ENV"] ||= "test") and
On Mar 21, 2011, at 11:15 AM, Kai Schlamp wrote:
>>> module ApplicationHelper
>>> def order_link(column, title = nil)
>>>fetch_param(:order)
>>
>> Change this ^^ to this:
>>
>> helper.fetch_param(:order)
> Ok, the tests now runs fine, but unfortunately the site itself doesn't
> work anym
> From this error message, it looks like you can just def it inside your
> describe block.
Thanks Matt, that seems to work.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Ok, the tests now runs fine, but unfortunately the site itself doesn't
work anymore.
When the view gets rendered I get the following error:
undefined local variable or method `helper' for #<#:
0xb665532c>
> > module ApplicationHelper
> > def order_link(column, title = nil)
> > fetch_param(:or
On Mar 21, 2011, at 11:19 AM, Kai Schlamp wrote:
>> Change this ^^ to this:
>>
>> helper.fetch_param(:order)
>
> I was wrong the test fails also with the same error message:
>
> Failure/Error: order_link(:name)
> NoMethodError:
> undefined method `fetch_param' for #<#:
> 0xb63be118>
> Change this ^^ to this:
>
> helper.fetch_param(:order)
I was wrong the test fails also with the same error message:
Failure/Error: order_link(:name)
NoMethodError:
undefined method `fetch_param' for #<#:
0xb63be118>
___
rspec-users maili
On Mar 21, 2011, at 8:40 AM, Kai Schlamp wrote:
>> This error ^^ suggests that sort_direction is being called on the example
>> itself rather than the helper object. Please post the spec so we can see
>> what's going on.
>
> Sure ...
>
> describe ApplicationHelper do
> describe "order link"
> This error ^^ suggests that sort_direction is being called on the example
> itself rather than the helper object. Please post the spec so we can see
> what's going on.
Sure ...
describe ApplicationHelper do
describe "order link" do
it "should create html link" do
# things I tried
On 21 Mar 2011, at 10:41, Kai Schlamp wrote:
> My ApplicationController exposes a method (e.g. sort_direction) to the
> view templates by using
> helper_method :sort_direction.
> I then use this method in another method (e.g. sort_link) in a view
> helper (application_helper.rb).
>
> When testin
On Mar 21, 2011, at 5:41 AM, Kai Schlamp wrote:
> My ApplicationController exposes a method (e.g. sort_direction) to the
> view templates by using
> helper_method :sort_direction.
> I then use this method in another method (e.g. sort_link) in a view
> helper (application_helper.rb).
>
> When test
On 16 March 2011 12:15, Sid Wood wrote:
> Does anyone know of any open source projects that are using RSpec and
> DataMapper together that I can dissect?
A project I work on, One Click Orgs, was using Merb + DataMapper with
RSpec and Machinist. We've since migrated to Rails with ActiveRecord,
but
My ApplicationController exposes a method (e.g. sort_direction) to the
view templates by using
helper_method :sort_direction.
I then use this method in another method (e.g. sort_link) in a view
helper (application_helper.rb).
When testing the sort_link method with RSpec (in
application_helper_spec
16 matches
Mail list logo