Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Works great, but breaks RSpec controller tests: "undefined local variable or method `autocomplete_position_name_positions_path'" #170

Open
ghost opened this issue Aug 6, 2012 · 0 comments

Comments

@ghost
Copy link

ghost commented Aug 6, 2012

Everything works fine when testing it manually in the browser, but it seems to break my RSpec controller tests:

require 'spec_helper'

describe "positions/new" do
  before(:each) do
    assign(:position, stub_model(Position,
      :project_id => 1,
      :task_id => 1,
      :name => "MyString"
    ).as_new_record)
  end

  it "renders new position form" do
    render

    # Run the generator again with the --webrat flag if you want to use webrat matchers
    assert_select "form", :action => positions_path, :method => "post" do
      assert_select "input#position_project_id", :name => "position[project_id]"
      assert_select "input#position_name", :name => "position[name]"
    end
  end
end

This results in

  2) positions/new renders new position form
     Failure/Error: render
     ActionView::Template::Error:
       undefined local variable or method `autocomplete_position_name_positions_path' for #<#<Class:0x007fa6ce48e1e0>:0x007fa6cfab6710>

Any idea how to solve this? Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants