| Age | Commit message (Collapse) | Author |
|
As of 28770a5143bb5b48389d5ad4ce235625c12f1056 we no longer need this
file as the server should now be started with `ruby app.rb` instead of
`rackup`.
|
|
Template that displays when the user is logged in.
Adjust the login test to check for the text in this template.
|
|
Move boilerplate code from `index.erb` into `layout.erb` to allow us to
use it in additional templates.
|
|
|
|
Create a couple new methods to extract login functionality and remove
duplicate test code.
|
|
So that the characters get masked.
|
|
When logging in with unrecognised credentials, the response should
include "Unrecognized user".
|
|
When logging in with the correct credentials, set a session variable and
redirect to the login page. Custom display for a user who is logged in.
Add a logout method to delete the session variable, thus logging out the
user.
Use Rack's built-in session cookies to facilitate session management.
|
|
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.
|
|
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.
|
|
Make the tests pass by adding a POST handler for the index route.
|
|
* 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.
|
|
|
|
Instead of responding with "Hello World", render a full ERB template so
we can display HTML with form fields.
|
|
Now that we use the `Sinatra::Base` application, we have to tell the
server to run our application class. We do this by specifying a Rack
config file. Now instead of running
$ ruby app.rb
to start the app server, we run
$ rackup
|
|
* 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
|
|
For integration testing.
|
|
Create a dummy Sinatra app that gives a "Hello World" response from the
index.
|
|
To be able to reload Sinatra when changes are made.
|
|
A setup file for initialising the project.
|
|
Ignore Bundler directories.
|
|
Use Sinatra.
|