#414 √ invalid
Alexandre da Silva

[INVALID]

Reported by Alexandre da Silva | May 27th, 2008 @ 06:49 PM | in No-Milestone-Assigned

using a named scope, rspec could not find the helper methods over a named_scope,

for example:

in the Person Model:

named_scope :companies, :conditions => { :company => true }

in some place (ApplicationHelper)

def company_select_tag(tag_name, selected_id)

select_tag tag_name, options_from_collection_for_select(

Person.companies.all(:order => 'name'),

:id,

:name,

selected_id

)

end

the test:

[...]

helper.company_select_tag('mc').should == "

[...]

the test fails:

loading autotest/rails_rspec [....]

.......F.................

1)

NoMethodError in 'ApplicationHelper should provide a company selector'

undefined method `all' for #

/home/alexandre/project/app/helpers/application_helper.rb:9:in `company_select_tag'

./spec/helpers/application_helper_spec.rb:11:

script/spec:4:

Finished in 0.349292 seconds

25 examples, 1 failure

================================================================================

Rails 2.1RC1

rspec and rspec-rails got from git trunk

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Behaviour Driven Development for Ruby.

Shared Ticket Bins

People watching this ticket

Tags