Skip to content

Commit

Permalink
add response code assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
p committed Jan 13, 2025
1 parent e6e4fcf commit 3f50937
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion integration/apps/rails-five/spec/integration/di_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
di_test

describe 'ActiveRecord integration' do
subject { JSON.parse(get('di/ar_serializer').body) }
let(:response) { get('di/ar_serializer') }
subject { JSON.parse(response.body) }

it 'is loaded' do
expect(response.code).to eq '200'

# If AR integration is loaded, this output will be the result of
# the custom serializer.
# If AR integration is not loaded, the output here will have a bunch of
Expand Down
5 changes: 4 additions & 1 deletion integration/apps/rails-seven/spec/integration/di_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
di_test

describe 'ActiveRecord integration' do
subject { JSON.parse(get('di/ar_serializer').body) }
let(:response) { get('di/ar_serializer') }
subject { JSON.parse(response.body) }

it 'is loaded' do
expect(response.code).to eq '200'

# If AR integration is loaded, this output will be the result of
# the custom serializer.
# If AR integration is not loaded, the output here will have a bunch of
Expand Down
5 changes: 4 additions & 1 deletion integration/apps/rails-six/spec/integration/di_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
di_test

describe 'ActiveRecord integration' do
subject { JSON.parse(get('di/ar_serializer').body) }
let(:response) { get('di/ar_serializer') }
subject { JSON.parse(response.body) }

it 'is loaded' do
expect(response.code).to eq '200'

# If AR integration is loaded, this output will be the result of
# the custom serializer.
# If AR integration is not loaded, the output here will have a bunch of
Expand Down

0 comments on commit 3f50937

Please sign in to comment.