Skip to content

Instantly share code, notes, and snippets.

require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
@mausconi
mausconi / README
Created April 5, 2017 15:10 — forked from jasper502/README
Devise with additional user fields, nested models / attributes and custom routes
The idea here is that I have a single User login that can eventually be tied to multiple Companies via the Role.
You signup via Devise on the custom /register route and fillout the Company information etc. The custom registration controller creates the Role during the user creation and sets a few other attributes.
It all worked but now it's broken and I have no idea what I did to break it.
When I try to create a new user / company the additional user fields (name_first & name_last) always fail validation regardless if they are in fact valid. The nested Company fields do not validate at all. If I enter the email and password field only the form works but only creates the User record.
To me it seems like the custom registration controller is not being processed at all.
@mausconi
mausconi / rspec_model_testing_template.rb
Created June 2, 2016 22:53 — forked from PWSdelta/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@mausconi
mausconi / About.md
Created December 3, 2015 21:42 — forked from chapel/About.md
Discourse topic list customizations for http://discourse.wastingyourlife.co