undefined method `get' for #

前端 未结 12 846
野性不改
野性不改 2020-11-30 00:57

Anyone know how to get around this? On OSX, trying to get RSpec running with Rails 3.0.7. Full details at: https://gist.github.com/1017044

  it \"renders but         


        
12条回答
  •  执笔经年
    2020-11-30 01:46

    this can happen under the following conditions:

    1. your spec does not have :type => :controller [type: :controller in newer Ruby]

    2. your spec is not in the controllers folder or you not have set config.infer_spec_type_from_file_location!

    Either #1 or #2 must be setup for your spec. Also, this can happen under this condition as well:

    1. you have written a spec using the old-style require 'spec_helper' instead of using the newer require 'rails_helper'. You will note that rails_helper now includes spec_helper (to generate both see the Rspec installation steps)

    cross referencing GH issue https://github.com/rails/rails-controller-testing/issues/36

提交回复
热议问题