In my application I have the following files:
app/controllers/api/articles_controller.rb
class Api::ArticlesController < Api::BaseController
end
app/controllers/api/base_controller.rb
class API::BaseController < ApplicationController
# some codes here
end
in my rspec, I have this:
require 'rails_helper'
describe Api::ArticlesController do
it "should do something here"
end
But when I run rspec spec
, I got uninitialized constant Api::BaseController (NameError)
. Why? I have base_controller
under app/controllers/api
. What do I am doing wrong?