Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first spec passes

  • Loading branch information...
commit d72e5b8bef6ae97d6287ebf21a3b4025d7d64d1c 1 parent f20891b
Gert Goet authored
4 Gemfile
View
@@ -3,3 +3,7 @@ source 'https://rubygems.org'
gemspec
gem 'rake'
+group :test do
+ gem 'activerecord'
+ gem 'sqlite3'
+end
2  spec/spec_helper.rb
View
@@ -3,6 +3,8 @@
Bundler.setup
$:.unshift File.expand_path("../../lib", __FILE__)
+
+require 'active_record'
require "sudo_attr_accessibility"
Bundler.require(:test)
21 spec/sudo_attr_accessibility/saa_spec.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.