Permalink
Browse files

first spec passes

  • Loading branch information...
1 parent f20891b commit d72e5b8bef6ae97d6287ebf21a3b4025d7d64d1c @eval committed Feb 3, 2012
Showing with 26 additions and 1 deletion.
  1. +4 −0 Gemfile
  2. +2 −0 spec/spec_helper.rb
  3. +20 −1 spec/sudo_attr_accessibility/saa_spec.rb
View
@@ -3,3 +3,7 @@ source 'https://rubygems.org'
gemspec
gem 'rake'
+group :test do
+ gem 'activerecord'
+ gem 'sqlite3'
+end
View
@@ -3,6 +3,8 @@
Bundler.setup
$:.unshift File.expand_path("../../lib", __FILE__)
+
+require 'active_record'
require "sudo_attr_accessibility"
Bundler.require(:test)
@@ -1,7 +1,26 @@
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+require 'sqlite3'
+
+ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
+ActiveRecord::Migration.verbose = false
+ActiveRecord::Schema.define do
+ create_table :people do |t|
+ t.column :name, :string
+ t.column :age, :integer
+
+ t.timestamps
+ end
+end
+
+class Person < ActiveRecord::Base
+ attr_accessible :name
+ sudo_attr_accessible_as :admin
+end
+
describe SudoAttrAccessibility do
it "should work" do
- true.should == !false
+ p1 = Person.new(:age => 12)
+ p1.age.should be_nil
end
end

0 comments on commit d72e5b8

Please sign in to comment.