Fix failing testst

This commit is contained in:
benji 2015-09-11 16:11:56 +02:00
parent b67e0954e3
commit 4982d9503d

View file

@ -17,28 +17,33 @@ RSpec.describe TransactionsController, type: :controller do
cents: 70, cents: 70,
message: 'hoi' message: 'hoi'
}} }}
post :create, @attributes
@transaction = Transaction.last
end end
it "should create a new transaction" do it "should create a new transaction" do
expect {post :create, @attributes}.to change {Transaction.count}.by(1) expect {post :create, @attributes}.to change {Transaction.count}.by(1)
end end
it "should set debtor" do describe "fields" do
expect(@transaction.debtor).to eq(@debtor) before :each do
end post :create, @attributes
@transaction = Transaction.last
end
it "should set amount" do it "should set debtor" do
expect(@transaction.amount).to eq(70) expect(@transaction.debtor).to eq(@debtor)
end end
it "should set creditor" do it "should set amount" do
expect(@transaction.creditor).to eq(@creditor) expect(@transaction.amount).to eq(70)
end end
it "should set issuer" do it "should set creditor" do
expect(@transaction.issuer).to eq(@debtor) expect(@transaction.creditor).to eq(@creditor)
end
it "should set issuer" do
expect(@transaction.issuer).to eq(@debtor)
end
end end
end end