Ich laufe Test, Anzeige Fehler.rspec ActiveRecord :: RecordNotFound: Konnte nicht finden Angebot mit 'ID' =
Failures:
1) ContractsController POST #create mit gültigen Attribute Umleitungen an Zahlungsseite Ausfall/Fehler: @proposal = Proposal.find (params [: proposal_id])
ActiveRecord::RecordNotFound:
Couldn't find Proposal with 'id'=
require ' rails_helper‘
describe ContractsController do
login_client
describe 'POST #create' do
let(:proposal) { create(:proposal) }
let(:contract) { create(:contract) }
context 'with valid attributes' do
it 'redirects to payment page' do
post :create, contract: attributes_for(:contract)
expect(response).to redirect_to payment_new_path
end
end
end
end
Fabrik Mädchen:
FactoryGirl.define do
factory :contract do
sequence(:title) { |n| "translation#{n}" }
amount 150
additional_information 'X' * 500
due_date { 21.days.from_now }
proposal
client
contractor
end
end
FactoryGirl.define do
factory :proposal do
description text
amount 150
project
user
end
end
Neben der Erstellung der Ressource, was passiert sonst in Ihrer Aktion erstellen? – oreoluwa