File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
lib/spark_api/models/concerns
spec/unit/spark_api/models/concerns Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,8 @@ def create!(arguments = {})
28
28
true
29
29
end
30
30
31
- def update_attributes ( attrs = { } )
32
- attrs . each { | k , v | public_send ( :" #{ k } =" , v ) }
31
+ def update_attributes ( attrs = { } , options = { } )
32
+ load ( attrs , options )
33
33
save!
34
34
end
35
35
Original file line number Diff line number Diff line change @@ -74,4 +74,14 @@ class MyPluralizedModels < Base
74
74
s . should have_been_requested
75
75
end
76
76
77
+ describe "update_attributes" do
78
+ it "loads the attributes" do
79
+ model = MyExampleModel . new
80
+ new_attributes = { Name : "My Name" }
81
+ expect ( model ) . to receive ( :load ) . with ( new_attributes , { } )
82
+ expect ( model ) . to receive ( :save! )
83
+ model . update_attributes ( new_attributes )
84
+ end
85
+ end
86
+
77
87
end
You can’t perform that action at this time.
0 commit comments