Skip to content

Commit 27bbefd

Browse files
committed
Don't convert actual id in have_id matcher
1 parent 2162b92 commit 27bbefd

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

lib/jsonapi/rspec/id.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module RSpec
33
module Id
44
::RSpec::Matchers.define :have_id do |expected|
55
match do |actual|
6-
JSONAPI::RSpec.as_indifferent_hash(actual)['id'].to_s == expected.to_s
6+
JSONAPI::RSpec.as_indifferent_hash(actual)['id'] == expected.to_s
77
end
88
end
99
end

spec/jsonapi/id_spec.rb

-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
expect('id' => '123').to have_id(123)
1010
end
1111

12-
it 'succeeds when id is symbol' do
13-
expect('id' => :foo).to have_id('foo')
14-
end
15-
1612
it 'fails when id mismatches' do
1713
expect('id' => 'foo').not_to have_id('bar')
1814
end

0 commit comments

Comments
 (0)