Merge branch 'api' of https://github.com/ZeusWPI/Tab into api
This commit is contained in:
commit
18ccda6e6e
2 changed files with 18 additions and 0 deletions
|
@ -1,5 +1,21 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe TransactionsController, type: :controller do
|
||||
describe "creating transaction" do
|
||||
before :each do
|
||||
@debtor = create(:user)
|
||||
@creditor = create(:user)
|
||||
sign_in @debtor
|
||||
end
|
||||
|
||||
it "should create a valid transaction" do
|
||||
expect do
|
||||
put :create, { transaction: {
|
||||
creditor: @creditor.name,
|
||||
amount: 20,
|
||||
message: "hoi"
|
||||
}}
|
||||
end.to change {Transaction.count}.by(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -17,8 +17,10 @@
|
|||
#
|
||||
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
||||
require 'factory_girl'
|
||||
require 'devise'
|
||||
RSpec.configure do |config|
|
||||
config.include FactoryGirl::Syntax::Methods
|
||||
config.include Devise::TestHelpers, type: :controller
|
||||
# rspec-expectations config goes here. You can use an alternate
|
||||
# assertion/expectation library such as wrong or the stdlib/minitest
|
||||
# assertions if you prefer.
|
||||
|
|
Loading…
Reference in a new issue