mls 1.1.3 → 1.1.4
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.
- checksums.yaml +4 -4
- data/lib/mls/session.rb +10 -1
- data/mls.gemspec +1 -1
- metadata +2 -20
- data/test/units/models/test_account.rb +0 -28
- data/test/units/models/test_address.rb +0 -20
- data/test/units/models/test_contact.rb +0 -31
- data/test/units/models/test_flyer.rb +0 -22
- data/test/units/models/test_listing.rb +0 -243
- data/test/units/models/test_photo.rb +0 -144
- data/test/units/test_model.rb +0 -24
- data/test/units/test_parser.rb +0 -32
- data/test/units/test_resource.rb +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbe4c5d0e51a15c6a0ffed14435fee0f31ab448f
|
4
|
+
data.tar.gz: 7c9ba424dedbf1cf02a331f20af33faa54bfa58d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0085977e32094f3866b8e945b2e71e71e981bb204c710caa360d9502628a42e3c5edcce3a5ba1dac7785c565e293009012e92a1311de9e4cc36ebb5db0352478
|
7
|
+
data.tar.gz: 364147eef25f9cad12e97ff83dcc8d888a92996e74ac98da6e3e2b76722aeca9731b586b19de6d7a0a5bd7814ec5997bee0ce5b7ab6272455f3d06d620d4725a
|
data/lib/mls/session.rb
CHANGED
@@ -2,8 +2,17 @@ class Session < MLS::Model
|
|
2
2
|
|
3
3
|
belongs_to :account
|
4
4
|
|
5
|
-
|
5
|
+
# Authenticate with email and password.
|
6
|
+
# Returns either the newly created session or nil
|
7
|
+
def self.authenticate(email, password=nil)
|
8
|
+
if email.is_a? Hash
|
9
|
+
password = email[:password]
|
10
|
+
email = email[:email]
|
11
|
+
end
|
12
|
+
|
6
13
|
Session.create(:email => email, :password => password)
|
14
|
+
rescue Sunstone::Exception::Unauthorized
|
15
|
+
nil
|
7
16
|
end
|
8
17
|
|
9
18
|
def self.authenticate_by_token(token)
|
data/mls.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "mls"
|
6
|
-
s.version = '1.1.
|
6
|
+
s.version = '1.1.4'
|
7
7
|
s.authors = ["Jon Bracy", "James R. Bracy"]
|
8
8
|
s.email = ["jon@42floors.com", "james@42floors.com"]
|
9
9
|
s.homepage = "http://mls.42floors.com"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Bracy
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-10-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -220,15 +220,6 @@ files:
|
|
220
220
|
- test/mls/resource_test.rb
|
221
221
|
- test/mls_test.rb
|
222
222
|
- test/test_helper.rb
|
223
|
-
- test/units/models/test_account.rb
|
224
|
-
- test/units/models/test_address.rb
|
225
|
-
- test/units/models/test_contact.rb
|
226
|
-
- test/units/models/test_flyer.rb
|
227
|
-
- test/units/models/test_listing.rb
|
228
|
-
- test/units/models/test_photo.rb
|
229
|
-
- test/units/test_model.rb
|
230
|
-
- test/units/test_parser.rb
|
231
|
-
- test/units/test_resource.rb
|
232
223
|
homepage: http://mls.42floors.com
|
233
224
|
licenses: []
|
234
225
|
metadata: {}
|
@@ -258,13 +249,4 @@ test_files:
|
|
258
249
|
- test/mls/resource_test.rb
|
259
250
|
- test/mls_test.rb
|
260
251
|
- test/test_helper.rb
|
261
|
-
- test/units/models/test_account.rb
|
262
|
-
- test/units/models/test_address.rb
|
263
|
-
- test/units/models/test_contact.rb
|
264
|
-
- test/units/models/test_flyer.rb
|
265
|
-
- test/units/models/test_listing.rb
|
266
|
-
- test/units/models/test_photo.rb
|
267
|
-
- test/units/test_model.rb
|
268
|
-
- test/units/test_parser.rb
|
269
|
-
- test/units/test_resource.rb
|
270
252
|
has_rdoc:
|
@@ -1,28 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class TestAccount < ::Test::Unit::TestCase
|
4
|
-
|
5
|
-
def test_create_account
|
6
|
-
account = FactoryGirl.create(:account)
|
7
|
-
assert account.id
|
8
|
-
end
|
9
|
-
|
10
|
-
def test_create_invalid_account
|
11
|
-
account = FactoryGirl.build(:account, :email => nil)
|
12
|
-
account.save
|
13
|
-
assert account.errors[:email]
|
14
|
-
end
|
15
|
-
|
16
|
-
def test_search_email
|
17
|
-
account = FactoryGirl.create(:account)
|
18
|
-
matches = MLS::Account.search(account.email)
|
19
|
-
assert_equal [account].map(&:id), matches.map(&:id)
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_search_name
|
23
|
-
account = FactoryGirl.create(:account)
|
24
|
-
matches = MLS::Account.search(account.name)
|
25
|
-
assert_equal [account].map(&:id), matches.map(&:id)
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class TestAddress < ::Test::Unit::TestCase
|
4
|
-
|
5
|
-
def test_attributes
|
6
|
-
address = MLS::Address.new
|
7
|
-
|
8
|
-
attributes = [:id, :name, :slug, :latitude, :longitude, :formated_address, :streetnumber, :street, :neighbrhood, :city, :county, :state, :countr, :postalcode]
|
9
|
-
|
10
|
-
attributes.each do |attribute|
|
11
|
-
assert address.respond_to?(attribute), "address should respond to #{attribute}"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_class_methods
|
16
|
-
assert MLS::Address.respond_to?(:query)
|
17
|
-
assert MLS::Address.respond_to?(:box_cluster)
|
18
|
-
end
|
19
|
-
|
20
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class TestTour < ::Test::Unit::TestCase
|
4
|
-
|
5
|
-
# def test_attributes
|
6
|
-
# tr = MLS::Tour.new
|
7
|
-
#
|
8
|
-
# assert tr.respond_to?(:message)
|
9
|
-
# end
|
10
|
-
#
|
11
|
-
# def test_attr_accessors
|
12
|
-
# tr = MLS::Tour.new
|
13
|
-
#
|
14
|
-
# assert tr.respond_to?(:listing)
|
15
|
-
# end
|
16
|
-
#
|
17
|
-
# def test_class_methods
|
18
|
-
# assert MLS::Tour.respond_to?(:get_all_for_account)
|
19
|
-
# assert MLS::Tour.respond_to?(:create)
|
20
|
-
# end
|
21
|
-
#
|
22
|
-
# def test_parser
|
23
|
-
# assert defined?(MLS::Tour::Parser)
|
24
|
-
# end
|
25
|
-
|
26
|
-
test 'it' do
|
27
|
-
@account = FactoryGirl.create(:account)
|
28
|
-
@listing = FactoryGirl.create(:listing)
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class TestFlyer < ::Test::Unit::TestCase
|
4
|
-
|
5
|
-
|
6
|
-
def test_create_flyer
|
7
|
-
flyer = MLS::Flyer.create(:file => File.new('test/fixtures/flyer.pdf'))
|
8
|
-
assert flyer.id
|
9
|
-
end
|
10
|
-
|
11
|
-
def test_attach_flyer_to_listing
|
12
|
-
listing = MLS::Listing.create
|
13
|
-
flyer = MLS::Flyer.create(
|
14
|
-
:file => File.new('test/fixtures/flyer.pdf'),
|
15
|
-
:subject => listing)
|
16
|
-
|
17
|
-
flyer = MLS::Flyer.find(flyer.id)
|
18
|
-
assert_equal listing.id, flyer.subject_id
|
19
|
-
assert_equal "Listing", flyer.subject_type
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
@@ -1,243 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class ListingTest < Test::Unit::TestCase
|
4
|
-
|
5
|
-
def test_attributes
|
6
|
-
listing = MLS::Listing.new
|
7
|
-
|
8
|
-
attributes = [:id, :address_id, :use, :account_id, :name, :type, :space_type, :unit, :floor, :description, :size, :maximum_contiguous_size, :minimum_divisible_size, :lease_terms, :rate, :rate_units, :sublease_expiration, :available_on, :term, :offices, :conference_rooms, :bathrooms, :kitchen, :showers, :ready_to_move_in, :furniture_available, :created_at, :updated_at]
|
9
|
-
|
10
|
-
attributes.each do |attribute|
|
11
|
-
assert listing.respond_to?(attribute), "listing should respond to #{attribute}"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_attr_accessors
|
16
|
-
listing = MLS::Listing.new
|
17
|
-
|
18
|
-
assert listing.respond_to?(:address)
|
19
|
-
assert listing.respond_to?(:agents)
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_instance_methods
|
23
|
-
listing = MLS::Listing.new
|
24
|
-
|
25
|
-
assert listing.respond_to?(:photos)
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_class_methods
|
29
|
-
assert MLS::Listing.respond_to?(:find)
|
30
|
-
end
|
31
|
-
|
32
|
-
test '#request_tour for email without an account' do
|
33
|
-
@listing = FactoryGirl.create(:listing)
|
34
|
-
@name = Faker::Name.name
|
35
|
-
@email = Faker::Internet.email
|
36
|
-
tr = @listing.request_tour(@name, @email)
|
37
|
-
|
38
|
-
|
39
|
-
assert_equal({}, tr.errors)
|
40
|
-
assert_equal({}, tr.account.errors)
|
41
|
-
# TODO assert_equal({}, tr.listing.errors)
|
42
|
-
assert tr.id
|
43
|
-
end
|
44
|
-
|
45
|
-
test '#request_tour for email on a ghost account' do
|
46
|
-
@account = FactoryGirl.create(:ghost_account)
|
47
|
-
@listing = FactoryGirl.create(:listing)
|
48
|
-
|
49
|
-
tr = @listing.request_tour(@account.name, @account.email)
|
50
|
-
assert_equal({}, tr.errors)
|
51
|
-
assert_equal({}, tr.account.errors)
|
52
|
-
# TODO assert_equal({}, tr.listing.errors)
|
53
|
-
assert tr.id
|
54
|
-
end
|
55
|
-
|
56
|
-
test '#request_tour for email on an account' do
|
57
|
-
@account = FactoryGirl.create(:account)
|
58
|
-
@listing = FactoryGirl.create(:listing)
|
59
|
-
|
60
|
-
tr = @listing.request_tour(@account.name, @account.email)
|
61
|
-
assert_equal({}, tr.errors)
|
62
|
-
assert_equal({}, tr.account.errors)
|
63
|
-
# TODO assert_equal({}, tr.listing.errors)
|
64
|
-
assert tr.id
|
65
|
-
end
|
66
|
-
|
67
|
-
test '#request_tour for an non-existant listing' do
|
68
|
-
@listing = FactoryGirl.build(:listing, :id => 94332)
|
69
|
-
|
70
|
-
assert_raises(MLS::Exception::NotFound) do
|
71
|
-
@listing.request_tour(Faker::Name.name, Faker::Internet.email)
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
test '#request_tour without and account name' do
|
76
|
-
@listing = FactoryGirl.create(:listing)
|
77
|
-
|
78
|
-
tr = @listing.request_tour('', Faker::Internet.email)
|
79
|
-
assert !tr.id
|
80
|
-
assert_equal({:name => ["can't be blank"]}, tr.account.errors)
|
81
|
-
|
82
|
-
tr = @listing.request_tour(nil, Faker::Internet.email)
|
83
|
-
assert !tr.id
|
84
|
-
assert_equal({:name => ["can't be blank"]}, tr.account.errors)
|
85
|
-
end
|
86
|
-
|
87
|
-
test '#request_tour without an account email' do
|
88
|
-
@listing = FactoryGirl.create(:listing)
|
89
|
-
|
90
|
-
tr = @listing.request_tour(Faker::Name.name, '')
|
91
|
-
assert !tr.id
|
92
|
-
assert_equal({:email => ["can't be blank", "is invalid"]}, tr.account.errors)
|
93
|
-
|
94
|
-
tr = @listing.request_tour(Faker::Name.name, nil)
|
95
|
-
assert !tr.id
|
96
|
-
# assert !tr.persisted? #TODO move to persisted being based of id?
|
97
|
-
assert_equal({:email => ["can't be blank", "is invalid"]}, tr.account.errors)
|
98
|
-
end
|
99
|
-
|
100
|
-
test '#request_tour with an account email' do
|
101
|
-
@account = FactoryGirl.create(:account)
|
102
|
-
@listing = FactoryGirl.create(:listing)
|
103
|
-
|
104
|
-
tr = @listing.request_tour('', @account.email) # TODO should this try to set the name of the account?
|
105
|
-
assert_equal({}, tr.errors)
|
106
|
-
assert_equal({}, tr.account.errors)
|
107
|
-
# TODO assert_equal({}, tr.listing.errors)
|
108
|
-
assert tr.id
|
109
|
-
assert tr.persisted?
|
110
|
-
end
|
111
|
-
|
112
|
-
test '#request_tour multiple times for a listing' do
|
113
|
-
@account = FactoryGirl.create(:account)
|
114
|
-
@listing = FactoryGirl.create(:listing)
|
115
|
-
|
116
|
-
tr1 = @listing.request_tour(@account.name, @account.email)
|
117
|
-
assert_equal({}, tr1.errors) # TODO should errors be here for account?
|
118
|
-
assert_equal({}, tr1.account.errors)
|
119
|
-
# TODO assert_equal({}, tr.listing.errors)
|
120
|
-
assert tr1.persisted?
|
121
|
-
|
122
|
-
tr2 = @listing.request_tour(@account.name, @account.email)
|
123
|
-
assert_equal({}, tr2.errors)
|
124
|
-
assert_equal({}, tr2.account.errors)
|
125
|
-
# TODO assert_equal({}, tr.listing.errors)
|
126
|
-
assert tr2.persisted?
|
127
|
-
|
128
|
-
assert_not_equal tr1.id, tr2.id
|
129
|
-
end
|
130
|
-
|
131
|
-
test '#request_tour with optional info' do
|
132
|
-
@listing = FactoryGirl.create(:listing)
|
133
|
-
|
134
|
-
info = {:company => '42Floors', :population => 10, :funding => 'string thing', :move_in_date => '2012-09-12'}
|
135
|
-
tr = @listing.request_tour(Faker::Name.name, Faker::Internet.email, info)
|
136
|
-
|
137
|
-
assert tr.id
|
138
|
-
assert_equal '42Floors', info[:company]
|
139
|
-
assert_equal 10, info[:population]
|
140
|
-
assert_equal 'string thing', info[:funding]
|
141
|
-
assert_equal '2012-09-12', info[:move_in_date]
|
142
|
-
|
143
|
-
tr = @listing.request_tour('', nil, info)
|
144
|
-
assert !tr.id
|
145
|
-
assert_equal '42Floors', info[:company]
|
146
|
-
assert_equal 10, info[:population]
|
147
|
-
assert_equal 'string thing', info[:funding]
|
148
|
-
assert_equal '2012-09-12', info[:move_in_date]
|
149
|
-
end
|
150
|
-
|
151
|
-
def test_rate_per_sqft_per_month
|
152
|
-
listing = MLS::Listing.new(:rate => 10.5, :rate_units => '/sqft/mo', :size => 5)
|
153
|
-
|
154
|
-
assert_equal 10.5, listing.rate
|
155
|
-
assert_equal 10.5, listing.rate('/sqft/mo')
|
156
|
-
assert_equal 126, listing.rate('/sqft/yr')
|
157
|
-
assert_equal 52.5, listing.rate('/mo')
|
158
|
-
assert_equal 630, listing.rate('/yr')
|
159
|
-
assert_equal 2100, listing.rate('/desk/mo')
|
160
|
-
assert_raises RuntimeError do
|
161
|
-
listing.rate('/random')
|
162
|
-
end
|
163
|
-
end
|
164
|
-
|
165
|
-
def test_rate_per_sqft_per_year
|
166
|
-
listing = MLS::Listing.new(:rate => 126, :rate_units => '/sqft/yr', :size => 5)
|
167
|
-
|
168
|
-
assert_equal 126, listing.rate
|
169
|
-
assert_equal 10.5, listing.rate('/sqft/mo')
|
170
|
-
assert_equal 126, listing.rate('/sqft/yr')
|
171
|
-
assert_equal 52.5, listing.rate('/mo')
|
172
|
-
assert_equal 630, listing.rate('/yr')
|
173
|
-
assert_equal 2100, listing.rate('/desk/mo')
|
174
|
-
assert_raises RuntimeError do
|
175
|
-
listing.rate('/random')
|
176
|
-
end
|
177
|
-
end
|
178
|
-
|
179
|
-
def test_rate_per_month
|
180
|
-
listing = MLS::Listing.new(:rate => 52.5, :rate_units => '/mo', :size => 5)
|
181
|
-
|
182
|
-
assert_equal 52.5, listing.rate
|
183
|
-
assert_equal 10.5, listing.rate('/sqft/mo')
|
184
|
-
assert_equal 126, listing.rate('/sqft/yr')
|
185
|
-
assert_equal 52.5, listing.rate('/mo')
|
186
|
-
assert_equal 630, listing.rate('/yr')
|
187
|
-
assert_equal 2100, listing.rate('/desk/mo')
|
188
|
-
assert_raises RuntimeError do
|
189
|
-
listing.rate('/random')
|
190
|
-
end
|
191
|
-
end
|
192
|
-
|
193
|
-
def test_rate_per_year
|
194
|
-
listing = MLS::Listing.new(:rate => 630, :rate_units => '/yr', :size => 5)
|
195
|
-
|
196
|
-
assert_equal 630, listing.rate
|
197
|
-
assert_equal 10.5, listing.rate('/sqft/mo')
|
198
|
-
assert_equal 126, listing.rate('/sqft/yr')
|
199
|
-
assert_equal 52.5, listing.rate('/mo')
|
200
|
-
assert_equal 630, listing.rate('/yr')
|
201
|
-
assert_equal 2100, listing.rate('/desk/mo')
|
202
|
-
assert_raises RuntimeError do
|
203
|
-
listing.rate('/random')
|
204
|
-
end
|
205
|
-
end
|
206
|
-
|
207
|
-
def test_rate_per_desk_per_month
|
208
|
-
listing = MLS::Listing.new(:rate => 2100, :rate_units => '/desk/mo', :size => 5)
|
209
|
-
|
210
|
-
assert_equal 2100, listing.rate
|
211
|
-
assert_equal 10.5, listing.rate('/sqft/mo')
|
212
|
-
assert_equal 126, listing.rate('/sqft/yr')
|
213
|
-
assert_equal 2100, listing.rate('/mo')
|
214
|
-
assert_equal 25200, listing.rate('/yr')
|
215
|
-
assert_equal 2100, listing.rate('/desk/mo')
|
216
|
-
assert_raises RuntimeError do
|
217
|
-
listing.rate('/random')
|
218
|
-
end
|
219
|
-
end
|
220
|
-
|
221
|
-
def test_rate_percision
|
222
|
-
listing = MLS::Listing.new(:rate => 47, :rate_units => '/sqft/yr', :size => 5)
|
223
|
-
|
224
|
-
assert_equal 3.92, listing.rate('/sqft/mo')
|
225
|
-
assert_equal 47, listing.rate('/sqft/yr')
|
226
|
-
assert_equal 19.58, listing.rate('/mo')
|
227
|
-
assert_equal 235, listing.rate('/yr')
|
228
|
-
assert_equal 783.33, listing.rate('/desk/mo')
|
229
|
-
end
|
230
|
-
|
231
|
-
def test_null_rate
|
232
|
-
listing = MLS::Listing.new(:rate => nil, :rate_units => '/yr', :size => 5)
|
233
|
-
|
234
|
-
assert_equal nil, listing.rate
|
235
|
-
assert_equal nil, listing.rate('/sqft/mo')
|
236
|
-
assert_equal nil, listing.rate('/sqft/yr')
|
237
|
-
assert_equal nil, listing.rate('/mo')
|
238
|
-
assert_equal nil, listing.rate('/yr')
|
239
|
-
assert_equal nil, listing.rate('/desk/mo')
|
240
|
-
assert_equal nil, listing.rate('/random')
|
241
|
-
end
|
242
|
-
|
243
|
-
end
|
@@ -1,144 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class TestPhoto < ::Test::Unit::TestCase
|
4
|
-
|
5
|
-
|
6
|
-
def test_create_photo
|
7
|
-
photo = MLS::Photo.create(TEST_IMAGE)
|
8
|
-
assert photo.id
|
9
|
-
assert photo.digest
|
10
|
-
end
|
11
|
-
|
12
|
-
end
|
13
|
-
|
14
|
-
TEST_IMAGE = StringIO.new(Base64.decode64(<<PHOTO))
|
15
|
-
/9j/4AAQSkZJRgABAQEASABIAAD/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlu
|
16
|
-
bwIQAABtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMg
|
17
|
-
c1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQICAAAAAAAAAAAAAAAAAA
|
18
|
-
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFjcHJ0AAABUAAA
|
19
|
-
ADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFlaAAAC
|
20
|
-
GAAAABRnWFlaAAACLAAAABRiWFlaAAACQAAAABRkbW5kAAACVAAAAHBkbWRk
|
21
|
-
AAACxAAAAIh2dWVkAAADTAAAAIZ2aWV3AAAD1AAAACRsdW1pAAAD+AAAABRt
|
22
|
-
ZWFzAAAEDAAAACR0ZWNoAAAEMAAAAAxyVFJDAAAEPAAACAxnVFJDAAAEPA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
-
bXKiCeUCZvL+6OB9KkjnJwCelQkeg/MUAsvQD8quxFzQSUKjM7cAZxWfNO8r
|
132
|
-
ZY8dh6UHcepA9s0ggc9MH8RSSsDZHminFGBwQc/SiqEWTBSeQfarFJSuVYg8
|
133
|
-
lvUUCBj3FWN3oqj8M0F29TRcLEIgdPm9vpVqxmD4ilG4e/NQ5qOF9kyt6Gpe
|
134
|
-
qKjobDg/ZpyMAhTyDwaxvLPtW3KQLCYgdQP51k1MHoE1qQ+W3tThGe+2paSr
|
135
|
-
uTYbsGOi0nlDrgVKI3xkjA9TxRhR1f8AIZoAj2n1oqTKf3SfqaKAEzSGkpc0
|
136
|
-
AFFMZiOi5/GmedjqposBOihzjdg/zqGS3l3Ex4dOowadCySSqJGKL3I5qORT
|
137
|
-
GpaJ2DZ+6OlNCNK1mMlv9mcgM/G7HSoXi8tyskigg4IHNM0/m4jLE9ck0jMW
|
138
|
-
csTyTmotZlva47MY6KW/3jS+a3RcKP8AZGKjozTJFPPJOaKTNJmgBaKTNFMC
|
139
|
-
DzW9qPNajym9qTy29KrQWou9/T9KQs7dV/SnKHXoop2X/uj86AI/JY9wKVY2
|
140
|
-
B++afl/7o/OmtI4/gpagWbc4lY9whx+VMplvMokUkDPfNWrqNAfMhIMZ/Q1N
|
141
|
-
rFXuQUlFFAgozS0UAGaKKKYDe1LSZooAKKKKACiiigBCoPUClHFFFAC0tNpa
|
142
|
-
QxaKSigBaKAM9xRTArBjS7zRRVEhvNG80UUALvNKHNFFIBQ9LuzRRQMN1Luo
|
143
|
-
opALmjNFFAwzRRRQB//Z
|
144
|
-
PHOTO
|
data/test/units/test_model.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class MyModel
|
4
|
-
include MLS::Model
|
5
|
-
|
6
|
-
end
|
7
|
-
|
8
|
-
class TestModel < ::Test::Unit::TestCase
|
9
|
-
|
10
|
-
def test_instance_methods
|
11
|
-
model = MyModel.new
|
12
|
-
|
13
|
-
assert model.respond_to?(:attribute)
|
14
|
-
assert model.respond_to?(:attributes)
|
15
|
-
assert model.respond_to?(:attribute_module)
|
16
|
-
assert model.respond_to?(:create_reader_for)
|
17
|
-
assert model.respond_to?(:create_writer_for)
|
18
|
-
assert model.respond_to?(:model_name)
|
19
|
-
assert model.respond_to?(:param_key)
|
20
|
-
assert model.respond_to?(:root_element)
|
21
|
-
assert model.respond_to?(:collection_root_element)
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
data/test/units/test_parser.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class MyParser < MLS::Parser; end
|
4
|
-
|
5
|
-
class TestParser < ::Test::Unit::TestCase
|
6
|
-
|
7
|
-
def test_attr_readers
|
8
|
-
parser = MyParser.new
|
9
|
-
|
10
|
-
assert parser.respond_to?(:object)
|
11
|
-
end
|
12
|
-
|
13
|
-
def test_instance_methods
|
14
|
-
parser = MyParser.new
|
15
|
-
|
16
|
-
assert parser.respond_to?(:parse)
|
17
|
-
assert parser.respond_to?(:update_attributes)
|
18
|
-
assert parser.respond_to?(:extract_attributes)
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_class_methods
|
22
|
-
assert MyParser.respond_to?(:parse)
|
23
|
-
assert MyParser.respond_to?(:parse_collection)
|
24
|
-
assert MyParser.respond_to?(:build)
|
25
|
-
assert MyParser.respond_to?(:update)
|
26
|
-
assert MyParser.respond_to?(:extract_attributes)
|
27
|
-
assert MyParser.respond_to?(:object_class)
|
28
|
-
assert MyParser.respond_to?(:root_element)
|
29
|
-
assert MyParser.respond_to?(:collection_root_element)
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
data/test/units/test_resource.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class MyResource < MLS::Resource; end
|
4
|
-
|
5
|
-
class TestResource < ::Test::Unit::TestCase
|
6
|
-
|
7
|
-
def test_attr_readers
|
8
|
-
resource = MyResource.new
|
9
|
-
|
10
|
-
assert resource.respond_to?(:errors)
|
11
|
-
assert resource.respond_to?(:persisted)
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_instance_methods
|
15
|
-
resource = MyResource.new
|
16
|
-
|
17
|
-
assert resource.respond_to?(:new_record?)
|
18
|
-
assert resource.respond_to?(:persisted?)
|
19
|
-
assert resource.respond_to?(:save)
|
20
|
-
|
21
|
-
assert resource.respond_to?(:attributes)
|
22
|
-
assert resource.respond_to?(:set_default_values)
|
23
|
-
assert resource.respond_to?(:update_attributes)
|
24
|
-
|
25
|
-
assert resource.respond_to?(:to_hash)
|
26
|
-
assert resource.respond_to?(:to_key)
|
27
|
-
end
|
28
|
-
|
29
|
-
test 'save returns true || false'
|
30
|
-
end
|