{"action":"opened","issue":{"url":"https://api.github.com/repos/ice-king/oystercard/issues/10","labels_url":"https://api.github.com/repos/ice-king/oystercard/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/ice-king/oystercard/issues/10/comments","events_url":"https://api.github.com/repos/ice-king/oystercard/issues/10/events","html_url":"https://github.com/ice-king/oystercard/issues/10","id":103346420,"number":10,"title":"Checking mininum balance on touch in","user":{"login":"ice-king","id":13962452,"avatar_url":"https://avatars.githubusercontent.com/u/13962452?v=3","gravatar_id":"","url":"https://api.github.com/users/ice-king","html_url":"https://github.com/ice-king","followers_url":"https://api.github.com/users/ice-king/followers","following_url":"https://api.github.com/users/ice-king/following{/other_user}","gists_url":"https://api.github.com/users/ice-king/gists{/gist_id}","starred_url":"https://api.github.com/users/ice-king/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ice-king/subscriptions","organizations_url":"https://api.github.com/users/ice-king/orgs","repos_url":"https://api.github.com/users/ice-king/repos","events_url":"https://api.github.com/users/ice-king/events{/privacy}","received_events_url":"https://api.github.com/users/ice-king/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-26T19:26:01Z","updated_at":"2015-08-26T19:26:01Z","closed_at":null,"body":"Now your Oyster card can be used to touch in and out. It will also throw an error if there are not enough funds available to pay. However, it will let you touch in even if you haven't got enough funds for a single journey.\n\nIf your card is empty, you wouldn't get past the entry barrier on London transport network. This is because when you try to touch in, it checks the balance and refuses to touch in unless you have enough money for one journey.\n\nLet's implement this check. Assume that the minimum fare is £1 and raise an exception unless the balance is at least £1 on touch in.\n\n## Skills you will learn:\n- S173: Raise errors\n- S175: Check that a statement raises an error with RSpec\n- S172: Use a constant\n- S174: Access a constant from outside the class\n\n## Interview questions you may expect:\n- I178: What are constants and how are they different from variables? Why use them?\n- I176: What are exceptions in Ruby? Why do they have messages associated with them?\n- I177: How can you check an expression raises an error with RSpec? Why do you have to pass the code as a block to do this?\n\n## To complete this challenge:\n- [ ] Write a test that checks that an error is thrown if a card with insufficient balance is touched in\n- [ ] Write the implementation\n- [ ] Update existing tests, if necessary, to make sure they still pass\n\n## Suggested resources:\n- [Handling and Raising exceptions](https://rubymonk.com/learning/books/4-ruby-primer-ascent/chapters/41-exceptions/lessons/92-handling)\n- [raise_error matcher](https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers/raise-error-matcher)\n- [expect vs expect with a block on SO](http://stackoverflow.com/questions/19960831/rspec-expect-vs-expect-with-block-whats-the-difference)\n- [Ruby constants](http://rubylearning.com/satishtalim/ruby_constants.html)\n- [If statements](http://www.dev-hq.net/ruby/5--if-statements)"}}