Giter VIP home page Giter VIP logo

simple_user_auth's Introduction

Simple User Authentication

Quickstart

First, clone this repository

> git clone https://github.com/makersacademy/simple_user_auth.git
> cd simple_user_auth
> bundle install

Then, create the development and test databases

> createdb user_auth_development
> createdb user_auth_test
> rake db:auto_migrate
> rake db:auto_migrate RACK_ENV=test

And then, to run locally

> rackup # Start the server at localhost:9292

To run tests

> bundle exec rspec

Instructions

1. Diagramming

  1. Diagram the flow of data through this application by writing down the sequence of line numbers for each line of code that gets executed (in order) for each of the three feature specs

  2. Find another pair and compare your work

2. Specs

  1. Write specs for User.authenticate

    • if user doesn’t exist
    • If user does, but password incorrect
    • If user does and password correct
  2. Write a feature test for a user signing up twice with the same email, and a unit test for validating uniqueness of email property

  3. Write a feature test for a user using a password of at least 6 characters, and a unit test for validating this

Resources

3. Flash Messages

  1. Update one feature spec at a time to assert that the user is shown helpful messages, and then implement it.
  • A user should be shown information about why they succeeded or failed at signing up or in.

Resources

4. Restful Routes

  1. Read this snippet and play around with this interactive tool https://sjmog.github.io/rest.

  2. Rename the routes in this app to be restful and then separate app.rb into controllers that deal with one resource

    • Conventionally
      • Registrations controller ( get/post signup) eg: get ‘/registrations/new’, post ‘/registrations
      • Sessions controller (get/post signin/out)
      • Home controller ( get index)
      • App controller ( helper methods)

5. Further

  1. Add user auth to your messaging app.
  2. See Ed

simple_user_auth's People

Contributors

dearshrewdwit avatar

Forkers

makersacademy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.