Closed artem-galas closed 7 years ago
Your spec is failing because your payload does not have a full_name
attribute (it has first_name
and last_name
).
@beauby Thanks for your reply. Yes, I have been mistaken, sorry :(
Other issue - after adding 'jsonapi-rspec' gem into Gemfile I can't run rails routes
/ rails db:migrate
or any other rails task.
I am getting the next error
rails routes
rails aborted!
NameError: uninitialized constant RSpec::Matchers
/Users/artemgalas/.rvm/gems/ruby-2.4.1@easylead/gems/jsonapi-rspec-0.0.2/lib/jsonapi/rspec/id.rb:4:in `<module:Id>'
/Users/artemgalas/.rvm/gems/ruby-2.4.1@easylead/gems/jsonapi-rspec-0.0.2/lib/jsonapi/rspec/id.rb:3:in `<module:RSpec>'
/Users/artemgalas/.rvm/gems/ruby-2.4.1@easylead/gems/jsonapi-rspec-0.0.2/lib/jsonapi/rspec/id.rb:2:in `<module:JSONAPI>'
/Users/artemgalas/.rvm/gems/ruby-2.4.1@easylead/gems/jsonapi-rspec-0.0.2/lib/jsonapi/rspec/id.rb:1:in `<top (required)>'
/Users/artemgalas/.rvm/gems/ruby-2.4.1@easylead/gems/jsonapi-rspec-0.0.2/lib/jsonapi/rspec.rb:1:in `<top (required)>'
I don't understand how should
have_attributes
method work. I am getting suchjson[‘data’]
but I get such error when I run test -
My
spec_helper.rb
My
file_spec.rb