Skip to content

Instantly share code, notes, and snippets.

@adkron
Created September 8, 2010 03:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adkron/569572 to your computer and use it in GitHub Desktop.
Save adkron/569572 to your computer and use it in GitHub Desktop.
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
require 'shoulda'
RSpec.configure do |config|
config.mock_with :rspec
end
class User
include Mongoid::Document
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable, :lockable and :timeoutable, :trackable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable
attr_protected :_id
end
require 'spec_helper'
describe User do
it {should_not allow_mass_assignment_of(:_id)}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment