aboutsummaryrefslogtreecommitdiffstats
path: root/test
AgeCommit message (Collapse)Author
2015-12-08Add logged_in.erb templateTeddy Wing
Template that displays when the user is logged in. Adjust the login test to check for the text in this template.
2015-12-08auth_test.rb: Add logout testTeddy Wing
2015-12-08auth_test.rb: Create login helpersTeddy Wing
Create a couple new methods to extract login functionality and remove duplicate test code.
2015-12-08Add test for unrecognised userTeddy Wing
When logging in with unrecognised credentials, the response should include "Unrecognized user".
2015-12-08app.rb: Remove Sinatra::Base application wrapperTeddy Wing
Don't wrap our routes/controllers in a `Sinatra::Base` class to keep things simple. Was doing this because I thought I needed to in order to be able to tell Capybara where the application was but looking at the Sinatra testing page (http://www.sinatrarb.com/testing.html), they provide an example for Capybara that details this `Sinatra::Application.new` call that I can make instead. This frees us up to use the simplified application definition.
2015-12-08test_helper: Set `RACK_ENV` = 'test'Teddy Wing
Saw this on the Sinatra testing page (http://www.sinatrarb.com/testing.html). Seems like I should put it in to be a good Rack citizen.
2015-12-08Add test that fills in login formTeddy Wing
* Write a `setup` method to extract the '/' route visit * Change the logic of `test_index_has_login_form` to check for the presence of 'Login' text and a form (super basic) * Create a new test that fills in the login form and clicks the "Login" button. For now just checks that we get a successful response.
2015-12-07Add a simple Capybara testTeddy Wing
* Add Rakefile to run tests with `rake` * Add a `test_helper` to take care of the setup that Capybara requires in order to run * Add a super basic test to see if Capybara works * Put app in a `Sinatra::Base` subclass so that we can tell Capybara where to find it