fetcher-mongoid-models 0.0.0 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/column.rb +2 -3
- data/app/models/filter.rb +0 -3
- data/app/models/person_user.rb +0 -4
- data/app/models/source.rb +1 -4
- data/app/models/user.rb +3 -3
- data/lib/fetcher/mongoid/models/version.rb +1 -1
- data/pkg/fetcher-mongoid-models-0.0.0.gem +0 -0
- data/spec/models/column_spec.rb +1 -19
- data/spec/models/filter_spec.rb +4 -24
- data/spec/models/person_user_spec.rb +4 -10
- data/spec/models/source_spec.rb +4 -23
- data/spec/models/user_spec.rb +0 -2
- metadata +3 -2
data/app/models/column.rb
CHANGED
data/app/models/filter.rb
CHANGED
data/app/models/person_user.rb
CHANGED
data/app/models/source.rb
CHANGED
data/app/models/user.rb
CHANGED
Binary file
|
data/spec/models/column_spec.rb
CHANGED
@@ -9,27 +9,9 @@ describe 'Fetcher::Mongoid::Models::Db' do
|
|
9
9
|
@column = Column.new
|
10
10
|
end
|
11
11
|
|
12
|
-
it 'should return true when insert
|
12
|
+
it 'should return true when insert' do
|
13
13
|
@column.save.should == true
|
14
14
|
end
|
15
15
|
|
16
|
-
it 'should return true when insert with a Filter that is in the Db and i can get the filter back' do
|
17
|
-
@column.save
|
18
|
-
f = Filter.new :Column => @column
|
19
|
-
Filter::Column_id = @column._id
|
20
|
-
f.save
|
21
|
-
|
22
|
-
@column.Filter.push f
|
23
|
-
@column.save.should == true
|
24
|
-
|
25
|
-
aux_filter = Column.find(@column._id).Filter
|
26
|
-
aux_filter.first.should == f
|
27
|
-
f.remove
|
28
|
-
end
|
29
|
-
|
30
|
-
after do
|
31
|
-
@column.remove
|
32
|
-
end
|
33
|
-
|
34
16
|
end
|
35
17
|
end
|
data/spec/models/filter_spec.rb
CHANGED
@@ -6,35 +6,15 @@ describe 'Fetcher::Mongoid::Models::Db' do
|
|
6
6
|
|
7
7
|
before do
|
8
8
|
Fetcher::Mongoid::Models::Db.new "./config/main.yml"
|
9
|
+
@filter = Filter.new
|
9
10
|
end
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
it 'should return false when inserted without a Column' do
|
15
|
-
expect {
|
16
|
-
filter.save
|
17
|
-
}.to raise_error NameError, "uninitialized constant Filter::Column_id"
|
18
|
-
end
|
19
|
-
|
20
|
-
it 'should return false when inserted with a Column that is not in the db' do
|
21
|
-
filter.Column = column
|
22
|
-
expect {
|
23
|
-
filter.save
|
24
|
-
}.to raise_error NameError, "uninitialized constant Filter::Column_id"
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'should return true when inserted with a valid Column' do
|
28
|
-
column.save
|
29
|
-
f = Filter.new :Column => column
|
30
|
-
Filter::Column_id = column._id
|
31
|
-
f.save.should == true
|
32
|
-
column.remove
|
33
|
-
f.remove
|
12
|
+
it 'should return true when inserted on the db' do
|
13
|
+
@filter.save.should == true
|
34
14
|
end
|
35
15
|
|
36
16
|
after do
|
37
|
-
filter.remove
|
17
|
+
@filter.remove
|
38
18
|
end
|
39
19
|
|
40
20
|
end
|
@@ -5,21 +5,15 @@ describe "Fetcher::Mongoid::Models::Db" do
|
|
5
5
|
|
6
6
|
before do
|
7
7
|
Fetcher::Mongoid::Models::Db.new "./config/main.yml"
|
8
|
+
@personuser = PersonUser.new
|
8
9
|
end
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
it "should return false when inserted without an access token" do
|
13
|
-
personuser.save.should == false
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should return true when inserted with an access token" do
|
17
|
-
personuser.accessToken = "askjhdla654654kjsdhlaksdjhlkasjdh65464"
|
18
|
-
personuser.save.should == true
|
11
|
+
it "should return true when inserted" do
|
12
|
+
@personuser.save.should == true
|
19
13
|
end
|
20
14
|
|
21
15
|
after do
|
22
|
-
personuser.remove
|
16
|
+
@personuser.remove
|
23
17
|
end
|
24
18
|
|
25
19
|
end
|
data/spec/models/source_spec.rb
CHANGED
@@ -3,33 +3,14 @@ require 'spec_helper'
|
|
3
3
|
|
4
4
|
describe 'Fetcher::Mongoid::Models::Db' do
|
5
5
|
context 'When I create a source' do
|
6
|
+
|
6
7
|
before do
|
7
8
|
Fetcher::Mongoid::Models::Db.new "./config/main.yml"
|
8
9
|
@source = Source.new
|
9
10
|
end
|
10
|
-
|
11
|
-
it 'should return
|
12
|
-
|
13
|
-
@source.save
|
14
|
-
}.to raise_error NameError, "uninitialized constant Source::Column_id"
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'should return false when insert with a Column that is not in the db' do
|
18
|
-
column = Column.new
|
19
|
-
@source.Column = column
|
20
|
-
expect {
|
21
|
-
@source.save
|
22
|
-
}.to raise_error NameError, "uninitialized constant Source::Column_id"
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'should return true when insert with a valid Column' do
|
26
|
-
column = Column.new
|
27
|
-
column.save
|
28
|
-
s = Source.new :Column => column
|
29
|
-
Source::Column_id = column._id
|
30
|
-
s.save.should == true
|
31
|
-
column.remove
|
32
|
-
s.remove
|
11
|
+
|
12
|
+
it 'should return true when inserted on the db' do
|
13
|
+
@source.save.should == true
|
33
14
|
end
|
34
15
|
|
35
16
|
after do
|
data/spec/models/user_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fetcher-mongoid-models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-12-
|
13
|
+
date: 2012-12-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mongoid
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- lib/fetcher/mongoid/models/db.rb
|
84
84
|
- lib/fetcher/mongoid/models/version.rb
|
85
85
|
- lib/models.rb
|
86
|
+
- pkg/fetcher-mongoid-models-0.0.0.gem
|
86
87
|
- spec/fetcher/mongoid/models/db_spec.rb
|
87
88
|
- spec/models/column_spec.rb
|
88
89
|
- spec/models/filter_spec.rb
|