Я не совсем уверен, почему это не работает. У меня есть тест для omniauth, и есть метод set_omniauth, который вызывается в нижеприведенной спецификации (автоматически). Этот тест завершается неудачей, если вызывается черезкак включить конкретный вспомогательный файл в спецификацию
RSpec спецификации/контроллеры/sessions_controller_spec.rb
, но проходит, когда вся свита работать через как rspec spec
. Как включить файл spec/helpers/omniauth_helpers.rb
? Я пробовал:
require 'omniauth_helpers'
require 'spec/helpers/omniauth_helpers'
require 'omniauth_helpers.rb'
require 'spec/helpers/omniauth_helpers.rb'
но они не работают.
Вот моя спецификация:
require 'spec_helper'
describe SessionsController, "OmniAuth", task049: true do
before do
request.env["omniauth.auth"] = OmniAuth.config.mock_auth[:facebook] # is set in
end
it "task049: sets a session variable to the OmniAuth auth hash - see the set_omniauth() in spec/helpers/omniauth_helpers" do
request.env["omniauth.auth"]['uid'].should == '1234fb'
end
end
Это приложение Rails? Какую ошибку вы получаете? –