2014-07-21 12 views
5

Sto scrivendo alcuni test per il mio controller Rails, e sto usando RSpec 3.0.2RSpec: metodo non definito `infer_spec_type_from_file_location! ' per # <RSpec :: :: Nucleo Configurazione: 0x00000103bc6020> (NoMethodError)

Dopo aver ottenuto questo errore, quando provo a simulare un POST chiamata a un percorso:

NoMethodError: 
    undefined method `post' for # <RSpec::ExampleGroups::WebApplicationsController::ProcessPayment:0x00000106214ce0> 

ho poi letto t his SO thread e ho aggiunto la seguente linea al mio spec_helper.rb

RSpec.configuration.infer_spec_type_from_file_location! 

che mi dà il seguente errore quando ho eseguito rspec spec:

code/fsa/spec/spec_helper.rb:4:in `<top (required)>': undefined method `infer_spec_type_from_file_location!' for #<RSpec::Core::Configuration:0x0000010420e040> (NoMethodError) 

io non sono davvero sicuro di quello che sta succedendo.

+1

fa questo lavoro se si etichetta l'esempio con 'Tipo: controller'? – zetetic

risposta

3

questo accadeva a causa del fatto che stavo usando gem 'rspec' invece di gem rspec-rails

Problemi correlati