Zeus fails when testing with Rspec
Asked Answered
H

1

7

When I run this command: rspec spec/controllers/messages_controller_spec.rb

I get this:

Finished in 0.54446 seconds

2 examples, 0 failures

Randomized with seed 6226

It's good.

However when I run this command:

zeus rspec spec/controllers/messages_controller_spec.rb

I get this:

Finished in 0.5356 seconds

2 examples, 0 failures

Randomized with seed 0

This is not a problem, but then immediately I get also this:

F.

Failures:

1) MessagesController POST #create create a message with an HTTP 200 status code

 Failure/Error: post :create, message: "test message"
 NameError:
   undefined method `post' for #<RSpec::Core::ExampleGroup::Nested_2::Nested_1:0xb0085d8>
 # ./spec/controllers/messages_controller_spec.rb:10:in `block (3 levels) in <top (required)>'
 # -e:1:in `<main>'

Finished in 0.10724 seconds 2 examples, 1 failure Failed examples:

rspec ./spec/controllers/messages_controller_spec.rb:9 # MessagesController POST #create create a message with an HTTP 200 status code

Hutton answered 21/5, 2013 at 8:26 Comment(2)
Could you post both the controller code and the spec?Hertz
it does not happen in only this test, it does in every test.Hutton
S
8

Delete a line:

require 'rspec/autorun'

from your spec_helper.rb.

Swum answered 22/5, 2013 at 14:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.