Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert specs to tests #1204

Merged
merged 2 commits into from
May 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions spec/factories/bank_statement.rb

This file was deleted.

81 changes: 0 additions & 81 deletions spec/models/bank_statement_spec.rb

This file was deleted.

3 changes: 3 additions & 0 deletions test/fixtures/bank_statements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
one:
bank_code: '1234'
iban: GB33BUKB20201555555555
25 changes: 25 additions & 0 deletions test/models/bank_statement_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
require 'test_helper'

class BankStatementTest < ActiveSupport::TestCase
def test_valid_bank_statement_fixture_is_valid
assert valid_bank_statement.valid?, proc { valid_bank_statement.errors.full_messages }
end

def test_invalid_without_bank_code
bank_statement = valid_bank_statement
bank_statement.bank_code = ''
assert bank_statement.invalid?
end

def test_invalid_without_iban
bank_statement = valid_bank_statement
bank_statement.iban = ''
assert bank_statement.invalid?
end

private

def valid_bank_statement
bank_statements(:one)
end
end