-
-
Save krainboltgreene/107f007caecca463c2c204a371071768 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/local/Cellar/ruby/2.5.0/bin/ruby -I/usr/local/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib:/usr/local/lib/ruby/gems/2.5.0/gems/rspec-support-3.7.1/lib /usr/local/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/exe/rspec --pattern lib/\*\*\{,/\*/\*\*\}/\*_spec.rb | |
JSONAPI::Realizer::Action::Create | |
#call | |
with a good payload and good headers | |
creates a model (FAILED - 1) | |
Failures: | |
1) JSONAPI::Realizer::Action::Create#call with a good payload and good headers creates a model | |
Failure/Error: resource_class.write_attributes_via_call(model, attributes.select(&resource.method(:valid_attribute?))) | |
NameError: | |
undefined method `valid_attribute?' for class `PhotoRealizer' | |
Did you mean? alias_attribute | |
# ./lib/jsonapi/realizer/action/create.rb:16:in `method' | |
# ./lib/jsonapi/realizer/action/create.rb:16:in `block in call' | |
# ./lib/jsonapi/realizer/action/create.rb:14:in `tap' | |
# ./lib/jsonapi/realizer/action/create.rb:14:in `call' | |
# ./lib/jsonapi/realizer/action/create_spec.rb:7:in `block (3 levels) in <top (required)>' | |
# ./lib/jsonapi/realizer/action/create_spec.rb:47:in `block (4 levels) in <top (required)>' | |
Finished in 0.00644 seconds (files took 0.68237 seconds to load) | |
1 example, 1 failure | |
Failed examples: | |
rspec ./lib/jsonapi/realizer/action/create_spec.rb:46 # JSONAPI::Realizer::Action::Create#call with a good payload and good headers creates a model | |
/usr/local/Cellar/ruby/2.5.0/bin/ruby -I/usr/local/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib:/usr/local/lib/ruby/gems/2.5.0/gems/rspec-support-3.7.1/lib /usr/local/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/exe/rspec --pattern lib/\*\*\{,/\*/\*\*\}/\*_spec.rb failed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/local/Cellar/ruby/2.5.0/bin/ruby -I/usr/local/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib:/usr/local/lib/ruby/gems/2.5.0/gems/rspec-support-3.7.1/lib /usr/local/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/exe/rspec --pattern lib/\*\*\{,/\*/\*\*\}/\*_spec.rb | |
JSONAPI::Realizer::Action::Create | |
#call | |
with a good payload and good headers | |
From: /Users/krainboltgreene/Code/krainboltgreene/jsonapi-realizer/lib/jsonapi/realizer/action/create.rb @ line 16 JSONAPI::Realizer::Action::Create#call: | |
13: def call | |
14: resource.model.tap do |model| | |
15: resource_class.write_attributes_via_call(model, {id: id}) if id | |
=> 16: binding.pry | |
17: resource_class.write_attributes_via_call(model, attributes.select(&resource.method(:valid_attribute?))) | |
18: resource_class.write_attributes_via_call(model, relationships.select(&resource.method(:valid_relationship?)).transform_values(&resource.method(:as_relationship))) | |
19: resource_class.save_via_call(model) | |
20: end | |
21: end | |
[1] pry(#<JSONAPI::Realizer::Action::Create>)> resource | |
=> #<PhotoRealizer:0x00007fa16d608c98 @model=#<Photo:0x00007fa16d608d38 @id="550e8400-e29b-41d4-a716-446655440000">> | |
[2] pry(#<JSONAPI::Realizer::Action::Create>)> resource.class | |
=> PhotoRealizer | |
[3] pry(#<JSONAPI::Realizer::Action::Create>)> resource.class.valid_attribute? | |
ArgumentError: wrong number of arguments (given 0, expected 2) | |
from /Users/krainboltgreene/Code/krainboltgreene/jsonapi-realizer/lib/jsonapi/realizer/resource.rb:51:in `valid_attribute?' | |
[4] pry(#<JSONAPI::Realizer::Action::Create>)> resource.valid_attribute? | |
NoMethodError: undefined method `valid_attribute?' for #<PhotoRealizer:0x00007fa16d608c98> | |
from (pry):4:in `block in call' | |
[5] pry(#<JSONAPI::Realizer::Action::Create>)> | |
creates a model (FAILED - 1) | |
Failures: | |
1) JSONAPI::Realizer::Action::Create#call with a good payload and good headers creates a model | |
Failure/Error: resource_class.write_attributes_via_call(model, attributes.select(&resource.method(:valid_attribute?))) | |
NameError: | |
undefined method `valid_attribute?' for class `#<Class:#<PhotoRealizer:0x00007fa16d608c98>>' | |
Did you mean? alias_attribute | |
# ./lib/jsonapi/realizer/action/create.rb:17:in `method' | |
# ./lib/jsonapi/realizer/action/create.rb:17:in `block in call' | |
# ./lib/jsonapi/realizer/action/create.rb:14:in `tap' | |
# ./lib/jsonapi/realizer/action/create.rb:14:in `call' | |
# ./lib/jsonapi/realizer/action/create_spec.rb:7:in `block (3 levels) in <top (required)>' | |
# ./lib/jsonapi/realizer/action/create_spec.rb:47:in `block (4 levels) in <top (required)>' | |
Finished in 17.7 seconds (files took 0.66092 seconds to load) | |
1 example, 1 failure | |
Failed examples: | |
rspec ./lib/jsonapi/realizer/action/create_spec.rb:46 # JSONAPI::Realizer::Action::Create#call with a good payload and good headers creates a model | |
/usr/local/Cellar/ruby/2.5.0/bin/ruby -I/usr/local/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/lib:/usr/local/lib/ruby/gems/2.5.0/gems/rspec-support-3.7.1/lib /usr/local/lib/ruby/gems/2.5.0/gems/rspec-core-3.7.1/exe/rspec --pattern lib/\*\*\{,/\*/\*\*\}/\*_spec.rb failed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment