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

atm_challenge_2020 by Sara & Sebastian #25

Open
wants to merge 35 commits into
base: master
Choose a base branch
from

Conversation

SaraFrantzen
Copy link

No description provided.

SaraFrantzen and others added 30 commits August 26, 2020 09:17
…. Installing bundler. Adding source and gem to Gemfile. Created .gitignore file to include .DS_store
…us work see repo 'https://github.com/Saralundkvist86/atm.git'. Greates atm_spec.rb and also adding all code from previous work. See same repo
…tm.rb. Creating a method for account_disabled and adding another argument account_status. Creating a when sending a message to the user 'account status is disabled'.
…searchpath for account.account_status in when account_disabled?. Running Rspec, all 7 tests passes
… 'allow withdraw if the account has enough balance.
…nt_status, :exp_date and :account_owner in new file lib/ account.rb. Creates a test in new file spec/account_spec.rb 'check that pincode has 4 digits', test passes
…Date.today, using method as argument for @exp_date. Test 'Account is expected to have an expiry date on initialize' now passes
…dding in new method self.deactivate(account). Test passes
…ute of name. creates test 'is expected to have an owner'. In account.rb :account_owner is initialized. Test passes. @account_owner = set_owner(attr[:owner]), set_owner(obj) are defined with a Ternary Operator obj == nil ? missing_owner : @owner = obj, meaning that missing_owner should be executed when obj=nil. Method is defined to missing_owner to raise errormessage if no owner is set. 'is expected to throw error if no owner is set' test is created in account_spec.rb but FAILS
…owner is set', test didnt pass as the errormessage didnt match the errormessage defined in raise for function missing_owner in account.rb. all tests passes for account_spec.rb
…e, :cash, :account. defining method set_name with turnery operator which will go to missing_name when name is set to nil, otherwise new name will belong to person. Creating ./spec/person_spec.rb with test 'is expected to have a :name on initialize'. Test passes
…. Creating test 'is expected to raise an error if no name is set'. Test passes.
…e. Creating a test 'is expected to have a :cash attribute with the value of 0 on initialize'. Test passes
…eating a test 'is expected to have a :account attribute'. Test passes.
…ss to belong to the Account class. Creating test 'Person of account class. test pass
…on with himself as an owner to confirm that new accounts will belong to the person creating it. Test passes
…== nil the function missing_account schould be executed, otherwise deposit_funds method will go on to make it possible to make a deposit as a user. Missing_account method is created to raise error messege telling user that no account is present. Deposit_funds(amount) method is created with attributes of @cash and @account.balance to eq the origin amount + deposit. 2test are created to execute these functions. 1. 'Person can deposit funds if account has been created' and 2. 'person can\'t deposit funds when no account has been created' Both test passes
…om cash'. Test passes as all instances are already described
…ng block { subject.withdraw(amount: 100, pin: subject.account.pincode, account: subject.account, atm: atm) } expecting lambda to be truthy when calling. Creating function 'withdraw_funds' and 'increase_cash' contain expected lambda output as in the test. Test passes.
…ayby just by sliding the creditcard randomly in the air .. an errormessage should be thrown that 'An ATM is required'. Creating method missing_atm to be able to show that RuntimeError. Creating test 'Person withdraw is expected to raise an error if no ATM is passed in' Test passes
… balance' to ensure everything works correctly. Test passes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants