donors_choose 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +17 -0
- data/Gemfile +2 -2
- data/LICENSE +22 -0
- data/README.md +29 -0
- data/Rakefile +2 -16
- data/donors_choose.gemspec +14 -21
- data/lib/donors_choose.rb +4 -2
- data/lib/donors_choose/version.rb +2 -2
- metadata +30 -107
- data/README.textile +0 -55
- data/lib/donors_choose/data.rb +0 -18
- data/lib/donors_choose/data/account.rb +0 -10
- data/lib/donors_choose/data/city.rb +0 -9
- data/lib/donors_choose/data/donation.rb +0 -10
- data/lib/donors_choose/data/essay.rb +0 -10
- data/lib/donors_choose/data/giftcard.rb +0 -8
- data/lib/donors_choose/data/project.rb +0 -16
- data/lib/donors_choose/data/resource.rb +0 -10
- data/lib/donors_choose/data/school.rb +0 -11
- data/lib/donors_choose/data/teacher.rb +0 -11
- data/test/donors_choose/data/account_test.rb +0 -17
- data/test/donors_choose/data/city_test.rb +0 -17
- data/test/donors_choose/data/donation_test.rb +0 -16
- data/test/donors_choose/data/essay_test.rb +0 -17
- data/test/donors_choose/data/giftcard_test.rb +0 -13
- data/test/donors_choose/data/project_test.rb +0 -33
- data/test/donors_choose/data/resource_test.rb +0 -17
- data/test/donors_choose/data/school_test.rb +0 -16
- data/test/donors_choose/data/teacher_test.rb +0 -21
- data/test/test_helper.rb +0 -15
data/.gitignore
ADDED
data/Gemfile
CHANGED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Steve Klabnik
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# DonorsChoose
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'donors_choose'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install donors_choose
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
CHANGED
@@ -1,16 +1,2 @@
|
|
1
|
-
|
2
|
-
require
|
3
|
-
Bundler::GemHelper.install_tasks
|
4
|
-
|
5
|
-
# Test tasks
|
6
|
-
require 'rake'
|
7
|
-
require 'rake/testtask'
|
8
|
-
|
9
|
-
desc "Run basic tests"
|
10
|
-
Rake::TestTask.new("test_units") { |t|
|
11
|
-
t.pattern = 'test/*/*/*_test.rb'
|
12
|
-
t.verbose = true
|
13
|
-
t.warning = true
|
14
|
-
}
|
15
|
-
|
16
|
-
task :default => [:test_units]
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
require "bundler/gem_tasks"
|
data/donors_choose.gemspec
CHANGED
@@ -1,24 +1,17 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
require "donors_choose/version"
|
2
|
+
require File.expand_path('../lib/donors_choose/version', __FILE__)
|
4
3
|
|
5
|
-
Gem::Specification.new do |
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
s.homepage = ""
|
12
|
-
s.summary = %q{Libaries to assist with mining and utilizing donorschoose.org}
|
13
|
-
s.description = %q{}
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Steve Klabnik"]
|
6
|
+
gem.email = ["steve@steveklabnik.com"]
|
7
|
+
gem.description = %q{A gem for the DonorsChoose.org API.}
|
8
|
+
gem.summary = %q{A gem for the DonorsChoose.org API.}
|
9
|
+
gem.homepage = ""
|
14
10
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
23
|
-
s.require_paths = ["lib"]
|
24
|
-
end
|
11
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
12
|
+
gem.files = `git ls-files`.split("\n")
|
13
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
14
|
+
gem.name = "donors_choose"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = DonorsChoose::VERSION
|
17
|
+
end
|
data/lib/donors_choose.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module DonorsChoose
|
2
|
-
VERSION = "0.0.
|
3
|
-
end
|
2
|
+
VERSION = "0.0.3"
|
3
|
+
end
|
metadata
CHANGED
@@ -1,130 +1,53 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: donors_choose
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 2
|
10
|
-
version: 0.0.2
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
13
|
-
-
|
7
|
+
authors:
|
8
|
+
- Steve Klabnik
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
-
|
22
|
-
name: activerecord
|
23
|
-
prerelease: false
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - ">"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 7
|
30
|
-
segments:
|
31
|
-
- 3
|
32
|
-
- 0
|
33
|
-
version: "3.0"
|
34
|
-
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: pg
|
38
|
-
prerelease: false
|
39
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
-
none: false
|
41
|
-
requirements:
|
42
|
-
- - ">="
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
hash: 3
|
45
|
-
segments:
|
46
|
-
- 0
|
47
|
-
version: "0"
|
48
|
-
type: :runtime
|
49
|
-
version_requirements: *id002
|
50
|
-
description: ""
|
51
|
-
email:
|
52
|
-
- ""
|
12
|
+
date: 2012-02-14 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: A gem for the DonorsChoose.org API.
|
15
|
+
email:
|
16
|
+
- steve@steveklabnik.com
|
53
17
|
executables: []
|
54
|
-
|
55
18
|
extensions: []
|
56
|
-
|
57
19
|
extra_rdoc_files: []
|
58
|
-
|
59
|
-
|
20
|
+
files:
|
21
|
+
- .gitignore
|
60
22
|
- Gemfile
|
61
|
-
-
|
23
|
+
- LICENSE
|
24
|
+
- README.md
|
62
25
|
- Rakefile
|
63
26
|
- donors_choose.gemspec
|
64
27
|
- lib/donors_choose.rb
|
65
|
-
- lib/donors_choose/data.rb
|
66
|
-
- lib/donors_choose/data/account.rb
|
67
|
-
- lib/donors_choose/data/city.rb
|
68
|
-
- lib/donors_choose/data/donation.rb
|
69
|
-
- lib/donors_choose/data/essay.rb
|
70
|
-
- lib/donors_choose/data/giftcard.rb
|
71
|
-
- lib/donors_choose/data/project.rb
|
72
|
-
- lib/donors_choose/data/resource.rb
|
73
|
-
- lib/donors_choose/data/school.rb
|
74
|
-
- lib/donors_choose/data/teacher.rb
|
75
28
|
- lib/donors_choose/version.rb
|
76
|
-
|
77
|
-
- test/donors_choose/data/city_test.rb
|
78
|
-
- test/donors_choose/data/donation_test.rb
|
79
|
-
- test/donors_choose/data/essay_test.rb
|
80
|
-
- test/donors_choose/data/giftcard_test.rb
|
81
|
-
- test/donors_choose/data/project_test.rb
|
82
|
-
- test/donors_choose/data/resource_test.rb
|
83
|
-
- test/donors_choose/data/school_test.rb
|
84
|
-
- test/donors_choose/data/teacher_test.rb
|
85
|
-
- test/test_helper.rb
|
86
|
-
has_rdoc: true
|
87
|
-
homepage: ""
|
29
|
+
homepage: ''
|
88
30
|
licenses: []
|
89
|
-
|
90
31
|
post_install_message:
|
91
32
|
rdoc_options: []
|
92
|
-
|
93
|
-
require_paths:
|
33
|
+
require_paths:
|
94
34
|
- lib
|
95
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
35
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
96
36
|
none: false
|
97
|
-
requirements:
|
98
|
-
- -
|
99
|
-
- !ruby/object:Gem::Version
|
100
|
-
|
101
|
-
|
102
|
-
- 0
|
103
|
-
version: "0"
|
104
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
42
|
none: false
|
106
|
-
requirements:
|
107
|
-
- -
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
|
110
|
-
segments:
|
111
|
-
- 0
|
112
|
-
version: "0"
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
113
47
|
requirements: []
|
114
|
-
|
115
|
-
|
116
|
-
rubygems_version: 1.5.2
|
48
|
+
rubyforge_project:
|
49
|
+
rubygems_version: 1.8.16
|
117
50
|
signing_key:
|
118
51
|
specification_version: 3
|
119
|
-
summary:
|
120
|
-
test_files:
|
121
|
-
- test/donors_choose/data/account_test.rb
|
122
|
-
- test/donors_choose/data/city_test.rb
|
123
|
-
- test/donors_choose/data/donation_test.rb
|
124
|
-
- test/donors_choose/data/essay_test.rb
|
125
|
-
- test/donors_choose/data/giftcard_test.rb
|
126
|
-
- test/donors_choose/data/project_test.rb
|
127
|
-
- test/donors_choose/data/resource_test.rb
|
128
|
-
- test/donors_choose/data/school_test.rb
|
129
|
-
- test/donors_choose/data/teacher_test.rb
|
130
|
-
- test/test_helper.rb
|
52
|
+
summary: A gem for the DonorsChoose.org API.
|
53
|
+
test_files: []
|
data/README.textile
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
h1. donors_choose
|
2
|
-
|
3
|
-
This library sprung from the 2011 Hacking Education contest for DonorsChoose.org. (http://www.donorschoose.org/hacking-education)
|
4
|
-
|
5
|
-
The DonorsChoose::Data module match up the normalized data provided by DonorsChoose.org to classes that inherit from ActiveRecord::Base.
|
6
|
-
|
7
|
-
*This gem assumes you have loaded the DonorsChoose.org datasets into a PostgreSQL database and normalized the data. See the "contest documentation":http://developer.donorschoose.org/the-data/data-schema for more information.*
|
8
|
-
|
9
|
-
h2. Usage
|
10
|
-
|
11
|
-
<pre>
|
12
|
-
gem install donors_choose
|
13
|
-
</pre>
|
14
|
-
|
15
|
-
<pre>
|
16
|
-
project = DonorsChoose::Data::Project.first
|
17
|
-
project.donations
|
18
|
-
school = DonorsChoose::Data::School.last
|
19
|
-
school.teachers
|
20
|
-
</pre>
|
21
|
-
|
22
|
-
|
23
|
-
h3. Rails
|
24
|
-
|
25
|
-
If you'd like to use it in Rails, just add the following to your Gemfile:
|
26
|
-
|
27
|
-
<pre>
|
28
|
-
gem 'donors_choose'
|
29
|
-
</pre>
|
30
|
-
|
31
|
-
h3. Stand alone
|
32
|
-
|
33
|
-
If you'd like to use it stand alone, do the following:
|
34
|
-
|
35
|
-
Create a database.yml, very similar to what you'd have in Rails:
|
36
|
-
|
37
|
-
bq. adapter: postgresql
|
38
|
-
host: localhost
|
39
|
-
username: postgres
|
40
|
-
password: password
|
41
|
-
port: 5432
|
42
|
-
database: donors_choose_data
|
43
|
-
schema_search_path: public
|
44
|
-
|
45
|
-
Then, drop into irb, require the gem, and establish the db connection
|
46
|
-
|
47
|
-
<pre>
|
48
|
-
terminal$ irb
|
49
|
-
irb(main):001:0> require 'rubygems'
|
50
|
-
irb(main):001:0> require 'donors_choose'
|
51
|
-
irb(main):001:0> DonorsChoose::Data.connect(YAML.load(File.read('database.yml')))
|
52
|
-
irb(main):001:0> DonorsChoose::Data::Project.first
|
53
|
-
</pre>
|
54
|
-
|
55
|
-
|
data/lib/donors_choose/data.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'active_record'
|
2
|
-
require 'pg'
|
3
|
-
|
4
|
-
module DonorsChoose
|
5
|
-
module Data
|
6
|
-
|
7
|
-
# Use this if you're going standalone (aka sans Rails)
|
8
|
-
def self.connect(postgres_config = {})
|
9
|
-
# Connect with db
|
10
|
-
ActiveRecord::Base.establish_connection(postgres_config)
|
11
|
-
end
|
12
|
-
|
13
|
-
Dir.glob("#{File.dirname __FILE__}/data/*.rb").each do |f|
|
14
|
-
require f
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module DonorsChoose
|
2
|
-
module Data
|
3
|
-
class Project < ActiveRecord::Base
|
4
|
-
set_table_name :normalized_project
|
5
|
-
set_primary_key :_projectid
|
6
|
-
|
7
|
-
belongs_to :school, :foreign_key => :_schoolid
|
8
|
-
belongs_to :teacher, :foreign_key => :_teacher_acctid
|
9
|
-
|
10
|
-
has_one :essay, :foreign_key => :_projectid
|
11
|
-
|
12
|
-
has_many :donations, :foreign_key => :_projectid
|
13
|
-
has_many :resources, :foreign_key => :_projectid
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
module DonorsChoose
|
2
|
-
module Data
|
3
|
-
class Teacher < ActiveRecord::Base
|
4
|
-
set_table_name :normalized_teacher
|
5
|
-
set_primary_key :_teacher_acctid
|
6
|
-
|
7
|
-
has_many :projects, :foreign_key => :_teacher_acctid
|
8
|
-
has_many :schools, :through => :projects
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
|
2
|
-
|
3
|
-
class AccountTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def setup
|
6
|
-
@account = DonorsChoose::Data::Account.order(:_acctid).first
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_account_setup
|
10
|
-
assert_equal "00008481214e948f070337066f875fb2", @account._acctid
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_city_setup
|
14
|
-
assert_equal 4474, @account.city.id
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
|
2
|
-
|
3
|
-
class CityTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def setup
|
6
|
-
@city = DonorsChoose::Data::City.first
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_city_setup
|
10
|
-
assert_equal 1, @city.id
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_accounts_setup
|
14
|
-
assert_equal "c4127fe826abef12174ca4d0e7288f88", @city.accounts.first._acctid
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
|
2
|
-
|
3
|
-
class DonationTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def setup
|
6
|
-
@donation = DonorsChoose::Data::Donation.order(:_donationid).first
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_donation_setup
|
10
|
-
assert_equal "0000023f507999464aa2b78875b7e5d6", @donation._donationid
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_project_setup
|
14
|
-
assert_equal "69bf3a609bb4673818e0eebd004ea504", @donation.project._projectid
|
15
|
-
end
|
16
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
|
2
|
-
|
3
|
-
class EssayTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def setup
|
6
|
-
@essay = DonorsChoose::Data::Essay.order(:_projectid).first
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_essay_setup
|
10
|
-
assert_equal "0000023f507999464aa2b78875b7e5d6", @essay._projectid
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_project_setup
|
14
|
-
assert_equal "0000023f507999464aa2b78875b7e5d6", @essay.project._projectid
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
|
2
|
-
|
3
|
-
class GiftcardTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def setup
|
6
|
-
@giftcard = DonorsChoose::Data::Giftcard.order(:_giftcardid).first
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_giftcard_setup
|
10
|
-
assert_equal "000238b44c187c254752736e53ee46f2", @giftcard._giftcardid
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
|
2
|
-
|
3
|
-
class ProjectTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def setup
|
6
|
-
@project = DonorsChoose::Data::Project.order(:_projectid).first
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_project_setup
|
10
|
-
assert_equal "0000023f507999464aa2b78875b7e5d6", @project._projectid
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_donation_setup
|
14
|
-
assert_equal "ee519de971e6ec8961f5efa06c6ed191", @project.donations.first._donationid
|
15
|
-
end
|
16
|
-
|
17
|
-
def test_essay_setup
|
18
|
-
assert_equal "0000023f507999464aa2b78875b7e5d6", @project.essay._projectid
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_teacher_setup
|
22
|
-
assert_equal "5ac258059d9c4fc4db5c1a92b7204db0", @project.teacher._teacher_acctid
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_resources_setup
|
26
|
-
assert_equal "179328a86f77fd5516d122f371c41d32", @project.resources.first._resourceid
|
27
|
-
end
|
28
|
-
|
29
|
-
def test_school_setup
|
30
|
-
assert_equal "c8eafeea02033a1cacd629b410668d55", @project.school._schoolid
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
|
2
|
-
|
3
|
-
class ResourceTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def setup
|
6
|
-
@resource = DonorsChoose::Data::Resource.order(:_resourceid).first
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_resource_setup
|
10
|
-
assert_equal "00000170fe6288e0bc4d136e7d9b5ff2", @resource._resourceid
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_project_setup
|
14
|
-
assert_equal "401699836249c08c7a686b33e243b826", @resource.project._projectid
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
|
2
|
-
|
3
|
-
class SchoolTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def setup
|
6
|
-
@school = DonorsChoose::Data::School.order(:_schoolid).first
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_school_setup
|
10
|
-
assert_equal "00064eac8b3d1f6dea8a07559922ed58", @school._schoolid
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_project_setup
|
14
|
-
assert_equal "2934f1c8ae5069a41fe601dcf57601be", @school.projects.first._projectid
|
15
|
-
end
|
16
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
|
2
|
-
|
3
|
-
class TeacherTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def setup
|
6
|
-
@teacher = DonorsChoose::Data::Teacher.order(:_teacher_acctid).first
|
7
|
-
end
|
8
|
-
|
9
|
-
def test_teacher_setup
|
10
|
-
assert_equal "0000fc70ad0a307d08f88a484dd99cb4", @teacher._teacher_acctid
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_projects_setup
|
14
|
-
assert_equal "dde9ff3a749c46a5d6d6be4f37b0dba6", @teacher.projects.first._projectid
|
15
|
-
end
|
16
|
-
|
17
|
-
def test_schools_setup
|
18
|
-
assert_equal "3a379fd45cb12c92c3c4283e97421111", @teacher.schools.first._schoolid
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
data/test/test_helper.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
|
5
|
-
require File.expand_path(File.dirname(__FILE__) + "/../lib/donors_choose/data")
|
6
|
-
|
7
|
-
postgres_config = { :adapter => "postgresql",
|
8
|
-
:host => "localhost",
|
9
|
-
:username => "postgres",
|
10
|
-
:password => "password",
|
11
|
-
:port => 5432,
|
12
|
-
:database => "donors_choose_data",
|
13
|
-
:schema_search_path => "public" }
|
14
|
-
|
15
|
-
DonorsChoose::Data.connect postgres_config
|