Rspec 2.14.2 を使用して、Rails 4.0 アプリのリクエスト仕様を作成しています。これらのテストを実行しようとすると、正しく動作しますが、コマンド ラインで次の非推奨の警告が表示されます。
DEPRECATION WARNING: ActionController::Integration is deprecated and will be removed, use ActionDispatch::Integration instead.
私が言ったように、仕様は完全に機能し、この非推奨警告に対処するものをオンラインで見つけることができないため、私の仕様コードに問題があると推測されます。私のスペックファイルは次のとおりです
require 'spec_helper'
describe "Authenticating" do
it "should create a new authentication" do
expect {
visit "/auth/developer"
}.to change { Authentication.count }.by(1)
end
it "should create a new user" do
expect {
visit "/auth/developer"
}.to change { User.count }.by(1)
end
it "should create a new device" do
expect {
visit "/auth/developer"
}.to change { Device.count }.by(1)
Device.last.registration_id.should_not be_nil
end
describe "with an existing user and authentication" do
before do
@test_user.authentications.create(:provider => "developer", :uid => "my@email.com")
end
it "shouldn't create a new authentication" do
expect {
visit "/auth/developer"
}.not_to change { Authentication.count }.by(1)
end
it "shouldn't create a new user" do
expect {
visit "/auth/developer"
}.not_to change { Authentication.count }.by(1)
end
it "should create a new device" do
expect {
visit "/auth/developer"
}.to change { Device.count }.by(1)
@test_user.devices.last.registration_id.should_not be_nil
end
end
end
もちろん、非推奨の警告はテストの実際の機能には影響しませんが、 を実行するたびに警告が表示されるのは非常に煩わしいのでrspec spec
、本当に削除したいと思っています。
ありがとう!