|
23 | 23 |
|
24 | 24 | describe '#have_jsonapi_attributes' do
|
25 | 25 | it { expect(doc).to have_relationship(:posts) }
|
| 26 | + it { expect(doc).to have_relationship('posts') } |
26 | 27 | it { expect(doc).not_to have_relationship(:mails) }
|
| 28 | + it { expect(doc).not_to have_relationship('mails') } |
27 | 29 | it { expect(doc).to have_relationship(:posts).with_data({ 'id' => '1', 'type' => 'posts' }) }
|
| 30 | + it { expect(doc).to have_relationship('posts').with_data({ 'id' => '1', 'type' => 'posts' }) } |
| 31 | + it { expect(doc).to have_relationship(:posts).with_data({ id: '1', type: 'posts' }) } |
| 32 | + it { expect(doc).to have_relationship('posts').with_data({ id: '1', type: 'posts' }) } |
28 | 33 | it do
|
29 | 34 | expect(doc).to have_relationship(:comments).with_data(
|
30 | 35 | [{ 'id' => '1', 'type' => 'posts' }, { 'id' => '2', 'type' => 'hides' }]
|
31 | 36 | )
|
32 | 37 | end
|
| 38 | + it do |
| 39 | + expect(doc).to have_relationship('comments').with_data( |
| 40 | + [{ 'id' => '1', 'type' => 'posts' }, { 'id' => '2', 'type' => 'hides' }] |
| 41 | + ) |
| 42 | + end |
| 43 | + it do |
| 44 | + expect(doc).to have_relationship(:comments).with_data( |
| 45 | + [{ id: '1', type: 'posts' }, { id: '2', type: 'hides' }] |
| 46 | + ) |
| 47 | + end |
| 48 | + it do |
| 49 | + expect(doc).to have_relationship('comments').with_data( |
| 50 | + [{ id: '1', type: 'posts' }, { id: '2', type: 'hides' }] |
| 51 | + ) |
| 52 | + end |
33 | 53 | end
|
34 | 54 |
|
35 | 55 | describe '#have_relationships' do
|
36 | 56 | it { expect(doc).to have_relationships(:posts, :comments) }
|
37 | 57 | it { expect(doc).to have_relationships('posts', 'comments') }
|
38 | 58 | it { expect(doc).not_to have_relationships(:posts, :comments, :mails) }
|
| 59 | + it { expect(doc).not_to have_relationships('posts', 'comments', 'mails') } |
39 | 60 | end
|
40 | 61 | end
|
0 commit comments