我正在尝试在these instructions之后为devise + omniauth-linkedin开发集成测试,但响应为零。该应用程序正在开发环境,但测试没有通过。
测试用例:
feature 'signup with linkedin' do
before do
OmniAuth.config.test_mode = true
OmniAuth.config.mock_auth[:linkedin] = OmniAuth::AuthHash.new({
:provider => 'linkedin',
:uid => '12345'
})
end
scenario 'valid' do
visit "/users/auth/linkedin"
json = ActiveSupport::JSON.decode(response.body)
json["uid"].should == '12345'
json["provider"].should == 'linkedin'
end
end
错误讯息:
Failure/Error: json = ActiveSupport::JSON.decode(response.body)
NoMethodError:
undefined method `body' for nil:NilClass
有人可以帮忙吗?
如果您想查看代码,该项目是开源的,您可以在此处找到它:StartupDealbook