paginative 0.0.23 → 0.1.0

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.
@@ -27,7 +27,7 @@ describe TestModel do
27
27
  it "doesn't return values less than the passed in value" do
28
28
  create_models
29
29
 
30
- TestModel.with_field_from("created_at", @model3.created_at).should eq [@model3, @model4, @model5]
30
+ TestModel.with_field_from("created_at", @model3.created_at).should eq [@model4, @model5]
31
31
  end
32
32
 
33
33
  it "works on INT values" do
@@ -37,7 +37,7 @@ describe TestModel do
37
37
  end
38
38
 
39
39
  it "escapes single quotes in the passed in field" do
40
- models = FactoryGirl.create_list(:test_model)
40
+ models = FactoryGirl.create_list(:test_model, 2)
41
41
 
42
42
  TestModel.with_field_from("name", "krystal's farm")
43
43
  end
@@ -124,4 +124,17 @@ describe TestModel do
124
124
  expect(TestModel.by_distance_from(-37,144,0,2)).to eq [@first, @second]
125
125
  end
126
126
  end
127
+
128
+ context "Multiple Columns" do
129
+ before do
130
+ @first = FactoryGirl.create(:test_model, name: 'abc', address: 'abc')
131
+ @second = FactoryGirl.create(:test_model, name: 'abc', address: 'bcd')
132
+ @third = FactoryGirl.create(:test_model, name: 'abc', address: 'cde')
133
+ @fourth = FactoryGirl.create(:test_model, name: 'abc', address: 'def')
134
+ end
135
+
136
+ it 'can be paginated on the secondary column' do
137
+ expect(TestModel.with_field_from(["name", "address"], ["abc", "bcd"])).to eq [@third, @fourth]
138
+ end
139
+ end
127
140
  end
data/spec/spec_helper.rb CHANGED
@@ -18,7 +18,7 @@ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
18
18
 
19
19
  # Checks for pending migrations before tests are run.
20
20
  # If you are not using ActiveRecord, you can remove this line.
21
- ActiveRecord::Migration.maintain_test_schema!
21
+ # ActiveRecord::Migration.maintain_test_schema!
22
22
 
23
23
  RSpec.configure do |config|
24
24
  # ## Mock Framework
@@ -47,20 +47,6 @@ RSpec.configure do |config|
47
47
  # the seed, which is printed after each run.
48
48
  # --seed 1234
49
49
  config.order = "random"
50
-
51
- config.before(:suite) do
52
- DatabaseCleaner.strategy = :transaction
53
- DatabaseCleaner.clean_with(:truncation)
54
- end
55
-
56
- config.before(:each) do
57
- DatabaseCleaner.start
58
- end
59
-
60
- config.after(:each) do
61
- DatabaseCleaner.clean
62
- end
63
-
64
50
  end
65
51
 
66
52
  Geocoder.configure(:lookup => :test)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paginative
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.23
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Norman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-15 00:00:00.000000000 Z
11
+ date: 2015-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 2.14.2
69
+ - !ruby/object:Gem::Dependency
70
+ name: test-unit
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: capybara
71
85
  requirement: !ruby/object:Gem::Requirement