couch_potato 0.5.5 → 0.5.6
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/CHANGES.md +4 -0
- data/README.md +1 -1
- data/lib/couch_potato/version.rb +1 -1
- data/lib/couch_potato/view/base_view_spec.rb +5 -1
- data/spec/unit/base_view_spec_spec.rb +5 -0
- metadata +1 -1
data/CHANGES.md
CHANGED
data/README.md
CHANGED
data/lib/couch_potato/version.rb
CHANGED
@@ -32,7 +32,11 @@ module CouchPotato
|
|
32
32
|
def normalize_view_parameters(params)
|
33
33
|
normalized_params = params.dup
|
34
34
|
hash = wrap_in_hash params
|
35
|
-
replace_range_key
|
35
|
+
remove_nil_stale(replace_range_key(hash))
|
36
|
+
end
|
37
|
+
|
38
|
+
def remove_nil_stale(params)
|
39
|
+
params.reject{|name, value| name.to_s == 'stale' && value.nil?}
|
36
40
|
end
|
37
41
|
|
38
42
|
def wrap_in_hash(params)
|
@@ -32,6 +32,11 @@ describe CouchPotato::View::BaseViewSpec, 'initialize' do
|
|
32
32
|
}
|
33
33
|
}.should_not raise_error
|
34
34
|
end
|
35
|
+
|
36
|
+
it "should remove stale when it's nil" do
|
37
|
+
spec = CouchPotato::View::BaseViewSpec.new Object, 'all', {}, {:stale => nil}
|
38
|
+
spec.view_parameters.should == {}
|
39
|
+
end
|
35
40
|
|
36
41
|
it "should convert a range passed as key into startkey and endkey" do
|
37
42
|
spec = CouchPotato::View::BaseViewSpec.new Object, 'all', {}, {:key => '1'..'2'}
|