Fix failing testst
This commit is contained in:
parent
b67e0954e3
commit
4982d9503d
1 changed files with 18 additions and 13 deletions
|
@ -17,14 +17,18 @@ 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
|
||||||
|
|
||||||
|
describe "fields" do
|
||||||
|
before :each do
|
||||||
|
post :create, @attributes
|
||||||
|
@transaction = Transaction.last
|
||||||
|
end
|
||||||
|
|
||||||
it "should set debtor" do
|
it "should set debtor" do
|
||||||
expect(@transaction.debtor).to eq(@debtor)
|
expect(@transaction.debtor).to eq(@debtor)
|
||||||
end
|
end
|
||||||
|
@ -41,6 +45,7 @@ RSpec.describe TransactionsController, type: :controller do
|
||||||
expect(@transaction.issuer).to eq(@debtor)
|
expect(@transaction.issuer).to eq(@debtor)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context "with float euros" do
|
context "with float euros" do
|
||||||
it "should set correct amount" do
|
it "should set correct amount" do
|
||||||
|
|
Loading…
Reference in a new issue