Following the tutorial, I created a file omniauth.rb at the path
spec/support/helpers/omniauth.rb
module Omniauth
module Mock
def auth_mock
OmniAuth.config.mock_auth[:twitter] = {
'provider' => 'twitter',
'uid' => '123545',
'user_info' => {
'name' => 'mockuser'
},
'credentials' => {
'token' => 'mock_token',
'secret' => 'mock_secret'
}
}
end
end
end
But when I run rspec, I get an error with "uninitialized constant Omniauth"
rails-omniauth/spec/support/helpers.rb:2:in `block in <top (required)>': uninitialized constant Omniauth (NameError)
It seems clear that either omniauth.rb or helpers.rb should be in a different location, but I don't know where.
Update:
I subsequently tried installing the rails-omniauth via the Rails Composer app. When I run "rspec" for this app, I get exactly the same error.