Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8212765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:52:41+00:00 2026-06-07T10:52:41+00:00

I wrote *simple_form* input extension that is located in app/inputs/something_input.rb I’m trying to write

  • 0

I wrote *simple_form* input extension that is located in app/inputs/something_input.rb

I’m trying to write RSpec for this. When I put this spec inside spec/helpers/application_helper_spec.rb everything was working without single problem.

# spec/helpers/application_helper_spec.rb
require 'spec_helper'
describe ApplicationHelper do
  it do
    helper.simple_form_for @foo,:method=>'get', :url=>helper.users_path do |f|
      f.input :created_at, :as =>:custom_datepicker
    end.should =~ /something/
  end
end

Now I’m trying to move that spec to spec/inputs/something_input_spec.rb so it will be similar name path.

# spec/imputs/something_input_spec.rb
require 'spec_helper'
describe SomethingInput do
  it do
    helper.simple_form_for @foo,:method=>'get', :url=>helper.users_path do |f|
      f.input :created_at, :as =>:custom_datepicker
    end.should =~ /something/
  end
end
#
#ERROR:   undefined local variable or method `helper' for #<RSpec::Core::ExampleGroup

the thing I want to tell RSpec to threat this file as type helper spec, so I will have helper method availible with all the RSpec::Rails::HelperExampleGroup functionality

… how can I do that ??

I was trying to extend/include it with RSpec::Rails::HelperExampleGroup nothing seems to work

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T10:52:43+00:00Added an answer on June 7, 2026 at 10:52 am

    Start the describe block with the :helper type:

    describe SomethingInput, :type => :helper do
      ... tests ...
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Would it be possible to write a wrapper or style simple_form so that form
I am trying to write a simple input field validation plugin at the moment
How would I write this simple_form in haml: <%= simple_form_for (@quiz) do |f| %>
I'm trying to write a simple script that emulates placeholders so that I can
I am writing a Firefox extension that needs to write and submit a form
I'm trying to write a simple script that effectively fades out the page content,
I wrote this very simple function for my current project called insidelabel() that let's
I am trying to write a simple CLR-Windows Form Application. It will show a
I wrote simple class that on the start it just increase the value of
I wrote a simple function, that makes emacs add matching quotes (so when I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.