Skip to content

Commit 7c39ac5

Browse files
committed
fixed specs
1 parent 55f7a30 commit 7c39ac5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/jsonapi_errorable/serializers/validation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Serializers
33
class Validation
44
attr_reader :object
55

6-
def initialize(object, relationship_params, relationship_message = {})
6+
def initialize(object, relationship_params = {}, relationship_message = {})
77
@object = object
88
@relationship_params = relationship_params || {}
99
@relationship_message = relationship_message

spec/serializers/serializable_validation_spec.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@
1818
subject { instance.errors }
1919

2020
before do
21-
allow(object).to receive(:respond_to?).with(:username) { true }
21+
allow(object).to receive(:respond_to?).with(:errors) { true }
2222
end
2323

2424
context 'when the error is on an attribute' do
25+
before do
26+
allow(object).to receive(:respond_to?).with(:username) { true }
27+
end
28+
2529
it 'renders valid JSONAPI error format' do
2630
expect(subject).to eq(
2731
[

0 commit comments

Comments
 (0)