Skip to content
Todo with Authentication for Winter 2014 (Rails 4)
Ruby CoffeeScript CSS JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
app
bin
config
db
lib
log
public
spec
vendor/assets
.gitignore
.rspec
.ruby-version
Gemfile
Gemfile.lock
Guardfile
README.rdoc
Rakefile
config.ru

README.rdoc

README

Before authenticatio this app was create just like Todo from scratch. The only difference is that Twitter Bootstrap has been used for the layout and styling.

Testing

  1. Add in the testing gems. There are two sections Guard Gems and then the rspec gems.

  2. Remove require 'rails/all' from config/application.rb and replace with code here.

  3. bundle install

  4. Run rails g rspec:install, which will create the spec directory and the spec_helper file.

  5. Create the other directories in the spec folder

  6. Edit the spec_helper file to add in the require capybara and factory_girl gems (don't copy everything yet). Also comment out the “Remove this line if you are not using features”.

  7. Make sure rspec works: rspec.

  8. Initialize guard guard init rspec

  9. In the root of you app, you should see a Guardfile. Edit the guard rspec line to include the options I do.

  10. Test guard guard. Wait for it to load. Press enter to run your test (should still say 0 tests). Type exit to exit guard.

  11. Get spork installed: spork rspec --bootstrap. Then edit your spec/spec_helper.rb. There are instructions in the file. Just copy all of you previous file into the prefork section, leaving the each run block empty.

  12. Add spork into the guard file: guard init spork.

  13. Remove the test directory to keep spork from wanting to run those tests: rm -rF test (be carefull with this command, if you put * instead of test your full app will be wiped out.)

  14. Test it again guard. Wait for it to load, and then press enter. Test should run faster now. If it says NoBRB server detected, you did something wrong. Check the guard file.

  15. Add your first feature in the spec/features folder. Let guard run and watch it run tests automatically!

  16. Make your tests pass!

Something went wrong with that request. Please try again.