File tree Expand file tree Collapse file tree 5 files changed +9
-6
lines changed
spec/unit/spark_api/models Expand file tree Collapse file tree 5 files changed +9
-6
lines changed Original file line number Diff line number Diff line change
1
+ v1.4.4
2
+ - Fixed symbol hash key bug in Defaultable
3
+
1
4
v1.4.3
2
5
- Change Finders and Defaultable to handle an api response of an empty array when finding a single resource.
3
6
Original file line number Diff line number Diff line change 1
1
2
2
guard :rspec , cmd : 'rspec' do
3
3
watch ( %r{^spec/.+_spec\. rb$} )
4
- watch ( %r{^lib/(.+)\. rb$} ) { |m | "spec/lib /#{ m [ 1 ] } _spec.rb" }
4
+ watch ( %r{^lib/(.+)\. rb$} ) { |m | "spec/unit /#{ m [ 1 ] } _spec.rb" }
5
5
watch ( 'spec/spec_helper.rb' ) { "spec" }
6
6
end
Original file line number Diff line number Diff line change 1
- 1.4.3
1
+ 1.4.4
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ module ClassMethods
21
21
def default ( options = { } )
22
22
response = connection . get ( "/#{ element_name } /default" , options ) . first
23
23
unless response . nil?
24
- response [ :Id ] = DEFAULT_ID if response [ :Id ] . nil?
24
+ response [ "Id" ] = DEFAULT_ID if response [ "Id" ] . nil?
25
25
new ( response )
26
26
end
27
27
end
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class TestClass < Base
15
15
describe 'default' do
16
16
17
17
it 'returns an instance of the class' do
18
- allow ( TestClass ) . to receive ( :connection ) . and_return ( double ( get : [ { Name : 'foo' } ] ) )
18
+ allow ( TestClass ) . to receive ( :connection ) . and_return ( double ( get : [ { " Name" => 'foo' } ] ) )
19
19
expect ( TestClass . default ) . to be_a TestClass
20
20
end
21
21
@@ -25,12 +25,12 @@ class TestClass < Base
25
25
end
26
26
27
27
it "assigns the default id to the instance if it doesn't have an id" do
28
- allow ( TestClass ) . to receive ( :connection ) . and_return ( double ( get : [ { Name : 'foo' } ] ) )
28
+ allow ( TestClass ) . to receive ( :connection ) . and_return ( double ( get : [ { " Name" => 'foo' } ] ) )
29
29
expect ( TestClass . default . Id ) . to eq TestClass ::DEFAULT_ID
30
30
end
31
31
32
32
it "doesn't override the id if one is present" do
33
- allow ( TestClass ) . to receive ( :connection ) . and_return ( double ( get : [ { Id : '5' , Name : 'foo' } ] ) )
33
+ allow ( TestClass ) . to receive ( :connection ) . and_return ( double ( get : [ { "Id" => '5' , " Name" => 'foo' } ] ) )
34
34
expect ( TestClass . default . Id ) . to eq '5'
35
35
end
36
36
You can’t perform that action at this time.
0 commit comments