Skip to content

Make tests passing #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ $ bundle
Add to your `spec/spec_helpers.rb`:

```ruby
# spec/spec_helpers.rb
require 'jsonapi/rspec'

RSpec.configure do |config|
# ...
config.include JSONAPI::RSpec
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.2
0.0.3
16 changes: 9 additions & 7 deletions lib/jsonapi/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@

module JSONAPI
module RSpec
include Id
include Type
include Attributes
include Relationships
include Links
include Meta
include JsonapiObject
if ::RSpec.respond_to?(:configure)
include Id
include Type
include Attributes
include Relationships
include Links
include Meta
include JsonapiObject
end
end
end
2 changes: 2 additions & 0 deletions spec/id_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'spec_helper'

RSpec.describe JSONAPI::RSpec, '#have_id' do
it 'succeeds when id matches' do
expect('id' => 'foo').to have_id('foo')
Expand Down
2 changes: 2 additions & 0 deletions spec/jsonapi_object_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'spec_helper'

RSpec.describe JSONAPI::RSpec, '#have_jsonapi_object' do
context 'when providing no value' do
it 'succeeds when jsonapi object is present' do
Expand Down
2 changes: 2 additions & 0 deletions spec/meta_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'spec_helper'

RSpec.describe JSONAPI::RSpec, '#have_meta' do
context 'when providing no value' do
it 'succeeds when meta is present' do
Expand Down
2 changes: 2 additions & 0 deletions spec/type_spec.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'spec_helper'

RSpec.describe JSONAPI::RSpec, '#have_type' do
it 'succeeds when type matches' do
expect('type' => 'foo').to have_type('foo')
Expand Down