M
M
Max2016-04-30 14:23:48
Ruby on Rails
Max, 2016-04-30 14:23:48

Why is the test (rspec) not running?

Hello, please tell me why the test is not running.
There is a cinema.rb model
In the spec / models folder, I created a file cinema_spec.rb there is such a code

require "spec_helper"
RSpec.describe Cinema :type => :model do
  it "should do something" do
    (1+1).should == 2
  end
end

I run the rspec spec command in the console and an error is displayed - undefined method `Cinema' for main:Object (NoMethodError).
The test is validation, but I can not understand why it does not start. I do according to the lesson

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Karim Kyatlottyavi, 2016-04-30
@maxprof

Try loading rails_helper instead of spec_helper.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question